Skip to contentSkip to conversation

Create amdgpu_pixmap_clear helper

PATCH In review Michel Dänzer 2 participants 7 messages Aug 29, 2017 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/6 Create amdgpu_pixmap_clear helper

From: Michel Dänzer <[email protected]>

Preparatory, no functional change intended yet.

(Ported from radeon commit 3f6210ca2c8ef60d59efc8139151d3b9838bb875)

---
 src/amdgpu_bo_helper.c | 20 ++++++++++++++++++++
 src/amdgpu_bo_helper.h |  2 ++
 src/drmmode_display.c  | 14 +-------------
 3 files changed, 23 insertions(+), 13 deletions(-)
src/amdgpu_bo_helper.c +20 -0
index 7acd0057e..ee52e0c24 100644
@@ -120,6 +120,26 @@ struct amdgpu_buffer *amdgpu_alloc_pixmap_bo(ScrnInfoPtr pScrn, int width,
 	return pixmap_buffer;
 }
 
+/* Clear the pixmap contents to black */
+void
+amdgpu_pixmap_clear(PixmapPtr pixmap)
+{
+	ScreenPtr screen = pixmap->drawable.pScreen;
+	AMDGPUInfoPtr info = AMDGPUPTR(xf86ScreenToScrn(screen));
+	GCPtr gc = GetScratchGC(pixmap->drawable.depth, screen);
+	xRectangle rect;
+
+	ValidateGC(&pixmap->drawable, gc);
+	rect.x = 0;
+	rect.y = 0;
+	rect.width = pixmap->drawable.width;
+	rect.height = pixmap->drawable.height;
+	info->force_accel = TRUE;
+	gc->ops->PolyFillRect(&pixmap->drawable, gc, 1, &rect);
+	info->force_accel = FALSE;
+	FreeScratchGC(gc);
+}
+
 Bool amdgpu_bo_get_handle(struct amdgpu_buffer *bo, uint32_t *handle)
 {
 	if (bo->flags & AMDGPU_BO_FLAGS_GBM) {
src/amdgpu_bo_helper.h +2 -0
index 26fca1604..4f6b628a6 100644
@@ -29,6 +29,8 @@ extern struct amdgpu_buffer *amdgpu_alloc_pixmap_bo(ScrnInfoPtr pScrn, int width
 						     int height, int depth, int usage_hint,
 						     int bitsPerPixel, int *new_pitch);
 
+extern void amdgpu_pixmap_clear(PixmapPtr pixmap);
+
 extern Bool amdgpu_bo_get_handle(struct amdgpu_buffer *bo, uint32_t *handle);
 
 extern uint64_t amdgpu_pixmap_get_tiling_info(PixmapPtr pixmap);
src/drmmode_display.c +1 -13
index 17efde8e8..285eb0a0f 100644
@@ -2116,8 +2116,6 @@ static Bool drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height)
 	PixmapPtr ppix = screen->GetScreenPixmap(screen);
 	void *fb_shadow;
 	int hint = 0;
-	xRectangle rect;
-	GCPtr gc;
 
 	if (scrn->virtualX == width && scrn->virtualY == height)
 		return TRUE;
@@ -2181,17 +2179,7 @@ static Bool drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height)
 			goto fail;
 	}
 
