xf86-video-amdgpu: Branch 'master' - 2 commits

Michel Dänzer daenzer at kemper.freedesktop.org
Fri Jun 24 06:55:28 UTC 2016


 src/drmmode_display.c |   81 ++++++--------------------------------------------
 1 file changed, 11 insertions(+), 70 deletions(-)

New commits:
commit d96dabc71b1b32dc4b422a9633cdd4e0e95da052
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Thu Jun 23 16:27:45 2016 +0900

    Destroy all dedicated scanout buffers during CloseScreen
    
    Fixes leaking active scanout buffers across a server reset, which also
    fixes server reset with glamor and active scanout buffers.
    
    Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index de1c34b..5bddfd0 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -2156,8 +2156,10 @@ void drmmode_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode)
 
 void drmmode_fini(ScrnInfoPtr pScrn, drmmode_ptr drmmode)
 {
+	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
 	AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(pScrn);
 	AMDGPUInfoPtr info = AMDGPUPTR(pScrn);
+	int c;
 
 	if (!info->drmmode_inited)
 		return;
@@ -2168,6 +2170,14 @@ void drmmode_fini(ScrnInfoPtr pScrn, drmmode_ptr drmmode)
 		RemoveBlockAndWakeupHandlers((BlockHandlerProcPtr) NoopDDA,
 					     drm_wakeup_handler, drmmode);
 	}
+
+	for (c = 0; c < config->num_crtc; c++) {
+		xf86CrtcPtr crtc = config->crtc[c];
+		drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
+
+		drmmode_crtc_scanout_destroy(&info->drmmode, &drmmode_crtc->scanout[0]);
+		drmmode_crtc_scanout_destroy(&info->drmmode, &drmmode_crtc->scanout[1]);
+	}
 }
 
 void drmmode_set_cursor(ScrnInfoPtr scrn, drmmode_ptr drmmode, int id,
commit 1091f28e1fa239ee1a973d84a8376fa4a95d7247
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Thu Jun 23 12:47:04 2016 +0900

    Remove drmmode_load_palette
    
    Not used by any supported version of xserver.
    
    Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 2cd99cb..de1c34b 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -2261,75 +2261,6 @@ Bool drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode,
 	return TRUE;
 }
 
-static void drmmode_load_palette(ScrnInfoPtr pScrn, int numColors,
-				 int *indices, LOCO * colors, VisualPtr pVisual)
-{
-	xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
-	uint16_t lut_r[256], lut_g[256], lut_b[256];
-	int index, j, i;
-	int c;
-
-	for (c = 0; c < xf86_config->num_crtc; c++) {
-		xf86CrtcPtr crtc = xf86_config->crtc[c];
-		drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
-
-		for (i = 0; i < 256; i++) {
-			lut_r[i] = drmmode_crtc->lut_r[i] << 6;
-			lut_g[i] = drmmode_crtc->lut_g[i] << 6;
-			lut_b[i] = drmmode_crtc->lut_b[i] << 6;
-		}
-
-		switch (pScrn->depth) {
-		case 15:
-			for (i = 0; i < numColors; i++) {
-				index = indices[i];
-				for (j = 0; j < 8; j++) {
-					lut_r[index * 8 + j] =
-					    colors[index].red << 6;
-					lut_g[index * 8 + j] =
-					    colors[index].green << 6;
-					lut_b[index * 8 + j] =
-					    colors[index].blue << 6;
-				}
-			}
-			break;
-		case 16:
-			for (i = 0; i < numColors; i++) {
-				index = indices[i];
-
-				if (i <= 31) {
-					for (j = 0; j < 8; j++) {
-						lut_r[index * 8 + j] =
-						    colors[index].red << 6;
-						lut_b[index * 8 + j] =
-						    colors[index].blue << 6;
-					}
-				}
-
-				for (j = 0; j < 4; j++) {
-					lut_g[index * 4 + j] =
-					    colors[index].green << 6;
-				}
-			}
-			break;
-		default:
-			for (i = 0; i < numColors; i++) {
-				index = indices[i];
-				lut_r[index] = colors[index].red << 6;
-				lut_g[index] = colors[index].green << 6;
-				lut_b[index] = colors[index].blue << 6;
-			}
-			break;
-		}
-
-		/* Make the change through RandR */
-		if (crtc->randr_crtc)
-			RRCrtcGammaSet(crtc->randr_crtc, lut_r, lut_g, lut_b);
-		else
-			crtc->funcs->gamma_set(crtc, lut_r, lut_g, lut_b, 256);
-	}
-}
-
 Bool drmmode_setup_colormap(ScreenPtr pScreen, ScrnInfoPtr pScrn)
 {
 	xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
@@ -2341,7 +2272,7 @@ Bool drmmode_setup_colormap(ScreenPtr pScreen, ScrnInfoPtr pScrn)
 			return FALSE;
 		/* all amdgpus support 10 bit CLUTs */
 		if (!xf86HandleColormaps(pScreen, 256, 10,
-					 drmmode_load_palette, NULL,
+					 NULL, NULL,
 					 CMAP_PALETTED_TRUECOLOR
 #if 0				/* This option messes up text mode! (eich at suse.de) */
 					 | CMAP_LOAD_EVEN_IF_OFFSCREEN


More information about the xorg-commit mailing list