xserver: Branch 'master' - 5 commits
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Nov 25 17:54:26 UTC 2019
hw/xfree86/drivers/modesetting/driver.c | 1
hw/xfree86/drivers/modesetting/driver.h | 3 ++
hw/xfree86/drivers/modesetting/drmmode_display.c | 33 ++++++++++++++++++++---
hw/xfree86/modes/xf86Rotate.c | 3 ++
4 files changed, 37 insertions(+), 3 deletions(-)
New commits:
commit 60003023fa5b301dd621da4797f8a93035ebeeca
Author: Michel Dänzer <mdaenzer at redhat.com>
Date: Fri Nov 22 18:32:38 2019 +0100
modesetting: Use glamor_clear_pixmap in drmmode_clear_pixmap
Should be slightly more efficient.
Reviewed-by: Adam Jackson <ajax at redhat.com>
diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c
index 386e33460..6c7d7eaf0 100644
--- a/hw/xfree86/drivers/modesetting/driver.c
+++ b/hw/xfree86/drivers/modesetting/driver.c
@@ -748,6 +748,7 @@ bind_glamor_api(void *mod, modesettingPtr ms)
{
ms->glamor.back_pixmap_from_fd = LoaderSymbolFromModule(mod, "glamor_back_pixmap_from_fd");
ms->glamor.block_handler = LoaderSymbolFromModule(mod, "glamor_block_handler");
+ ms->glamor.clear_pixmap = LoaderSymbolFromModule(mod, "glamor_clear_pixmap");
ms->glamor.egl_create_textured_pixmap = LoaderSymbolFromModule(mod, "glamor_egl_create_textured_pixmap");
ms->glamor.egl_create_textured_pixmap_from_gbm_bo = LoaderSymbolFromModule(mod, "glamor_egl_create_textured_pixmap_from_gbm_bo");
ms->glamor.egl_exchange_buffers = LoaderSymbolFromModule(mod, "glamor_egl_exchange_buffers");
diff --git a/hw/xfree86/drivers/modesetting/driver.h b/hw/xfree86/drivers/modesetting/driver.h
index 4c524c4eb..5909829a0 100644
--- a/hw/xfree86/drivers/modesetting/driver.h
+++ b/hw/xfree86/drivers/modesetting/driver.h
@@ -137,6 +137,7 @@ typedef struct _modesettingRec {
Bool (*back_pixmap_from_fd)(PixmapPtr, int, CARD16, CARD16, CARD16,
CARD8, CARD8);
void (*block_handler)(ScreenPtr);
+ void (*clear_pixmap)(PixmapPtr);
Bool (*egl_create_textured_pixmap)(PixmapPtr, int, int);
Bool (*egl_create_textured_pixmap_from_gbm_bo)(PixmapPtr,
struct gbm_bo *,
diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index 8a9dc2d80..9a6abc249 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -1804,6 +1804,14 @@ drmmode_clear_pixmap(PixmapPtr pixmap)
{
ScreenPtr screen = pixmap->drawable.pScreen;
GCPtr gc;
+#ifdef GLAMOR_HAS_GBM
+ modesettingPtr ms = modesettingPTR(xf86ScreenToScrn(screen));
+
+ if (ms->drmmode.glamor) {
+ ms->glamor.clear_pixmap(pixmap);
+ return;
+ }
+#endif
gc = GetScratchGC(pixmap->drawable.depth, screen);
if (gc) {
commit 9ba13bac9dd076f166ff0d063fc144b904a40d12
Author: Michel Dänzer <mdaenzer at redhat.com>
Date: Mon Nov 18 18:06:28 2019 +0100
modesetting: Clear new screen pixmap storage on RandR resize
Fixes random garbage being visible intermittently.
Reviewed-by: Adam Jackson <ajax at redhat.com>
diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index 5f9e78662..8a9dc2d80 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -1799,6 +1799,19 @@ drmmode_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr ppix)
&drmmode_crtc->prime_pixmap);
}
+static void
+drmmode_clear_pixmap(PixmapPtr pixmap)
+{
+ ScreenPtr screen = pixmap->drawable.pScreen;
+ GCPtr gc;
+
+ gc = GetScratchGC(pixmap->drawable.depth, screen);
+ if (gc) {
+ miClearDrawable(&pixmap->drawable, gc);
+ FreeScratchGC(gc);
+ }
+}
+
static void *
drmmode_shadow_allocate(xf86CrtcPtr crtc, int width, int height)
{
@@ -3190,6 +3203,8 @@ drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height)
if (!drmmode_glamor_handle_new_screen_pixmap(drmmode))
goto fail;
+ drmmode_clear_pixmap(ppix);
+
for (i = 0; i < xf86_config->num_crtc; i++) {
xf86CrtcPtr crtc = xf86_config->crtc[i];
commit 327df450ffcf5bda5b4254db0208d355860d1010
Author: Michel Dänzer <mdaenzer at redhat.com>
Date: Fri Nov 22 17:51:22 2019 +0100
xfree86/modes: Call xf86RotateRedisplay from xf86CrtcRotate
If a new rotate buffer was allocated. This makes sure the new buffer
has valid transformed contents when it starts being displayed.
Reviewed-by: Adam Jackson <ajax at redhat.com>
diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c
index a8f1e615c..05944cfcb 100644
--- a/hw/xfree86/modes/xf86Rotate.c
+++ b/hw/xfree86/modes/xf86Rotate.c
@@ -485,6 +485,9 @@ xf86CrtcRotate(xf86CrtcPtr crtc)
if (damage)
xf86CrtcDamageShadow(crtc);
+ else if (crtc->rotatedData && !crtc->rotatedPixmap)
+ /* Make sure the new rotate buffer has valid transformed contents */
+ xf86RotateRedisplay(pScreen);
/* All done */
return TRUE;
commit c66c548eabf06835cb0cb906598fb87c7bb30cf4
Author: Michel Dänzer <mdaenzer at redhat.com>
Date: Fri Nov 22 17:58:12 2019 +0100
modesetting: Call glamor_finish from drmmode_crtc_set_mode
This makes sure any pending drawing to a new scanout buffer will be
visible from the start.
This makes the finish call in drmmode_copy_fb superfluous, so remove it.
Reviewed-by: Adam Jackson <ajax at redhat.com>
diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index 0ad4b848c..5f9e78662 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -755,6 +755,7 @@ drmmode_crtc_set_mode(xf86CrtcPtr crtc, Bool test_only)
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn);
drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
drmmode_ptr drmmode = drmmode_crtc->drmmode;
+ ScreenPtr screen = crtc->scrn->pScreen;
drmModeModeInfo kmode;
int output_count = 0;
uint32_t *output_ids = NULL;
@@ -765,6 +766,12 @@ drmmode_crtc_set_mode(xf86CrtcPtr crtc, Bool test_only)
if (!drmmode_crtc_get_fb_id(crtc, &fb_id, &x, &y))
return 1;
+#ifdef GLAMOR_HAS_GBM
+ /* Make sure any pending drawing will be visible in a new scanout buffer */
+ if (drmmode->glamor)
+ glamor_finish(screen);
+#endif
+
if (ms->atomic_modeset) {
drmModeAtomicReq *req = drmModeAtomicAlloc();
Bool active;
@@ -1419,7 +1426,6 @@ drmmode_copy_fb(ScrnInfoPtr pScrn, drmmode_ptr drmmode)
#ifdef GLAMOR_HAS_GBM
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
ScreenPtr pScreen = xf86ScrnToScreen(pScrn);
- modesettingPtr ms = modesettingPTR(pScrn);
PixmapPtr src, dst;
int fbcon_id = 0;
GCPtr gc;
@@ -1457,8 +1463,6 @@ drmmode_copy_fb(ScrnInfoPtr pScrn, drmmode_ptr drmmode)
FreeScratchGC(gc);
- glamor_finish(pScreen);
-
pScreen->canDoBGNoneRoot = TRUE;
if (drmmode->fbcon_pixmap)
commit 06ef320e9bc1f1098df9cd5581f072528f28128e
Author: Michel Dänzer <mdaenzer at redhat.com>
Date: Fri Nov 22 18:05:04 2019 +0100
modesetting: Add glamor_finish() convenience macro
This will simplify backporting the following fix to the 1.20 branch.
Reviewed-by: Adam Jackson <ajax at redhat.com>
diff --git a/hw/xfree86/drivers/modesetting/driver.h b/hw/xfree86/drivers/modesetting/driver.h
index 8a4ac9c42..4c524c4eb 100644
--- a/hw/xfree86/drivers/modesetting/driver.h
+++ b/hw/xfree86/drivers/modesetting/driver.h
@@ -158,6 +158,8 @@ typedef struct _modesettingRec {
} modesettingRec, *modesettingPtr;
+#define glamor_finish(screen) ms->glamor.finish(screen)
+
#define modesettingPTR(p) ((modesettingPtr)((p)->driverPrivate))
modesettingEntPtr ms_ent_priv(ScrnInfoPtr scrn);
diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index 144f7ce5c..0ad4b848c 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -1457,7 +1457,7 @@ drmmode_copy_fb(ScrnInfoPtr pScrn, drmmode_ptr drmmode)
FreeScratchGC(gc);
- ms->glamor.finish(pScreen);
+ glamor_finish(pScreen);
pScreen->canDoBGNoneRoot = TRUE;
More information about the xorg-commit
mailing list