-	/* Clear new buffer */
-	gc = GetScratchGC(ppix->drawable.depth, scrn->pScreen);
-	ValidateGC(&ppix->drawable, gc);
-	rect.x = 0;
-	rect.y = 0;
-	rect.width = width;
-	rect.height = height;
-	info->force_accel = TRUE;
-	(*gc->ops->PolyFillRect)(&ppix->drawable, gc, 1, &rect);
-	info->force_accel = FALSE;
-	FreeScratchGC(gc);
+	amdgpu_pixmap_clear(ppix);
 	amdgpu_glamor_finish(scrn);
 
 	for (i = 0; i < xf86_config->num_crtc; i++) {
Signature · 6 lines
2.14.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20170829083049.16229-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org

#2 lore raw

PATCH 2/6 Create drmmode_set_mode helper

From: Michel Dänzer <[email protected]>

Preparatory, no functional change intended yet.

(Ported from radeon commit 4bc992c31059eb50e22df4ebf5b92d08411f41ef)

---
 src/drmmode_display.c | 82 ++++++++++++++++++++++++++++++---------------------
 src/drmmode_display.h |  3 ++
 2 files changed, 52 insertions(+), 33 deletions(-)
src/drmmode_display.c +49 -33
index 285eb0a0f..6092805fd 100644
@@ -796,6 +796,52 @@ drmmode_crtc_gamma_do_set(xf86CrtcPtr crtc, uint16_t *red, uint16_t *green,
 			    size, red, green, blue);
 }
 
+Bool
+drmmode_set_mode(xf86CrtcPtr crtc, struct drmmode_fb *fb, DisplayModePtr mode,
+		 int x, int y)
+{
+	ScrnInfoPtr scrn = crtc->scrn;
+	AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(scrn);
+	xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+	drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
+	uint32_t *output_ids = calloc(sizeof(uint32_t), xf86_config->num_output);
+	int output_count = 0;
+	drmModeModeInfo kmode;
+	Bool ret;
+	int i;
+
+	if (!output_ids)
+		return FALSE;
+
+	for (i = 0; i < xf86_config->num_output; i++) {
+		xf86OutputPtr output = xf86_config->output[i];
+		drmmode_output_private_ptr drmmode_output = output->driver_private;
+
+		if (output->crtc != crtc)
+			continue;
+
+		output_ids[output_count] = drmmode_output->mode_output->connector_id;
+		output_count++;
+	}
+
+	drmmode_ConvertToKMode(scrn, &kmode, mode);
+
+	ret = drmModeSetCrtc(pAMDGPUEnt->fd,
+			     drmmode_crtc->mode_crtc->crtc_id,
+			     fb->handle, x, y, output_ids,
+			     output_count, &kmode) == 0;
+
+	if (ret) {
+		drmmode_fb_reference(pAMDGPUEnt->fd, &drmmode_crtc->fb, fb);
+	} else {
+		xf86DrvMsg(scrn->scrnIndex, X_ERROR,
+			   "failed to set mode: %s\n", strerror(errno));
+	}
+
+	free(output_ids);
+	return ret;
+}
+
 static Bool
 drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
 		       Rotation rotation, int x, int y)
@@ -811,12 +857,9 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
 	int saved_x, saved_y;
 	Rotation saved_rotation;
 	DisplayModeRec saved_mode;
-	uint32_t *output_ids = NULL;
-	int output_count = 0;
 	Bool ret = FALSE;
 	int i;
 	struct drmmode_fb *fb = NULL;
