summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2016-02-02 18:04:11 +0900
committerMichel Dänzer <michel@daenzer.net>2016-03-09 16:11:22 +0900
commiteb611a2e4ecce7a1ab85fd72b9b78e3269311dd5 (patch)
tree0ec07968c3b272a851ddae846fed2e7008eeebcc
parent06602171386e538081c298645fb7ca1a70fe80cc (diff)
Consolidate pScreen usage in drmmode_set_mode_major
We were already relying on pScrn->pScreen being non-NULL in some cases, which is supposedly always true ever since this function is no longer getting called from ScreenInit. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--src/drmmode_display.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index c7491272..cc71dd09 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -622,6 +622,7 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
Rotation rotation, int x, int y)
{
ScrnInfoPtr pScrn = crtc->scrn;
+ ScreenPtr pScreen = pScrn->pScreen;
RADEONInfoPtr info = RADEONPTR(pScrn);
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn);
drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
@@ -681,8 +682,6 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
goto done;
}
- ScreenPtr pScreen = pScrn->pScreen;
-
for (i = 0; i < xf86_config->num_output; i++) {
xf86OutputPtr output = xf86_config->output[i];
drmmode_output_private_ptr drmmode_output;
@@ -777,8 +776,8 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
} else
ret = TRUE;
- if (crtc->scrn->pScreen)
- xf86CrtcSetScreenSubpixelOrder(crtc->scrn->pScreen);
+ if (pScreen)
+ xf86CrtcSetScreenSubpixelOrder(pScreen);
drmmode_crtc->need_modeset = FALSE;
@@ -793,9 +792,8 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
}
}
- if (pScrn->pScreen &&
- !xf86ReturnOptValBool(info->Options, OPTION_SW_CURSOR, FALSE))
- xf86_reload_cursors(pScrn->pScreen);
+ if (!xf86ReturnOptValBool(info->Options, OPTION_SW_CURSOR, FALSE))
+ xf86_reload_cursors(pScreen);
done:
if (!ret) {