libdrm: drmCheckModesettingSupported: Fix for FreeBSD
Remove some useless busid rewritting. Signed-off-by: Emmanuel Vadot <manu@FreeBSD.org> Reviewed-by: Eric Engestrom <eric@engestrom.ch> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>main
parent
13c9de39a6
commit
24e68525dc
|
@ -800,19 +800,11 @@ drm_public int drmCheckModesettingSupported(const char *busid)
|
||||||
if (found)
|
if (found)
|
||||||
return 0;
|
return 0;
|
||||||
#elif defined (__FreeBSD__) || defined (__FreeBSD_kernel__)
|
#elif defined (__FreeBSD__) || defined (__FreeBSD_kernel__)
|
||||||
char kbusid[1024], sbusid[1024];
|
char sbusid[1024];
|
||||||
char oid[128];
|
char oid[128];
|
||||||
int domain, bus, dev, func;
|
|
||||||
int i, modesetting, ret;
|
int i, modesetting, ret;
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
ret = sscanf(busid, "pci:%04x:%02x:%02x.%d", &domain, &bus, &dev,
|
|
||||||
&func);
|
|
||||||
if (ret != 4)
|
|
||||||
return -EINVAL;
|
|
||||||
snprintf(kbusid, sizeof(kbusid), "pci:%04x:%02x:%02x.%d", domain, bus,
|
|
||||||
dev, func);
|
|
||||||
|
|
||||||
/* How many GPUs do we expect in the machine ? */
|
/* How many GPUs do we expect in the machine ? */
|
||||||
for (i = 0; i < 16; i++) {
|
for (i = 0; i < 16; i++) {
|
||||||
snprintf(oid, sizeof(oid), "hw.dri.%d.busid", i);
|
snprintf(oid, sizeof(oid), "hw.dri.%d.busid", i);
|
||||||
|
@ -823,7 +815,7 @@ drm_public int drmCheckModesettingSupported(const char *busid)
|
||||||
continue;
|
continue;
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
if (strcmp(sbusid, kbusid) != 0)
|
if (strcmp(sbusid, busid) != 0)
|
||||||
continue;
|
continue;
|
||||||
snprintf(oid, sizeof(oid), "hw.dri.%d.modesetting", i);
|
snprintf(oid, sizeof(oid), "hw.dri.%d.modesetting", i);
|
||||||
len = sizeof(modesetting);
|
len = sizeof(modesetting);
|
||||||
|
|
Loading…
Reference in New Issue