-	drmModeModeInfo kmode;
 
 	/* The root window contents may be undefined before the WindowExposures
 	 * hook is called for it, so bail if we get here before that
@@ -835,23 +878,6 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
 		crtc->y = y;
 		crtc->rotation = rotation;
 
-		output_ids = calloc(sizeof(uint32_t), xf86_config->num_output);
-		if (!output_ids)
-			goto done;
-
-		for (i = 0; i < xf86_config->num_output; i++) {
-			xf86OutputPtr output = xf86_config->output[i];
-			drmmode_output_private_ptr drmmode_output;
-
-			if (output->crtc != crtc)
-				continue;
-
-			drmmode_output = output->driver_private;
-			output_ids[output_count] =
-			    drmmode_output->mode_output->connector_id;
-			output_count++;
-		}
-
 		if (!drmmode_handle_transform(crtc))
 			goto done;
 
@@ -862,8 +888,6 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
 		drmmode_crtc_gamma_do_set(crtc, crtc->gamma_red, crtc->gamma_green,
 					  crtc->gamma_blue, crtc->gamma_size);
 
-		drmmode_ConvertToKMode(crtc->scrn, &kmode, mode);
-
 #ifdef AMDGPU_PIXMAP_SHARING
 		if (drmmode_crtc->prime_scanout_pixmap) {
 			drmmode_crtc_prime_scanout_update(crtc, mode, scanout_id,
@@ -907,17 +931,10 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
 		drmmode_crtc_wait_pending_event(drmmode_crtc, pAMDGPUEnt->fd,
 						drmmode_crtc->flip_pending);
 
-		if (drmModeSetCrtc(pAMDGPUEnt->fd,
-				   drmmode_crtc->mode_crtc->crtc_id,
-				   fb->handle, x, y, output_ids,
-				   output_count, &kmode) != 0) {
-			xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR,
-				   "failed to set mode: %s\n", strerror(errno));
+		if (!drmmode_set_mode(crtc, fb, mode, x, y))
 			goto done;
-		} else {
-			ret = TRUE;
-			drmmode_fb_reference(pAMDGPUEnt->fd, &drmmode_crtc->fb, fb);
-		}
+
+		ret = TRUE;
 
 		if (pScreen)
 			xf86CrtcSetScreenSubpixelOrder(pScreen);
@@ -954,7 +971,6 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
 #endif
 
 done:
-	free(output_ids);
 	if (!ret) {
 		crtc->x = saved_x;
 		crtc->y = saved_y;
src/drmmode_display.h +3 -0
index 1a6454c12..372a5397c 100644
@@ -213,6 +213,9 @@ extern void drmmode_scanout_free(ScrnInfoPtr scrn);
 extern void drmmode_uevent_init(ScrnInfoPtr scrn, drmmode_ptr drmmode);
 extern void drmmode_uevent_fini(ScrnInfoPtr scrn, drmmode_ptr drmmode);
 
+Bool drmmode_set_mode(xf86CrtcPtr crtc, struct drmmode_fb *fb,
+		      DisplayModePtr mode, int x, int y);
+
 extern int drmmode_get_crtc_id(xf86CrtcPtr crtc);
 extern int drmmode_get_pitch_align(ScrnInfoPtr scrn, int bpe);
 Bool amdgpu_do_pageflip(ScrnInfoPtr scrn, ClientPtr client,
Signature · 6 lines
2.14.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#3 lore raw

PATCH 3/6 Create amdgpu_pixmap_get_fb_ptr helper

In reply to a message not in the archive

From: Michel Dänzer <[email protected]>

Preparatory, no functional change intended yet.

Also inline amdgpu_pixmap_create_fb into amdgpu_pixmap_get_fb, since there's only one call-site.

(Ported from radeon commit 20f6b56fdb74d88086e8e094013fedbb14e50a24)

---
 src/amdgpu_pixmap.h | 46 +++++++++++++++++++++++++++-------------------
 1 file changed, 27 insertions(+), 19 deletions(-)
src/amdgpu_pixmap.h +27 -19
index 00fb5bf05..eded17037 100644
@@ -121,39 +121,47 @@ amdgpu_fb_create(int drm_fd, uint32_t width, uint32_t height, uint8_t depth,
 	return NULL;
 }
 
-static inline struct drmmode_fb*
-amdgpu_pixmap_create_fb(int drm_fd, PixmapPtr pix)
+static inline struct drmmode_fb**
+amdgpu_pixmap_get_fb_ptr(PixmapPtr pix)
 {
-	uint32_t handle;
+	ScrnInfoPtr scrn = xf86ScreenToScrn(pix->drawable.pScreen);
+	AMDGPUInfoPtr info = AMDGPUPTR(scrn);
 
-	if (!amdgpu_pixmap_get_handle(pix, &handle))
-		return NULL;
+	if (info->use_glamor) {
+		struct amdgpu_pixmap *priv = amdgpu_get_pixmap_private(pix);
+
+		if (!priv)
+			return NULL;
+
+		return &priv->fb;
+	}
 
-	return amdgpu_fb_create(drm_fd, pix->drawable.width, pix->drawable.height,
-				pix->drawable.depth, pix->drawable.bitsPerPixel,
-				pix->devKind, handle);
+	return NULL;
 }
 
 static inline struct drmmode_fb*
 amdgpu_pixmap_get_fb(PixmapPtr pix)
 {
-	ScrnInfoPtr scrn = xf86ScreenToScrn(pix->drawable.pScreen);
-	AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(scrn);
-	AMDGPUInfoPtr info = AMDGPUPTR(scrn);
+	struct drmmode_fb **fb_ptr = amdgpu_pixmap_get_fb_ptr(pix);
 
-	if (info->use_glamor) {
-		struct amdgpu_pixmap *priv = amdgpu_get_pixmap_private(pix);
+	if (!fb_ptr)
+		return NULL;
 
-		if (!priv)
-			return NULL;
+	if (!*fb_ptr) {
+		uint32_t handle;
 
-		if (!priv->fb)
-			priv->fb = amdgpu_pixmap_create_fb(pAMDGPUEnt->fd, pix);
+		if (amdgpu_pixmap_get_handle(pix, &handle)) {
+			ScrnInfoPtr scrn = xf86ScreenToScrn(pix->drawable.pScreen);
+			AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(scrn);
 
-		return priv->fb;
+			*fb_ptr = amdgpu_fb_create(pAMDGPUEnt->fd, pix->drawable.width,
+						   pix->drawable.height, pix->drawable.depth,
+						   pix->drawable.bitsPerPixel, pix->devKind,
+						   handle);
+		}
 	}
 
-	return NULL;
+	return *fb_ptr;
 }
 
 enum {
Signature · 6 lines
2.14.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#4 lore raw

PATCH 4/6 Create amdgpu_master_screen helper

In reply to a message not in the archive

From: Michel Dänzer <[email protected]>

Preparatory, no functional change intended yet.

(Ported from radeon commit 7f0cd68d1b0c132e32ae736371bce3e12ed33c7a)

---
 src/amdgpu_drv.h | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
src/amdgpu_drv.h +10 -4
index 75c2a2653..8b378b18a 100644
@@ -171,6 +171,15 @@ typedef enum {
 #define amdgpu_is_gpu_screen(screen) (screen)->isGPU
 #define amdgpu_is_gpu_scrn(scrn) (scrn)->is_gpu
 
+static inline ScreenPtr
+amdgpu_master_screen(ScreenPtr screen)
+{
+	if (screen->current_master)
+		return screen->current_master;
+
+	return screen;
+}
+
 static inline ScreenPtr
 amdgpu_dirty_master(PixmapDirtyUpdatePtr dirty)
 {
@@ -180,10 +189,7 @@ amdgpu_dirty_master(PixmapDirtyUpdatePtr dirty)
 	ScreenPtr screen = dirty->src->drawable.pScreen;
 #endif
 
-	if (screen->current_master)
-		return screen->current_master;
-
-	return screen;
+	return amdgpu_master_screen(screen);
 }
 
 static inline Bool
Signature · 6 lines
2.14.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#5 lore raw

PATCH 5/6 Make all active CRTCs scan out an all-black framebuffer in LeaveVT

In reply to a message not in the archive

From: Michel Dänzer <[email protected]>

And destroy all other FBs. This is so that other DRM masters can only get access to this all-black FB, not to any other FB we created, while we're switched away and not DRM master.

Fixes b09fde0d81e0 ("Use reference counting for tracking KMS

framebuffer lifetimes")
(Ported from radeon commit 06a465484101f21e99d3a0a62fb03440bcaff93e)

---
 src/amdgpu_kms.c      | 99 ++++++++++++++++++++++++++++++++++++++++++++++-----
 src/drmmode_display.c |  4 +--
 src/drmmode_display.h |  4 +++
 3 files changed, 97 insertions(+), 10 deletions(-)
src/amdgpu_kms.c +91 -8
index e0b735819..c3613eb8d 100644
@@ -32,6 +32,7 @@
 #include <sys/ioctl.h>
 /* Driver data structures */
 #include "amdgpu_drv.h"
