Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP5:Update
xorg-x11-server.27645
U_reverse-modesetting-port-clean-start-code-fro...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File U_reverse-modesetting-port-clean-start-code-from-amdgpu.-v2.patch of Package xorg-x11-server.27645
From fa02b05645080c285da5972262a8d37403e39d7e Mon Sep 17 00:00:00 2001 From: Dave Airlie <airlied@redhat.com> Date: Tue, 3 May 2016 06:54:57 +1000 Subject: [PATCH] modesetting: port clean start code from amdgpu. (v2) Both radeon and amdgpu don't set the mode until the first blockhandler, this means everything should be rendered on the screen correctly by then. This ports this code, it also removes the tail call of EnterVT from ScreenInit, it really isn't necessary and causes us to set a dirty mode with -modesetting always anyways. v2: reorder set desired modes vs block handler as done for amdgpu. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> --- hw/xfree86/drivers/modesetting/driver.c | 21 ++++++++++++++++---- hw/xfree86/drivers/modesetting/drmmode_display.c | 25 +++++++++++++++++------- hw/xfree86/drivers/modesetting/drmmode_display.h | 2 +- 3 files changed, 36 insertions(+), 12 deletions(-) Index: xorg-server-1.19.6/hw/xfree86/drivers/modesetting/driver.c =================================================================== --- xorg-server-1.19.6.orig/hw/xfree86/drivers/modesetting/driver.c +++ xorg-server-1.19.6/hw/xfree86/drivers/modesetting/driver.c @@ -681,17 +681,6 @@ msBlockHandler(ScreenPtr pScreen, void * } static void -msBlockHandler_oneshot(ScreenPtr pScreen, void *pTimeout) -{ - ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); - modesettingPtr ms = modesettingPTR(pScrn); - - msBlockHandler(pScreen, pTimeout); - - drmmode_set_desired_modes(pScrn, &ms->drmmode, TRUE); -} - -static void FreeRec(ScrnInfoPtr pScrn) { modesettingPtr ms; @@ -1336,7 +1325,7 @@ CreateScreenResources(ScreenPtr pScreen) ret = pScreen->CreateScreenResources(pScreen); pScreen->CreateScreenResources = CreateScreenResources; - if (!drmmode_set_desired_modes(pScrn, &ms->drmmode, pScrn->is_gpu)) + if (!drmmode_set_desired_modes(pScrn, &ms->drmmode)) return FALSE; if (!drmmode_glamor_handle_new_screen_pixmap(&ms->drmmode)) @@ -1663,7 +1652,7 @@ ScreenInit(ScreenPtr pScreen, int argc, pScreen->CloseScreen = CloseScreen; ms->BlockHandler = pScreen->BlockHandler; - pScreen->BlockHandler = msBlockHandler_oneshot; + pScreen->BlockHandler = msBlockHandler; pScreen->SharePixmapBacking = msSharePixmapBacking; pScreen->SetSharedPixmapBacking = msSetSharedPixmapBacking; @@ -1737,9 +1726,7 @@ ScreenInit(ScreenPtr pScreen, int argc, } #endif - pScrn->vtSema = TRUE; - - return TRUE; + return EnterVT(pScrn); } static void @@ -1786,7 +1773,7 @@ EnterVT(ScrnInfoPtr pScrn) SetMaster(pScrn); - if (!drmmode_set_desired_modes(pScrn, &ms->drmmode, TRUE)) + if (!drmmode_set_desired_modes(pScrn, &ms->drmmode)) return FALSE; return TRUE; Index: xorg-server-1.19.6/hw/xfree86/drivers/modesetting/drmmode_display.c =================================================================== --- xorg-server-1.19.6.orig/hw/xfree86/drivers/modesetting/drmmode_display.c +++ xorg-server-1.19.6/hw/xfree86/drivers/modesetting/drmmode_display.c @@ -2105,7 +2105,7 @@ drmmode_adjust_frame(ScrnInfoPtr pScrn, } Bool -drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode, Bool set_hw) +drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode) { xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); int c; @@ -2118,10 +2118,8 @@ drmmode_set_desired_modes(ScrnInfoPtr pS /* Skip disabled CRTCs */ if (!crtc->enabled) { - if (set_hw) { - drmModeSetCrtc(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, - 0, 0, 0, NULL, 0, NULL); - } + drmModeSetCrtc(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, + 0, 0, 0, NULL, 0, NULL); continue; } @@ -2152,19 +2150,10 @@ drmmode_set_desired_modes(ScrnInfoPtr pS crtc->desiredY = 0; } - if (set_hw) { - if (!crtc->funcs-> - set_mode_major(crtc, &crtc->desiredMode, crtc->desiredRotation, - crtc->desiredX, crtc->desiredY)) - return FALSE; - } else { - crtc->mode = crtc->desiredMode; - crtc->rotation = crtc->desiredRotation; - crtc->x = crtc->desiredX; - crtc->y = crtc->desiredY; - if (!xf86CrtcRotate(crtc)) - return FALSE; - } + if (!crtc->funcs-> + set_mode_major(crtc, &crtc->desiredMode, crtc->desiredRotation, + crtc->desiredX, crtc->desiredY)) + return FALSE; } return TRUE; } Index: xorg-server-1.19.6/hw/xfree86/drivers/modesetting/drmmode_display.h =================================================================== --- xorg-server-1.19.6.orig/hw/xfree86/drivers/modesetting/drmmode_display.h +++ xorg-server-1.19.6/hw/xfree86/drivers/modesetting/drmmode_display.h @@ -184,7 +184,7 @@ void drmmode_DisableSharedPixmapFlipping extern Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int cpp); void drmmode_adjust_frame(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int x, int y); -extern Bool drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode, Bool set_hw); +extern Bool drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode); extern Bool drmmode_setup_colormap(ScreenPtr pScreen, ScrnInfoPtr pScrn); extern void drmmode_uevent_init(ScrnInfoPtr scrn, drmmode_ptr drmmode);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor