mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-05 18:01:34 +00:00
win32u: Move D3DKMT VidPn* functions out of winex11.
This commit is contained in:
parent
7299d3728a
commit
00a541d6a0
11 changed files with 138 additions and 200 deletions
|
@ -46,9 +46,18 @@ struct d3dkmt_device
|
|||
struct list entry; /* List entry */
|
||||
};
|
||||
|
||||
struct d3dkmt_vidpn_source
|
||||
{
|
||||
D3DKMT_VIDPNSOURCEOWNER_TYPE type; /* VidPN source owner type */
|
||||
D3DDDI_VIDEO_PRESENT_SOURCE_ID id; /* VidPN present source id */
|
||||
D3DKMT_HANDLE device; /* Kernel mode device context */
|
||||
struct list entry; /* List entry */
|
||||
};
|
||||
|
||||
static pthread_mutex_t d3dkmt_lock = PTHREAD_MUTEX_INITIALIZER;
|
||||
static struct list d3dkmt_adapters = LIST_INIT( d3dkmt_adapters );
|
||||
static struct list d3dkmt_devices = LIST_INIT( d3dkmt_devices );
|
||||
static struct list d3dkmt_vidpn_sources = LIST_INIT( d3dkmt_vidpn_sources ); /* VidPN source information list */
|
||||
|
||||
/******************************************************************************
|
||||
* NtGdiDdDDIOpenAdapterFromHdc (win32u.@)
|
||||
|
@ -187,9 +196,8 @@ NTSTATUS WINAPI NtGdiDdDDICreateDevice( D3DKMT_CREATEDEVICE *desc )
|
|||
*/
|
||||
NTSTATUS WINAPI NtGdiDdDDIDestroyDevice( const D3DKMT_DESTROYDEVICE *desc )
|
||||
{
|
||||
NTSTATUS status = STATUS_INVALID_PARAMETER;
|
||||
D3DKMT_SETVIDPNSOURCEOWNER set_owner_desc;
|
||||
struct d3dkmt_device *device;
|
||||
D3DKMT_SETVIDPNSOURCEOWNER set_owner_desc = {0};
|
||||
struct d3dkmt_device *device, *found = NULL;
|
||||
|
||||
TRACE( "(%p)\n", desc );
|
||||
|
||||
|
@ -200,18 +208,19 @@ NTSTATUS WINAPI NtGdiDdDDIDestroyDevice( const D3DKMT_DESTROYDEVICE *desc )
|
|||
{
|
||||
if (device->handle == desc->hDevice)
|
||||
{
|
||||
memset( &set_owner_desc, 0, sizeof(set_owner_desc) );
|
||||
set_owner_desc.hDevice = desc->hDevice;
|
||||
NtGdiDdDDISetVidPnSourceOwner( &set_owner_desc );
|
||||
list_remove( &device->entry );
|
||||
free( device );
|
||||
status = STATUS_SUCCESS;
|
||||
found = device;
|
||||
break;
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock( &d3dkmt_lock );
|
||||
|
||||
return status;
|
||||
if (!found) return STATUS_INVALID_PARAMETER;
|
||||
|
||||
set_owner_desc.hDevice = desc->hDevice;
|
||||
NtGdiDdDDISetVidPnSourceOwner( &set_owner_desc );
|
||||
free( found );
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
@ -275,18 +284,115 @@ NTSTATUS WINAPI NtGdiDdDDISetQueuedLimit( D3DKMT_SETQUEUEDLIMIT *desc )
|
|||
*/
|
||||
NTSTATUS WINAPI NtGdiDdDDISetVidPnSourceOwner( const D3DKMT_SETVIDPNSOURCEOWNER *desc )
|
||||
{
|
||||
TRACE( "(%p)\n", desc );
|
||||
struct d3dkmt_vidpn_source *source, *source2;
|
||||
BOOL found;
|
||||
UINT i;
|
||||
|
||||
if (!get_display_driver()->pD3DKMTSetVidPnSourceOwner) return STATUS_PROCEDURE_NOT_FOUND;
|
||||
TRACE( "(%p)\n", desc );
|
||||
|
||||
if (!desc || !desc->hDevice || (desc->VidPnSourceCount && (!desc->pType || !desc->pVidPnSourceId)))
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
|
||||
/* Store the VidPN source ownership info in the graphics driver because
|
||||
* the graphics driver needs to change ownership sometimes. For example,
|
||||
* when a new window is moved to a VidPN source with an exclusive owner,
|
||||
* such an exclusive owner will be released before showing the new window */
|
||||
return get_display_driver()->pD3DKMTSetVidPnSourceOwner( desc );
|
||||
pthread_mutex_lock( &d3dkmt_lock );
|
||||
|
||||
/* Check parameters */
|
||||
for (i = 0; i < desc->VidPnSourceCount; ++i)
|
||||
{
|
||||
LIST_FOR_EACH_ENTRY( source, &d3dkmt_vidpn_sources, struct d3dkmt_vidpn_source, entry )
|
||||
{
|
||||
if (source->id == desc->pVidPnSourceId[i])
|
||||
{
|
||||
/* Same device */
|
||||
if (source->device == desc->hDevice)
|
||||
{
|
||||
if ((source->type == D3DKMT_VIDPNSOURCEOWNER_EXCLUSIVE &&
|
||||
(desc->pType[i] == D3DKMT_VIDPNSOURCEOWNER_SHARED ||
|
||||
desc->pType[i] == D3DKMT_VIDPNSOURCEOWNER_EMULATED)) ||
|
||||
(source->type == D3DKMT_VIDPNSOURCEOWNER_EMULATED &&
|
||||
desc->pType[i] == D3DKMT_VIDPNSOURCEOWNER_EXCLUSIVE))
|
||||
{
|
||||
pthread_mutex_unlock( &d3dkmt_lock );
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
}
|
||||
/* Different devices */
|
||||
else
|
||||
{
|
||||
if ((source->type == D3DKMT_VIDPNSOURCEOWNER_EXCLUSIVE || source->type == D3DKMT_VIDPNSOURCEOWNER_EMULATED) &&
|
||||
(desc->pType[i] == D3DKMT_VIDPNSOURCEOWNER_EXCLUSIVE ||
|
||||
desc->pType[i] == D3DKMT_VIDPNSOURCEOWNER_EMULATED))
|
||||
{
|
||||
pthread_mutex_unlock( &d3dkmt_lock );
|
||||
return STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* On Windows, it seems that all video present sources are owned by DMM clients, so any attempt to set
|
||||
* D3DKMT_VIDPNSOURCEOWNER_SHARED come back STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE */
|
||||
if (desc->pType[i] == D3DKMT_VIDPNSOURCEOWNER_SHARED)
|
||||
{
|
||||
pthread_mutex_unlock( &d3dkmt_lock );
|
||||
return STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE;
|
||||
}
|
||||
|
||||
/* FIXME: D3DKMT_VIDPNSOURCEOWNER_EXCLUSIVEGDI unsupported */
|
||||
if (desc->pType[i] == D3DKMT_VIDPNSOURCEOWNER_EXCLUSIVEGDI || desc->pType[i] > D3DKMT_VIDPNSOURCEOWNER_EMULATED)
|
||||
{
|
||||
pthread_mutex_unlock( &d3dkmt_lock );
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
}
|
||||
|
||||
/* Remove owner */
|
||||
if (!desc->VidPnSourceCount && !desc->pType && !desc->pVidPnSourceId)
|
||||
{
|
||||
LIST_FOR_EACH_ENTRY_SAFE( source, source2, &d3dkmt_vidpn_sources, struct d3dkmt_vidpn_source, entry )
|
||||
{
|
||||
if (source->device == desc->hDevice)
|
||||
{
|
||||
list_remove( &source->entry );
|
||||
free( source );
|
||||
}
|
||||
}
|
||||
|
||||
pthread_mutex_unlock( &d3dkmt_lock );
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/* Add owner */
|
||||
for (i = 0; i < desc->VidPnSourceCount; ++i)
|
||||
{
|
||||
found = FALSE;
|
||||
LIST_FOR_EACH_ENTRY( source, &d3dkmt_vidpn_sources, struct d3dkmt_vidpn_source, entry )
|
||||
{
|
||||
if (source->device == desc->hDevice && source->id == desc->pVidPnSourceId[i])
|
||||
{
|
||||
found = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (found) source->type = desc->pType[i];
|
||||
else
|
||||
{
|
||||
source = malloc( sizeof(*source) );
|
||||
if (!source)
|
||||
{
|
||||
pthread_mutex_unlock( &d3dkmt_lock );
|
||||
return STATUS_NO_MEMORY;
|
||||
}
|
||||
|
||||
source->id = desc->pVidPnSourceId[i];
|
||||
source->type = desc->pType[i];
|
||||
source->device = desc->hDevice;
|
||||
list_add_tail( &d3dkmt_vidpn_sources, &source->entry );
|
||||
}
|
||||
}
|
||||
|
||||
pthread_mutex_unlock( &d3dkmt_lock );
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
@ -294,12 +400,23 @@ NTSTATUS WINAPI NtGdiDdDDISetVidPnSourceOwner( const D3DKMT_SETVIDPNSOURCEOWNER
|
|||
*/
|
||||
NTSTATUS WINAPI NtGdiDdDDICheckVidPnExclusiveOwnership( const D3DKMT_CHECKVIDPNEXCLUSIVEOWNERSHIP *desc )
|
||||
{
|
||||
TRACE( "(%p)\n", desc );
|
||||
struct d3dkmt_vidpn_source *source;
|
||||
|
||||
if (!get_display_driver()->pD3DKMTCheckVidPnExclusiveOwnership)
|
||||
return STATUS_PROCEDURE_NOT_FOUND;
|
||||
TRACE( "(%p)\n", desc );
|
||||
|
||||
if (!desc || !desc->hAdapter) return STATUS_INVALID_PARAMETER;
|
||||
|
||||
return get_display_driver()->pD3DKMTCheckVidPnExclusiveOwnership( desc );
|
||||
pthread_mutex_lock( &d3dkmt_lock );
|
||||
|
||||
LIST_FOR_EACH_ENTRY( source, &d3dkmt_vidpn_sources, struct d3dkmt_vidpn_source, entry )
|
||||
{
|
||||
if (source->id == desc->VidPnSourceId && source->type == D3DKMT_VIDPNSOURCEOWNER_EXCLUSIVE)
|
||||
{
|
||||
pthread_mutex_unlock( &d3dkmt_lock );
|
||||
return STATUS_GRAPHICS_PRESENT_OCCLUDED;
|
||||
}
|
||||
}
|
||||
|
||||
pthread_mutex_unlock( &d3dkmt_lock );
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -707,11 +707,9 @@ const struct gdi_dc_funcs dib_driver =
|
|||
dibdrv_StrokeAndFillPath, /* pStrokeAndFillPath */
|
||||
dibdrv_StrokePath, /* pStrokePath */
|
||||
NULL, /* pUnrealizePalette */
|
||||
NULL, /* pD3DKMTCheckVidPnExclusiveOwnership */
|
||||
NULL, /* pD3DKMTCloseAdapter */
|
||||
NULL, /* pD3DKMTOpenAdapterFromLuid */
|
||||
NULL, /* pD3DKMTQueryVideoMemoryInfo */
|
||||
NULL, /* pD3DKMTSetVidPnSourceOwner */
|
||||
GDI_PRIORITY_DIB_DRV /* priority */
|
||||
};
|
||||
|
||||
|
@ -1268,10 +1266,8 @@ static const struct gdi_dc_funcs window_driver =
|
|||
NULL, /* pStrokeAndFillPath */
|
||||
NULL, /* pStrokePath */
|
||||
NULL, /* pUnrealizePalette */
|
||||
NULL, /* pD3DKMTCheckVidPnExclusiveOwnership */
|
||||
NULL, /* pD3DKMTCloseAdapter */
|
||||
NULL, /* pD3DKMTOpenAdapterFromLuid */
|
||||
NULL, /* pD3DKMTQueryVideoMemoryInfo */
|
||||
NULL, /* pD3DKMTSetVidPnSourceOwner */
|
||||
GDI_PRIORITY_DIB_DRV + 10 /* priority */
|
||||
};
|
||||
|
|
|
@ -522,11 +522,6 @@ static BOOL nulldrv_UnrealizePalette( HPALETTE palette )
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
static NTSTATUS nulldrv_D3DKMTCheckVidPnExclusiveOwnership( const D3DKMT_CHECKVIDPNEXCLUSIVEOWNERSHIP *desc )
|
||||
{
|
||||
return STATUS_PROCEDURE_NOT_FOUND;
|
||||
}
|
||||
|
||||
static NTSTATUS nulldrv_D3DKMTCloseAdapter( const D3DKMT_CLOSEADAPTER *desc )
|
||||
{
|
||||
return STATUS_PROCEDURE_NOT_FOUND;
|
||||
|
@ -542,11 +537,6 @@ static NTSTATUS nulldrv_D3DKMTQueryVideoMemoryInfo( D3DKMT_QUERYVIDEOMEMORYINFO
|
|||
return STATUS_PROCEDURE_NOT_FOUND;
|
||||
}
|
||||
|
||||
static NTSTATUS nulldrv_D3DKMTSetVidPnSourceOwner( const D3DKMT_SETVIDPNSOURCEOWNER *desc )
|
||||
{
|
||||
return STATUS_PROCEDURE_NOT_FOUND;
|
||||
}
|
||||
|
||||
const struct gdi_dc_funcs null_driver =
|
||||
{
|
||||
nulldrv_AbortDoc, /* pAbortDoc */
|
||||
|
@ -638,11 +628,9 @@ const struct gdi_dc_funcs null_driver =
|
|||
nulldrv_StrokeAndFillPath, /* pStrokeAndFillPath */
|
||||
nulldrv_StrokePath, /* pStrokePath */
|
||||
nulldrv_UnrealizePalette, /* pUnrealizePalette */
|
||||
nulldrv_D3DKMTCheckVidPnExclusiveOwnership, /* pD3DKMTCheckVidPnExclusiveOwnership */
|
||||
nulldrv_D3DKMTCloseAdapter, /* pD3DKMTCloseAdapter */
|
||||
nulldrv_D3DKMTOpenAdapterFromLuid, /* pD3DKMTOpenAdapterFromLuid */
|
||||
nulldrv_D3DKMTQueryVideoMemoryInfo, /* pD3DKMTQueryVideoMemoryInfo */
|
||||
nulldrv_D3DKMTSetVidPnSourceOwner, /* pD3DKMTSetVidPnSourceOwner */
|
||||
|
||||
GDI_PRIORITY_NULL_DRV /* priority */
|
||||
};
|
||||
|
|
|
@ -519,11 +519,9 @@ static const struct gdi_dc_funcs emfdrv_driver =
|
|||
EMFDRV_StrokeAndFillPath, /* pStrokeAndFillPath */
|
||||
EMFDRV_StrokePath, /* pStrokePath */
|
||||
NULL, /* pUnrealizePalette */
|
||||
NULL, /* pD3DKMTCheckVidPnExclusiveOwnership */
|
||||
NULL, /* pD3DKMTCloseAdapter */
|
||||
NULL, /* pD3DKMTOpenAdapterFromLuid */
|
||||
NULL, /* pD3DKMTQueryVideoMemoryInfo */
|
||||
NULL, /* pD3DKMTSetVidPnSourceOwner */
|
||||
GDI_PRIORITY_GRAPHICS_DRV /* priority */
|
||||
};
|
||||
|
||||
|
|
|
@ -4785,11 +4785,9 @@ const struct gdi_dc_funcs font_driver =
|
|||
NULL, /* pStrokeAndFillPath */
|
||||
NULL, /* pStrokePath */
|
||||
NULL, /* pUnrealizePalette */
|
||||
NULL, /* pD3DKMTCheckVidPnExclusiveOwnership */
|
||||
NULL, /* pD3DKMTCloseAdapter */
|
||||
NULL, /* pD3DKMTOpenAdapterFromLuid */
|
||||
NULL, /* pD3DKMTQueryVideoMemoryInfo */
|
||||
NULL, /* pD3DKMTSetVidPnSourceOwner */
|
||||
GDI_PRIORITY_FONT_DRV /* priority */
|
||||
};
|
||||
|
||||
|
|
|
@ -2118,10 +2118,8 @@ const struct gdi_dc_funcs path_driver =
|
|||
NULL, /* pStrokeAndFillPath */
|
||||
NULL, /* pStrokePath */
|
||||
NULL, /* pUnrealizePalette */
|
||||
NULL, /* pD3DKMTCheckVidPnExclusiveOwnership */
|
||||
NULL, /* pD3DKMTCloseAdapter */
|
||||
NULL, /* pD3DKMTOpenAdapterFromLuid */
|
||||
NULL, /* pD3DKMTQueryVideoMemoryInfo */
|
||||
NULL, /* pD3DKMTSetVidPnSourceOwner */
|
||||
GDI_PRIORITY_PATH_DRV /* priority */
|
||||
};
|
||||
|
|
|
@ -384,11 +384,9 @@ static const struct user_driver_funcs x11drv_funcs =
|
|||
.dc_funcs.pStrokeAndFillPath = X11DRV_StrokeAndFillPath,
|
||||
.dc_funcs.pStrokePath = X11DRV_StrokePath,
|
||||
.dc_funcs.pUnrealizePalette = X11DRV_UnrealizePalette,
|
||||
.dc_funcs.pD3DKMTCheckVidPnExclusiveOwnership = X11DRV_D3DKMTCheckVidPnExclusiveOwnership,
|
||||
.dc_funcs.pD3DKMTCloseAdapter = X11DRV_D3DKMTCloseAdapter,
|
||||
.dc_funcs.pD3DKMTOpenAdapterFromLuid = X11DRV_D3DKMTOpenAdapterFromLuid,
|
||||
.dc_funcs.pD3DKMTQueryVideoMemoryInfo = X11DRV_D3DKMTQueryVideoMemoryInfo,
|
||||
.dc_funcs.pD3DKMTSetVidPnSourceOwner = X11DRV_D3DKMTSetVidPnSourceOwner,
|
||||
.dc_funcs.priority = GDI_PRIORITY_GRAPHICS_DRV,
|
||||
|
||||
.pActivateKeyboardLayout = X11DRV_ActivateKeyboardLayout,
|
||||
|
|
|
@ -158,11 +158,9 @@ extern BOOL X11DRV_Arc( PHYSDEV dev, INT left, INT top, INT right,
|
|||
INT bottom, INT xstart, INT ystart, INT xend, INT yend );
|
||||
extern BOOL X11DRV_Chord( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
|
||||
INT xstart, INT ystart, INT xend, INT yend );
|
||||
extern NTSTATUS X11DRV_D3DKMTCheckVidPnExclusiveOwnership( const D3DKMT_CHECKVIDPNEXCLUSIVEOWNERSHIP *desc );
|
||||
extern NTSTATUS X11DRV_D3DKMTCloseAdapter( const D3DKMT_CLOSEADAPTER *desc );
|
||||
extern NTSTATUS X11DRV_D3DKMTOpenAdapterFromLuid( D3DKMT_OPENADAPTERFROMLUID *desc );
|
||||
extern NTSTATUS X11DRV_D3DKMTQueryVideoMemoryInfo( D3DKMT_QUERYVIDEOMEMORYINFO *desc );
|
||||
extern NTSTATUS X11DRV_D3DKMTSetVidPnSourceOwner( const D3DKMT_SETVIDPNSOURCEOWNER *desc );
|
||||
extern BOOL X11DRV_Ellipse( PHYSDEV dev, INT left, INT top, INT right, INT bottom );
|
||||
extern BOOL X11DRV_ExtFloodFill( PHYSDEV dev, INT x, INT y, COLORREF color, UINT fillType );
|
||||
extern BOOL X11DRV_FillPath( PHYSDEV dev );
|
||||
|
|
|
@ -107,17 +107,8 @@ struct x11_d3dkmt_adapter
|
|||
struct list entry; /* List entry */
|
||||
};
|
||||
|
||||
struct d3dkmt_vidpn_source
|
||||
{
|
||||
D3DKMT_VIDPNSOURCEOWNER_TYPE type; /* VidPN source owner type */
|
||||
D3DDDI_VIDEO_PRESENT_SOURCE_ID id; /* VidPN present source id */
|
||||
D3DKMT_HANDLE device; /* Kernel mode device context */
|
||||
struct list entry; /* List entry */
|
||||
};
|
||||
|
||||
static VkInstance d3dkmt_vk_instance; /* Vulkan instance for D3DKMT functions */
|
||||
static struct list x11_d3dkmt_adapters = LIST_INIT( x11_d3dkmt_adapters );
|
||||
static struct list d3dkmt_vidpn_sources = LIST_INIT( d3dkmt_vidpn_sources ); /* VidPN source information list */
|
||||
|
||||
#define IS_OPTION_TRUE(ch) \
|
||||
((ch) == 'y' || (ch) == 'Y' || (ch) == 't' || (ch) == 'T' || (ch) == '1')
|
||||
|
@ -854,146 +845,6 @@ NTSTATUS X11DRV_D3DKMTCloseAdapter( const D3DKMT_CLOSEADAPTER *desc )
|
|||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
* X11DRV_D3DKMTSetVidPnSourceOwner
|
||||
*/
|
||||
NTSTATUS X11DRV_D3DKMTSetVidPnSourceOwner( const D3DKMT_SETVIDPNSOURCEOWNER *desc )
|
||||
{
|
||||
struct d3dkmt_vidpn_source *source, *source2;
|
||||
NTSTATUS status = STATUS_SUCCESS;
|
||||
BOOL found;
|
||||
UINT i;
|
||||
|
||||
TRACE("(%p)\n", desc);
|
||||
|
||||
pthread_mutex_lock( &d3dkmt_mutex );
|
||||
|
||||
/* Check parameters */
|
||||
for (i = 0; i < desc->VidPnSourceCount; ++i)
|
||||
{
|
||||
LIST_FOR_EACH_ENTRY( source, &d3dkmt_vidpn_sources, struct d3dkmt_vidpn_source, entry )
|
||||
{
|
||||
if (source->id == desc->pVidPnSourceId[i])
|
||||
{
|
||||
/* Same device */
|
||||
if (source->device == desc->hDevice)
|
||||
{
|
||||
if ((source->type == D3DKMT_VIDPNSOURCEOWNER_EXCLUSIVE
|
||||
&& (desc->pType[i] == D3DKMT_VIDPNSOURCEOWNER_SHARED
|
||||
|| desc->pType[i] == D3DKMT_VIDPNSOURCEOWNER_EMULATED))
|
||||
|| (source->type == D3DKMT_VIDPNSOURCEOWNER_EMULATED
|
||||
&& desc->pType[i] == D3DKMT_VIDPNSOURCEOWNER_EXCLUSIVE))
|
||||
{
|
||||
status = STATUS_INVALID_PARAMETER;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
/* Different devices */
|
||||
else
|
||||
{
|
||||
if ((source->type == D3DKMT_VIDPNSOURCEOWNER_EXCLUSIVE
|
||||
|| source->type == D3DKMT_VIDPNSOURCEOWNER_EMULATED)
|
||||
&& (desc->pType[i] == D3DKMT_VIDPNSOURCEOWNER_EXCLUSIVE
|
||||
|| desc->pType[i] == D3DKMT_VIDPNSOURCEOWNER_EMULATED))
|
||||
{
|
||||
status = STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* On Windows, it seems that all video present sources are owned by DMM clients, so any attempt to set
|
||||
* D3DKMT_VIDPNSOURCEOWNER_SHARED come back STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE */
|
||||
if (desc->pType[i] == D3DKMT_VIDPNSOURCEOWNER_SHARED)
|
||||
{
|
||||
status = STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE;
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* FIXME: D3DKMT_VIDPNSOURCEOWNER_EXCLUSIVEGDI unsupported */
|
||||
if (desc->pType[i] == D3DKMT_VIDPNSOURCEOWNER_EXCLUSIVEGDI || desc->pType[i] > D3DKMT_VIDPNSOURCEOWNER_EMULATED)
|
||||
{
|
||||
status = STATUS_INVALID_PARAMETER;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
/* Remove owner */
|
||||
if (!desc->VidPnSourceCount && !desc->pType && !desc->pVidPnSourceId)
|
||||
{
|
||||
LIST_FOR_EACH_ENTRY_SAFE( source, source2, &d3dkmt_vidpn_sources, struct d3dkmt_vidpn_source, entry )
|
||||
{
|
||||
if (source->device == desc->hDevice)
|
||||
{
|
||||
list_remove( &source->entry );
|
||||
free( source );
|
||||
}
|
||||
}
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* Add owner */
|
||||
for (i = 0; i < desc->VidPnSourceCount; ++i)
|
||||
{
|
||||
found = FALSE;
|
||||
LIST_FOR_EACH_ENTRY( source, &d3dkmt_vidpn_sources, struct d3dkmt_vidpn_source, entry )
|
||||
{
|
||||
if (source->device == desc->hDevice && source->id == desc->pVidPnSourceId[i])
|
||||
{
|
||||
found = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (found)
|
||||
source->type = desc->pType[i];
|
||||
else
|
||||
{
|
||||
source = malloc( sizeof( *source ) );
|
||||
if (!source)
|
||||
{
|
||||
status = STATUS_NO_MEMORY;
|
||||
goto done;
|
||||
}
|
||||
|
||||
source->id = desc->pVidPnSourceId[i];
|
||||
source->type = desc->pType[i];
|
||||
source->device = desc->hDevice;
|
||||
list_add_tail( &d3dkmt_vidpn_sources, &source->entry );
|
||||
}
|
||||
}
|
||||
|
||||
done:
|
||||
pthread_mutex_unlock( &d3dkmt_mutex );
|
||||
return status;
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
* X11DRV_D3DKMTCheckVidPnExclusiveOwnership
|
||||
*/
|
||||
NTSTATUS X11DRV_D3DKMTCheckVidPnExclusiveOwnership( const D3DKMT_CHECKVIDPNEXCLUSIVEOWNERSHIP *desc )
|
||||
{
|
||||
struct d3dkmt_vidpn_source *source;
|
||||
|
||||
TRACE("(%p)\n", desc);
|
||||
|
||||
if (!desc || !desc->hAdapter)
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
|
||||
pthread_mutex_lock( &d3dkmt_mutex );
|
||||
LIST_FOR_EACH_ENTRY( source, &d3dkmt_vidpn_sources, struct d3dkmt_vidpn_source, entry )
|
||||
{
|
||||
if (source->id == desc->VidPnSourceId && source->type == D3DKMT_VIDPNSOURCEOWNER_EXCLUSIVE)
|
||||
{
|
||||
pthread_mutex_unlock( &d3dkmt_mutex );
|
||||
return STATUS_GRAPHICS_PRESENT_OCCLUDED;
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock( &d3dkmt_mutex );
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static HANDLE get_display_device_init_mutex(void)
|
||||
{
|
||||
WCHAR bufferW[256];
|
||||
|
|
|
@ -2234,11 +2234,9 @@ static const struct gdi_dc_funcs xrender_funcs =
|
|||
NULL, /* pStrokeAndFillPath */
|
||||
NULL, /* pStrokePath */
|
||||
NULL, /* pUnrealizePalette */
|
||||
NULL, /* pD3DKMTCheckVidPnExclusiveOwnership */
|
||||
NULL, /* pD3DKMTCloseAdapter */
|
||||
NULL, /* pD3DKMTOpenAdapterFromLuid */
|
||||
NULL, /* pD3DKMTQueryVideoMemoryInfo */
|
||||
NULL, /* pD3DKMTSetVidPnSourceOwner */
|
||||
GDI_PRIORITY_GRAPHICS_DRV + 10 /* priority */
|
||||
};
|
||||
|
||||
|
|
|
@ -166,18 +166,16 @@ struct gdi_dc_funcs
|
|||
BOOL (*pStrokeAndFillPath)(PHYSDEV);
|
||||
BOOL (*pStrokePath)(PHYSDEV);
|
||||
BOOL (*pUnrealizePalette)(HPALETTE);
|
||||
NTSTATUS (*pD3DKMTCheckVidPnExclusiveOwnership)(const D3DKMT_CHECKVIDPNEXCLUSIVEOWNERSHIP *);
|
||||
NTSTATUS (*pD3DKMTCloseAdapter)(const D3DKMT_CLOSEADAPTER *);
|
||||
NTSTATUS (*pD3DKMTOpenAdapterFromLuid)(D3DKMT_OPENADAPTERFROMLUID *);
|
||||
NTSTATUS (*pD3DKMTQueryVideoMemoryInfo)(D3DKMT_QUERYVIDEOMEMORYINFO *);
|
||||
NTSTATUS (*pD3DKMTSetVidPnSourceOwner)(const D3DKMT_SETVIDPNSOURCEOWNER *);
|
||||
|
||||
/* priority order for the driver on the stack */
|
||||
UINT priority;
|
||||
};
|
||||
|
||||
/* increment this when you change the DC function table */
|
||||
#define WINE_GDI_DRIVER_VERSION 83
|
||||
#define WINE_GDI_DRIVER_VERSION 84
|
||||
|
||||
#define GDI_PRIORITY_NULL_DRV 0 /* null driver */
|
||||
#define GDI_PRIORITY_FONT_DRV 100 /* any font driver */
|
||||
|
|
Loading…
Reference in a new issue