+#include "amdgpu_bo_helper.h"
 #include "amdgpu_drm_queue.h"
 #include "amdgpu_glamor.h"
 #include "amdgpu_probe.h"
@@ -1052,11 +1053,10 @@ static void AMDGPUBlockHandler_KMS(BLOCKHANDLER_ARGS_DECL)
 	(*pScreen->BlockHandler) (BLOCKHANDLER_ARGS);
 	pScreen->BlockHandler = AMDGPUBlockHandler_KMS;
 
-	if (!pScrn->vtSema) {
-#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1,19,0,0,0)
-		if (info->use_glamor)
-			amdgpu_glamor_flush(pScrn);
-#endif
+	if (!xf86ScreenToScrn(amdgpu_master_screen(pScreen))->vtSema) {
+		/* Unreference the all-black FB created by AMDGPULeaveVT_KMS. After
+		 * this, there should be no FB left created by this driver.
+		 */
 
 		for (c = 0; c < xf86_config->num_crtc; c++) {
 			drmmode_crtc_private_ptr drmmode_crtc =
@@ -1967,21 +1967,104 @@ Bool AMDGPUEnterVT_KMS(VT_FUNC_ARGS_DECL)
 	return TRUE;
 }
 
+static void
+pixmap_unref_fb(void *value, XID id, void *cdata)
+{
+	PixmapPtr pixmap = value;
+	AMDGPUEntPtr pAMDGPUEnt = cdata;
+	struct drmmode_fb **fb_ptr = amdgpu_pixmap_get_fb_ptr(pixmap);
+
+	if (fb_ptr)
+		drmmode_fb_reference(pAMDGPUEnt->fd, fb_ptr, NULL);
+}
+
 void AMDGPULeaveVT_KMS(VT_FUNC_ARGS_DECL)
 {
 	SCRN_INFO_PTR(arg);
+	AMDGPUInfoPtr info = AMDGPUPTR(pScrn);
+	AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(pScrn);
+	ScreenPtr pScreen = pScrn->pScreen;
+	xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
+	struct drmmode_scanout black_scanout = { .pixmap = NULL, .bo = NULL };
+	xf86CrtcPtr crtc;
+	drmmode_crtc_private_ptr drmmode_crtc;
+	unsigned w = 0, h = 0;
+	int i;
 
 	xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, AMDGPU_LOGLEVEL_DEBUG,
 		       "AMDGPULeaveVT_KMS\n");
 
-	amdgpu_drop_drm_master(pScrn);
+	/* Compute maximum scanout dimensions of active CRTCs */
+	for (i = 0; i < xf86_config->num_crtc; i++) {
+		crtc = xf86_config->crtc[i];
+		drmmode_crtc = crtc->driver_private;
+
+		if (!drmmode_crtc->fb)
+			continue;
+
+		w = max(w, crtc->mode.HDisplay);
+		h = max(h, crtc->mode.VDisplay);
+	}
+
+	/* Make all active CRTCs scan out from an all-black framebuffer */
+	if (w > 0 && h > 0) {
+		if (drmmode_crtc_scanout_create(crtc, &black_scanout, w, h)) {
+			struct drmmode_fb *black_fb =
+				amdgpu_pixmap_get_fb(black_scanout.pixmap);
+
+			amdgpu_pixmap_clear(black_scanout.pixmap);
+			amdgpu_glamor_finish(pScrn);
+
+			for (i = 0; i < xf86_config->num_crtc; i++) {
+				crtc = xf86_config->crtc[i];
+				drmmode_crtc = crtc->driver_private;
+
+				if (drmmode_crtc->fb) {
+					if (black_fb) {
+						drmmode_set_mode(crtc, black_fb, &crtc->mode, 0, 0);
+					} else {
+						drmModeSetCrtc(pAMDGPUEnt->fd,
+							       drmmode_crtc->mode_crtc->crtc_id, 0, 0,
+							       0, NULL, 0, NULL);
+						drmmode_fb_reference(pAMDGPUEnt->fd, &drmmode_crtc->fb,
+								     NULL);
+					}
+
+					if (pScrn->is_gpu) {
+						if (drmmode_crtc->scanout[0].pixmap)
+							pixmap_unref_fb(drmmode_crtc->scanout[0].pixmap,
+									None, pAMDGPUEnt);
+						if (drmmode_crtc->scanout[1].pixmap)
+							pixmap_unref_fb(drmmode_crtc->scanout[1].pixmap,
+									None, pAMDGPUEnt);
+					} else {
+						drmmode_crtc_scanout_free(drmmode_crtc);
+					}
+				}
+			}
+		}
+	}
 
 	xf86RotateFreeShadow(pScrn);
-	if (!pScrn->is_gpu)
-		drmmode_scanout_free(pScrn);
+	drmmode_crtc_scanout_destroy(&info->drmmode, &black_scanout);
+
+	/* Unreference FBs of all pixmaps. After this, the only FB remaining
+	 * should be the all-black one being scanned out by active CRTCs
+	 */
+	for (i = 0; i < currentMaxClients; i++) {
+		if (i > 0 &&
+		    (!clients[i] || clients[i]->clientState != ClientStateRunning))
+			continue;
+
+		FindClientResourcesByType(clients[i], RT_PIXMAP, pixmap_unref_fb,
+					  pAMDGPUEnt);
+	}
+	pixmap_unref_fb(pScreen->GetScreenPixmap(pScreen), None, pAMDGPUEnt);
 
 	xf86_hide_cursors(pScrn);
 
+	amdgpu_drop_drm_master(pScrn);
+
 	xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, AMDGPU_LOGLEVEL_DEBUG,
 		       "Ok, leaving now...\n");
 }
