hw/xfree86/common: remove {fb,platform,pci,sbus}SlotClaimed

These were global variables that were tracking how many
slots of one kind were claimed by drivers,
or if slots of one kind were claimed by drivers.

There were used inconsistently, sometimes they were `int`'s,
sometimes they were `Bool`'s.

All they were doing was to kill the server in various circumstances,
that were often incorrect and lead to bug reports, and guard against
a very speciffic kind of driver code error in `xf86ClaimFbSlot`,
that was also prone to false-positives.

Now that both these uses were removed,
these globals are no longer used, so we can remove them.

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
This commit is contained in:
stefan11111
2025-09-13 11:51:57 +03:00
committed by Enrico Weigelt
parent d3fd8c385b
commit d09b3dae3e
5 changed files with 0 additions and 19 deletions

View File

@@ -67,11 +67,6 @@ extern BusRec primaryBus;
int xf86AllocateEntity(void);
BusType StringToBusType(const char *busID, const char **retID);
extern Bool fbSlotClaimed;
extern Bool sbusSlotClaimed;
extern int platformSlotClaimed;
extern int pciSlotClaimed;
Bool xf86ComparePciBusString(const char *busID, int bus, int device, int func);
Bool xf86DriverHasEntities(DriverPtr drvp);
void xf86RemoveEntityFromScreen(ScrnInfoPtr pScrn, int entityIndex);

View File

@@ -44,8 +44,6 @@
#include "xf86Bus.h"
#include "xf86_OSproc.h"
Bool fbSlotClaimed = FALSE;
int
xf86ClaimFbSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active)
{
@@ -61,6 +59,5 @@ xf86ClaimFbSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active)
p->inUse = FALSE;
xf86AddDevToEntity(num, dev);
fbSlotClaimed = TRUE;
return num;
}

View File

@@ -53,8 +53,6 @@
#define PCI_VENDOR_GENERIC 0x00FF
/* Bus-specific globals */
int pciSlotClaimed = 0;
#define PCIINFOCLASSES(c) \
( (((c) & 0x00ff0000) == (PCI_CLASS_PREHISTORIC << 16)) \
@@ -225,7 +223,6 @@ xf86ClaimPciSlot(struct pci_device *d, DriverPtr drvp,
p->inUse = FALSE;
if (dev)
xf86AddDevToEntity(num, dev);
pciSlotClaimed++;
return num;
}
@@ -247,7 +244,6 @@ xf86UnclaimPciSlot(struct pci_device *d, GDevPtr dev)
if ((p->bus.type == BUS_PCI) && (p->bus.id.pci == d)) {
/* Probably the slot should be deallocated? */
xf86RemoveDevFromEntity(i, dev);
pciSlotClaimed--;
p->bus.type = BUS_NONE;
return;
}

View File

@@ -58,8 +58,6 @@
#include "xf86Config.h"
#include "xf86Crtc.h"
int platformSlotClaimed;
int xf86_num_platform_devices;
struct xf86_platform_device *xf86_platform_devices;
@@ -396,7 +394,6 @@ xf86ClaimPlatformSlot(struct xf86_platform_device * d, DriverPtr drvp,
if (dev)
xf86AddDevToEntity(num, dev);
platformSlotClaimed++;
return num;
}
else
@@ -414,7 +411,6 @@ xf86UnclaimPlatformSlot(struct xf86_platform_device *d, GDevPtr dev)
if ((p->bus.type == BUS_PLATFORM) && (p->bus.id.plat == d)) {
if (dev)
xf86RemoveDevFromEntity(i, dev);
platformSlotClaimed--;
p->bus.type = BUS_NONE;
return 0;
}

View File

@@ -40,8 +40,6 @@
#include "xf86sbusBus_priv.h"
#include "xf86Sbus.h"
Bool sbusSlotClaimed = FALSE;
static int xf86nSbusInfo;
static void
@@ -366,7 +364,6 @@ xf86ClaimSbusSlot(sbusDevicePtr psdp, DriverPtr drvp, GDevPtr dev, Bool active)
p->bus.id.sbus.fbNum = psdp->fbNum;
p->active = active;
p->inUse = FALSE;
sbusSlotClaimed = TRUE;
return num;
}
else