win32u: Remove driver-specific id from struct gdi_gpu.

This commit is contained in:
Rémi Bernon 2024-04-22 18:16:07 +02:00 committed by Alexandre Julliard
parent 62c60a9e10
commit 0300016ac5
7 changed files with 32 additions and 19 deletions

View file

@ -1141,7 +1141,6 @@ BOOL macdrv_UpdateDisplayDevices( const struct gdi_device_manager *device_manage
{
struct gdi_gpu gdi_gpu =
{
.id = gpu->id,
.pci_id =
{
.vendor = gpu->vendor_id,

View file

@ -204,8 +204,7 @@ static void wayland_add_device_gpu(const struct gdi_device_manager *device_manag
struct gdi_gpu gpu = {0};
lstrcpyW(gpu.name, wayland_gpuW);
TRACE("id=0x%s name=%s\n",
wine_dbgstr_longlong(gpu.id), wine_dbgstr_w(gpu.name));
TRACE("name=%s\n", wine_dbgstr_w(gpu.name));
device_manager->add_gpu(&gpu, param);
}

View file

@ -395,7 +395,7 @@ POINT root_to_virtual_screen(INT x, INT y)
RECT get_host_primary_monitor_rect(void)
{
INT gpu_count, adapter_count, monitor_count;
struct gdi_gpu *gpus = NULL;
struct x11drv_gpu *gpus = NULL;
struct x11drv_adapter *adapters = NULL;
struct gdi_monitor *monitors = NULL;
RECT rect = {0};
@ -497,7 +497,7 @@ BOOL X11DRV_UpdateDisplayDevices( const struct gdi_device_manager *device_manage
{
struct x11drv_adapter *adapters;
struct gdi_monitor *monitors;
struct gdi_gpu *gpus;
struct x11drv_gpu *gpus;
INT gpu_count, adapter_count, monitor_count;
INT gpu, adapter, monitor;
DEVMODEW *modes;
@ -514,7 +514,14 @@ BOOL X11DRV_UpdateDisplayDevices( const struct gdi_device_manager *device_manage
for (gpu = 0; gpu < gpu_count; gpu++)
{
device_manager->add_gpu( &gpus[gpu], param );
struct gdi_gpu gdi_gpu =
{
.pci_id = gpus[gpu].pci_id,
.vulkan_uuid = gpus[gpu].vulkan_uuid,
.memory_size = gpus[gpu].memory_size,
};
memcpy( gdi_gpu.name, gpus[gpu].name, sizeof(gdi_gpu.name) );
device_manager->add_gpu( &gdi_gpu, param );
/* Initialize adapters */
if (!host_handler.get_adapters( gpus[gpu].id, &adapters, &adapter_count )) break;

View file

@ -764,6 +764,15 @@ void init_user_driver(void);
/* X11 display device handler. Used to initialize display device registry data */
struct x11drv_gpu
{
ULONG_PTR id;
WCHAR name[128];
struct pci_id pci_id;
GUID vulkan_uuid;
ULONGLONG memory_size;
};
struct x11drv_adapter
{
ULONG_PTR id;
@ -782,7 +791,7 @@ struct x11drv_display_device_handler
/* get_gpus will be called to get a list of GPUs. First GPU has to be where the primary adapter is.
*
* Return FALSE on failure with parameters unchanged */
BOOL (*get_gpus)(struct gdi_gpu **gpus, int *count, BOOL get_properties);
BOOL (*get_gpus)(struct x11drv_gpu **gpus, int *count, BOOL get_properties);
/* get_adapters will be called to get a list of adapters in EnumDisplayDevices context under a GPU.
* The first adapter has to be primary if GPU is primary.
@ -797,7 +806,7 @@ struct x11drv_display_device_handler
BOOL (*get_monitors)(ULONG_PTR adapter_id, struct gdi_monitor **monitors, int *count);
/* free_gpus will be called to free a GPU list from get_gpus */
void (*free_gpus)(struct gdi_gpu *gpus);
void (*free_gpus)(struct x11drv_gpu *gpus);
/* free_adapters will be called to free an adapter list from get_adapters */
void (*free_adapters)(struct x11drv_adapter *adapters);

View file

@ -190,10 +190,10 @@ done:
return ret;
}
static BOOL xinerama_get_gpus( struct gdi_gpu **new_gpus, int *count, BOOL get_properties )
static BOOL xinerama_get_gpus( struct x11drv_gpu **new_gpus, int *count, BOOL get_properties )
{
static const WCHAR wine_adapterW[] = {'W','i','n','e',' ','A','d','a','p','t','e','r',0};
struct gdi_gpu *gpus;
struct x11drv_gpu *gpus;
/* Xinerama has no support for GPU, faking one */
gpus = calloc( 1, sizeof(*gpus) );
@ -208,7 +208,7 @@ static BOOL xinerama_get_gpus( struct gdi_gpu **new_gpus, int *count, BOOL get_p
return TRUE;
}
static void xinerama_free_gpus( struct gdi_gpu *gpus )
static void xinerama_free_gpus( struct x11drv_gpu *gpus )
{
free( gpus );
}

View file

@ -627,8 +627,8 @@ static BOOL is_crtc_primary( RECT primary, const XRRCrtcInfo *crtc )
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDisplayKHR)
static BOOL get_gpu_properties_from_vulkan( struct gdi_gpu *gpu, const XRRProviderInfo *provider_info,
struct gdi_gpu *prev_gpus, int prev_gpu_count )
static BOOL get_gpu_properties_from_vulkan( struct x11drv_gpu *gpu, const XRRProviderInfo *provider_info,
struct x11drv_gpu *prev_gpus, int prev_gpu_count )
{
static const char *extensions[] =
{
@ -768,10 +768,10 @@ done:
/* Get a list of GPUs reported by XRandR 1.4. Set get_properties to FALSE if GPU properties are
* not needed to avoid unnecessary querying */
static BOOL xrandr14_get_gpus( struct gdi_gpu **new_gpus, int *count, BOOL get_properties )
static BOOL xrandr14_get_gpus( struct x11drv_gpu **new_gpus, int *count, BOOL get_properties )
{
static const WCHAR wine_adapterW[] = {'W','i','n','e',' ','A','d','a','p','t','e','r',0};
struct gdi_gpu *gpus = NULL;
struct x11drv_gpu *gpus = NULL;
XRRScreenResources *screen_resources = NULL;
XRRProviderResources *provider_resources = NULL;
XRRProviderInfo *provider_info = NULL;
@ -844,7 +844,7 @@ static BOOL xrandr14_get_gpus( struct gdi_gpu **new_gpus, int *count, BOOL get_p
/* Make primary GPU the first */
if (primary_provider > 0)
{
struct gdi_gpu tmp = gpus[0];
struct x11drv_gpu tmp = gpus[0];
gpus[0] = gpus[primary_provider];
gpus[primary_provider] = tmp;
}
@ -865,7 +865,7 @@ done:
return ret;
}
static void xrandr14_free_gpus( struct gdi_gpu *gpus )
static void xrandr14_free_gpus( struct x11drv_gpu *gpus )
{
free( gpus );
}
@ -1253,7 +1253,7 @@ static BOOL xrandr14_get_id( const WCHAR *device_name, BOOL is_primary, x11drv_s
INT gpu_count, adapter_count, new_current_mode_count = 0;
INT gpu_idx, adapter_idx, display_idx;
struct x11drv_adapter *adapters;
struct gdi_gpu *gpus;
struct x11drv_gpu *gpus;
WCHAR *end;
/* Parse \\.\DISPLAY%d */

View file

@ -247,7 +247,6 @@ struct pci_id
struct gdi_gpu
{
ULONG_PTR id;
WCHAR name[128];
struct pci_id pci_id;
GUID vulkan_uuid; /* Vulkan device UUID */