src/drmmode_display.c +2 -2
index 6092805fd..6057699bf 100644
@@ -478,7 +478,7 @@ drmmode_crtc_scanout_destroy(drmmode_ptr drmmode,
 	}
 }
 
-static void
+void
 drmmode_crtc_scanout_free(drmmode_crtc_private_ptr drmmode_crtc)
 {
 	drmmode_crtc_scanout_destroy(drmmode_crtc->drmmode,
@@ -500,7 +500,7 @@ drmmode_scanout_free(ScrnInfoPtr scrn)
 		drmmode_crtc_scanout_free(xf86_config->crtc[c]->driver_private);
 }
 
-static PixmapPtr
+PixmapPtr
 drmmode_crtc_scanout_create(xf86CrtcPtr crtc, struct drmmode_scanout *scanout,
 			    int width, int height)
 {
src/drmmode_display.h +4 -0
index 372a5397c..eff342942 100644
@@ -209,6 +209,10 @@ extern Bool drmmode_setup_colormap(ScreenPtr pScreen, ScrnInfoPtr pScrn);
 extern void drmmode_crtc_scanout_destroy(drmmode_ptr drmmode,
 					 struct drmmode_scanout *scanout);
 extern void drmmode_scanout_free(ScrnInfoPtr scrn);
+void drmmode_crtc_scanout_free(drmmode_crtc_private_ptr drmmode_crtc);
+PixmapPtr drmmode_crtc_scanout_create(xf86CrtcPtr crtc,
+				      struct drmmode_scanout *scanout,
+				      int width, int height);
 
 extern void drmmode_uevent_init(ScrnInfoPtr scrn, drmmode_ptr drmmode);
 extern void drmmode_uevent_fini(ScrnInfoPtr scrn, drmmode_ptr drmmode);
Signature · 6 lines
2.14.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#6 lore raw

PATCH 6/6 Remove drmmode_scanout_free

In reply to a message not in the archive

From: Michel Dänzer <[email protected]>

Not used anymore.

(Cherry picked from radeon commit e4a3df19d588a4310fcb889ef34e205d0e92e4d7)

---
 src/drmmode_display.c | 10 ----------
 src/drmmode_display.h |  1 -
 2 files changed, 11 deletions(-)
src/drmmode_display.c +0 -10
index 6057699bf..9c838a8b9 100644
@@ -490,16 +490,6 @@ drmmode_crtc_scanout_free(drmmode_crtc_private_ptr drmmode_crtc)
 		DamageDestroy(drmmode_crtc->scanout_damage);
 }
 
-void
-drmmode_scanout_free(ScrnInfoPtr scrn)
-{
-	xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
-	int c;
-
-	for (c = 0; c < xf86_config->num_crtc; c++)
-		drmmode_crtc_scanout_free(xf86_config->crtc[c]->driver_private);
-}
-
 PixmapPtr
 drmmode_crtc_scanout_create(xf86CrtcPtr crtc, struct drmmode_scanout *scanout,
 			    int width, int height)
src/drmmode_display.h +0 -1
index eff342942..03134f0c9 100644
@@ -208,7 +208,6 @@ extern Bool drmmode_setup_colormap(ScreenPtr pScreen, ScrnInfoPtr pScrn);
 
 extern void drmmode_crtc_scanout_destroy(drmmode_ptr drmmode,
 					 struct drmmode_scanout *scanout);
-extern void drmmode_scanout_free(ScrnInfoPtr scrn);
 void drmmode_crtc_scanout_free(drmmode_crtc_private_ptr drmmode_crtc);
 PixmapPtr drmmode_crtc_scanout_create(xf86CrtcPtr crtc,
 				      struct drmmode_scanout *scanout,
Signature · 6 lines
2.14.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20170829083049.16229-6-michel-otUistvHUpPR7s880joybQ@public.gmane.org

Reviewed-by Alex Deucher
#8 lore raw

RE: [PATCH xf86-video-amdgpu 6/6] Remove drmmode_scanout_free

Quoted 7 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Michel Dänzer
Sent: Tuesday, August 29, 2017 4:31 AM
To: [email protected]
Subject: [PATCH xf86-video-amdgpu 6/6] Remove drmmode_scanout_free

Quoted 8 lines

From: Michel Dänzer <[email protected]>

Not used anymore.

(Cherry picked from radeon commit
e4a3df19d588a4310fcb889ef34e205d0e92e4d7)

Series is:

Quoted 46 lines
---
 src/drmmode_display.c | 10 ----------
 src/drmmode_display.h |  1 -
 2 files changed, 11 deletions(-)
src/drmmode_display.c +0 -10
index 6057699bf..9c838a8b9 100644
@@ -490,16 +490,6 @@
 drmmode_crtc_scanout_free(drmmode_crtc_private_ptr drmmode_crtc)
 		DamageDestroy(drmmode_crtc->scanout_damage);
 }
 
-void
-drmmode_scanout_free(ScrnInfoPtr scrn)
-{
-	xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
-	int c;
-
-	for (c = 0; c < xf86_config->num_crtc; c++)
-		drmmode_crtc_scanout_free(xf86_config->crtc[c]-
 >driver_private);
-}
-
 PixmapPtr

drmmode_crtc_scanout_create(xf86CrtcPtr crtc, struct drmmode_scanout
*scanout,

src/drmmode_display.c +0 -0
 			    int width, int height)
src/drmmode_display.h +0 -1
index eff342942..03134f0c9 100644
@@ -208,7 +208,6 @@ extern Bool drmmode_setup_colormap(ScreenPtr
 pScreen, ScrnInfoPtr pScrn);
 
 extern void drmmode_crtc_scanout_destroy(drmmode_ptr drmmode,
 					 struct drmmode_scanout *scanout);
-extern void drmmode_scanout_free(ScrnInfoPtr scrn);
 void drmmode_crtc_scanout_free(drmmode_crtc_private_ptr
 drmmode_crtc);

PixmapPtr drmmode_crtc_scanout_create(xf86CrtcPtr crtc,
struct drmmode_scanout *scanout,
--
2.14.1

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx