All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH xf86-video-amdgpu 1/6] Create amdgpu_pixmap_clear helper
@ 2017-08-29  8:30 Michel Dänzer
       [not found] ` <20170829083049.16229-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Michel Dänzer @ 2017-08-29  8:30 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

From: Michel Dänzer <michel.daenzer@amd.com>

Preparatory, no functional change intended yet.

(Ported from radeon commit 3f6210ca2c8ef60d59efc8139151d3b9838bb875)

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
---
 src/amdgpu_bo_helper.c | 20 ++++++++++++++++++++
 src/amdgpu_bo_helper.h |  2 ++
 src/drmmode_display.c  | 14 +-------------
 3 files changed, 23 insertions(+), 13 deletions(-)

diff --git a/src/amdgpu_bo_helper.c b/src/amdgpu_bo_helper.c
index 7acd0057e..ee52e0c24 100644
--- a/src/amdgpu_bo_helper.c
+++ b/src/amdgpu_bo_helper.c
@@ -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) {
diff --git a/src/amdgpu_bo_helper.h b/src/amdgpu_bo_helper.h
index 26fca1604..4f6b628a6 100644
--- a/src/amdgpu_bo_helper.h
+++ b/src/amdgpu_bo_helper.h
@@ -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);
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 17efde8e8..285eb0a0f 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -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++) {
-- 
2.14.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-08-29 13:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-29  8:30 [PATCH xf86-video-amdgpu 1/6] Create amdgpu_pixmap_clear helper Michel Dänzer
     [not found] ` <20170829083049.16229-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
2017-08-29  8:30   ` [PATCH xf86-video-amdgpu 2/6] Create drmmode_set_mode helper Michel Dänzer
2017-08-29  8:30   ` [PATCH xf86-video-amdgpu 3/6] Create amdgpu_pixmap_get_fb_ptr helper Michel Dänzer
2017-08-29  8:30   ` [PATCH xf86-video-amdgpu 4/6] Create amdgpu_master_screen helper Michel Dänzer
2017-08-29  8:30   ` [PATCH xf86-video-amdgpu 5/6] Make all active CRTCs scan out an all-black framebuffer in LeaveVT Michel Dänzer
2017-08-29  8:30   ` [PATCH xf86-video-amdgpu 6/6] Remove drmmode_scanout_free Michel Dänzer
     [not found]     ` <20170829083049.16229-6-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
2017-08-29 13:47       ` Deucher, Alexander

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.