mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-02 12:18:09 +02:00
st/xorg vmwgfx/xorg: Add a pre-init customizer callback
Add a customizer callback just before initial config setting, so that the customizer code can initialize the mode validator using the drm file-descriptor. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
This commit is contained in:
parent
a7a126bdfa
commit
6ffa23b8fe
3 changed files with 19 additions and 5 deletions
|
|
@ -480,6 +480,9 @@ drv_pre_init(ScrnInfoPtr pScrn, int flags)
|
|||
xorg_crtc_init(pScrn);
|
||||
xorg_output_init(pScrn);
|
||||
|
||||
if (cust && cust->winsys_pre_init && !cust->winsys_pre_init(cust, ms->fd))
|
||||
return FALSE;
|
||||
|
||||
if (!xf86InitialConfiguration(pScrn, TRUE)) {
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No valid modes.\n");
|
||||
return FALSE;
|
||||
|
|
@ -739,7 +742,7 @@ drv_screen_init(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
|
|||
ms->debug_fallback = xf86ReturnOptValBool(ms->Options, OPTION_DEBUG_FALLBACK, ms->accelerate_2d);
|
||||
|
||||
if (cust && cust->winsys_screen_init)
|
||||
cust->winsys_screen_init(cust, ms->fd);
|
||||
cust->winsys_screen_init(cust);
|
||||
|
||||
ms->swapThrottling = cust ? cust->swap_throttling : TRUE;
|
||||
from_st = xf86GetOptValBool(ms->Options, OPTION_THROTTLE_SWAP,
|
||||
|
|
|
|||
|
|
@ -76,7 +76,8 @@ typedef struct _CustomizerRec
|
|||
Bool dirty_throttling;
|
||||
Bool swap_throttling;
|
||||
Bool no_3d;
|
||||
Bool (*winsys_screen_init)(struct _CustomizerRec *cust, int fd);
|
||||
Bool (*winsys_pre_init) (struct _CustomizerRec *cust, int fd);
|
||||
Bool (*winsys_screen_init)(struct _CustomizerRec *cust);
|
||||
Bool (*winsys_screen_close)(struct _CustomizerRec *cust);
|
||||
Bool (*winsys_enter_vt)(struct _CustomizerRec *cust);
|
||||
Bool (*winsys_leave_vt)(struct _CustomizerRec *cust);
|
||||
|
|
|
|||
|
|
@ -111,13 +111,22 @@ vmw_context_no_throttle(CustomizerPtr cust,
|
|||
}
|
||||
|
||||
static Bool
|
||||
vmw_screen_init(CustomizerPtr cust, int fd)
|
||||
vmw_pre_init(CustomizerPtr cust, int fd)
|
||||
{
|
||||
struct vmw_customizer *vmw = vmw_customizer(cust);
|
||||
|
||||
vmw->fd = fd;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static Bool
|
||||
vmw_screen_init(CustomizerPtr cust)
|
||||
{
|
||||
struct vmw_customizer *vmw = vmw_customizer(cust);
|
||||
drmVersionPtr ver;
|
||||
|
||||
vmw->fd = fd;
|
||||
ver = drmGetVersion(fd);
|
||||
ver = drmGetVersion(vmw->fd);
|
||||
if (ver == NULL ||
|
||||
(ver->version_major == 1 && ver->version_minor < 1)) {
|
||||
cust->swap_throttling = TRUE;
|
||||
|
|
@ -199,6 +208,7 @@ vmw_screen_pre_init(ScrnInfoPtr pScrn, int flags)
|
|||
|
||||
cust = &vmw->base;
|
||||
|
||||
cust->winsys_pre_init = vmw_pre_init;
|
||||
cust->winsys_screen_init = vmw_screen_init;
|
||||
cust->winsys_screen_close = vmw_screen_close;
|
||||
cust->winsys_enter_vt = vmw_screen_enter_vt;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue