xserver: Branch 'master' - 2 commits
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Jul 29 08:00:02 UTC 2021
hw/xfree86/drivers/modesetting/present.c | 3 +++
present/present.c | 10 +++++++++-
randr/randr.c | 27 +++++++++++++++++++++++++++
randr/randrstr.h | 2 ++
4 files changed, 41 insertions(+), 1 deletion(-)
New commits:
commit 8836b9d243444031b6396d39d345f2f83b5fa6a9
Author: Łukasz Spintzyk <lukasz.spintzyk at synaptics.com>
Date: Thu Jul 22 13:12:05 2021 +0200
modesetting: unflip not possible when glamor is not set
This is fixing crashes of xfce when running under qemu
diff --git a/hw/xfree86/drivers/modesetting/present.c b/hw/xfree86/drivers/modesetting/present.c
index f0a0e2704..916a15303 100644
--- a/hw/xfree86/drivers/modesetting/present.c
+++ b/hw/xfree86/drivers/modesetting/present.c
@@ -272,6 +272,9 @@ ms_present_check_unflip(RRCrtcPtr crtc,
pixmap->devKind != drmmode_bo_get_pitch(&ms->drmmode.front_bo))
return FALSE;
+ if (!ms->drmmode.glamor)
+ return FALSE;
+
#ifdef GBM_BO_WITH_MODIFIERS
/* Check if buffer format/modifier is supported by all active CRTCs */
gbm = ms->glamor.gbm_bo_from_pixmap(screen, pixmap);
commit d6c02ffd9c910637f6b3b7249507998e9e45f93c
Author: Łukasz Spintzyk <lukasz.spintzyk at synaptics.com>
Date: Mon Jul 19 14:25:28 2021 +0200
present: fallback get_crtc to return crtc belonging to screen with present extension
Since crtc can belong to secondary output that may not have present
extension enabled we should fallback to first enabled crtc or fake crtc.
Fix for issue xorg/xserver#1195
diff --git a/present/present.c b/present/present.c
index 217fe1d7a..271fe32bc 100644
--- a/present/present.c
+++ b/present/present.c
@@ -44,11 +44,19 @@ present_get_crtc(WindowPtr window)
{
ScreenPtr screen = window->drawable.pScreen;
present_screen_priv_ptr screen_priv = present_screen_priv(screen);
+ RRCrtcPtr crtc = NULL;
if (!screen_priv)
return NULL;
- return screen_priv->get_crtc(screen_priv, window);
+ crtc = screen_priv->get_crtc(screen_priv, window);
+ if (crtc && !present_screen_priv(crtc->pScreen)) {
+ crtc = RRFirstEnabledCrtc(screen);
+ }
+ if (crtc && !present_screen_priv(crtc->pScreen)) {
+ crtc = NULL;
+ }
+ return crtc;
}
/*
diff --git a/randr/randr.c b/randr/randr.c
index 3f94c2f6c..6d02c2577 100644
--- a/randr/randr.c
+++ b/randr/randr.c
@@ -697,6 +697,33 @@ RRFirstOutput(ScreenPtr pScreen)
return NULL;
}
+RRCrtcPtr
+RRFirstEnabledCrtc(ScreenPtr pScreen)
+{
+ rrScrPriv(pScreen);
+ RROutputPtr output;
+ int i, j;
+
+ if (!pScrPriv)
+ return NULL;
+
+ if (pScrPriv->primaryOutput && pScrPriv->primaryOutput->crtc &&
+ pScrPriv->primaryOutput->pScreen == pScreen)
+ return pScrPriv->primaryOutput->crtc;
+
+ for (i = 0; i < pScrPriv->numCrtcs; i++) {
+ RRCrtcPtr crtc = pScrPriv->crtcs[i];
+
+ for (j = 0; j < pScrPriv->numOutputs; j++) {
+ output = pScrPriv->outputs[j];
+ if (output->crtc == crtc && crtc->mode)
+ return crtc;
+ }
+ }
+ return NULL;
+}
+
+
CARD16
RRVerticalRefresh(xRRModeInfo * mode)
{
diff --git a/randr/randrstr.h b/randr/randrstr.h
index 8f427a48e..b23390575 100644
--- a/randr/randrstr.h
+++ b/randr/randrstr.h
@@ -593,6 +593,8 @@ extern _X_EXPORT Bool RRScreenInit(ScreenPtr pScreen);
extern _X_EXPORT RROutputPtr RRFirstOutput(ScreenPtr pScreen);
+extern _X_EXPORT RRCrtcPtr RRFirstEnabledCrtc(ScreenPtr pScreen);
+
extern _X_EXPORT Bool RROutputSetNonDesktop(RROutputPtr output, Bool non_desktop);
extern _X_EXPORT CARD16
More information about the xorg-commit
mailing list