From 39c497f3efca5ca08343b884f44c93215dcdef31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Thu, 2 Apr 2015 18:10:42 +0900 Subject: Only copy fbcon BO contents if bgNoneRoot is TRUE Otherwise, the X server will initialize the screen pixmap contents anyway. Reviewed-by: Alex Deucher --- src/drmmode_display.c | 27 +++++++++++---------------- src/drmmode_display.h | 2 ++ 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/drmmode_display.c b/src/drmmode_display.c index 21a59370..edeba478 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -385,6 +385,8 @@ out_free_fb: return pixmap; } +#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 10 + void drmmode_copy_fb(ScrnInfoPtr pScrn, drmmode_ptr drmmode) { xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); @@ -397,9 +399,6 @@ void drmmode_copy_fb(ScrnInfoPtr pScrn, drmmode_ptr drmmode) uint32_t tiling_flags = 0; Bool ret; - if (info->accelOn == FALSE || info->use_glamor) - goto fallback; - for (i = 0; i < xf86_config->num_crtc; i++) { drmmode_crtc_private_ptr drmmode_crtc = xf86_config->crtc[i]->driver_private; @@ -408,7 +407,7 @@ void drmmode_copy_fb(ScrnInfoPtr pScrn, drmmode_ptr drmmode) } if (!fbcon_id) - goto fallback; + return; if (fbcon_id == drmmode->fb_id) { /* in some rare case there might be no fbcon and we might already @@ -421,7 +420,7 @@ void drmmode_copy_fb(ScrnInfoPtr pScrn, drmmode_ptr drmmode) src = create_pixmap_for_fbcon(drmmode, pScrn, fbcon_id); if (!src) - goto fallback; + return; if (info->allowColorTiling) { if (info->ChipFamily >= CHIP_FAMILY_R600) { @@ -454,23 +453,15 @@ void drmmode_copy_fb(ScrnInfoPtr pScrn, drmmode_ptr drmmode) info->accel_state->exa->DoneCopy (dst); radeon_cs_flush_indirect(pScrn); -#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 10 pScreen->canDoBGNoneRoot = TRUE; -#endif drmmode_destroy_bo_pixmap(dst); out_free_src: drmmode_destroy_bo_pixmap(src); return; - -fallback: - /* map and memset the bo */ - if (radeon_bo_map(info->front_bo, 1)) - return; - - memset(info->front_bo->ptr, 0x00, info->front_bo->size); - radeon_bo_unmap(info->front_bo); } +#endif /* GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 10 */ + static void drmmode_crtc_scanout_destroy(drmmode_ptr drmmode, struct drmmode_scanout *scanout) @@ -2122,8 +2113,12 @@ Bool drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode) { xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); int c; +#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 10 + RADEONInfoPtr info = RADEONPTR(pScrn); - drmmode_copy_fb(pScrn, drmmode); + if (bgNoneRoot && info->accelOn && !info->use_glamor) + drmmode_copy_fb(pScrn, drmmode); +#endif for (c = 0; c < config->num_crtc; c++) { xf86CrtcPtr crtc = config->crtc[c]; diff --git a/src/drmmode_display.h b/src/drmmode_display.h index 1908b46c..49b02d63 100644 --- a/src/drmmode_display.h +++ b/src/drmmode_display.h @@ -127,7 +127,9 @@ extern Bool drmmode_set_bufmgr(ScrnInfoPtr pScrn, drmmode_ptr drmmode, struct ra extern void drmmode_set_cursor(ScrnInfoPtr scrn, drmmode_ptr drmmode, int id, struct radeon_bo *bo); void drmmode_adjust_frame(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int x, int y); extern Bool drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode); +#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 10 extern void drmmode_copy_fb(ScrnInfoPtr pScrn, drmmode_ptr drmmode); +#endif extern Bool drmmode_setup_colormap(ScreenPtr pScreen, ScrnInfoPtr pScrn); extern void drmmode_scanout_free(ScrnInfoPtr scrn); -- cgit v1.2.3