xserver: Branch 'master' - 2 commits
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Jan 4 10:44:59 UTC 2023
hw/xfree86/common/xf86Module.h | 2 +-
hw/xwayland/xwayland-output.c | 16 ++++++++++++++++
hw/xwayland/xwayland-output.h | 1 +
randr/randrstr.h | 8 ++++++++
randr/rrcrtc.c | 3 +++
5 files changed, 29 insertions(+), 1 deletion(-)
New commits:
commit 511d1686a6ac3e3e0d66fb67b62620ba2a6575c8
Author: Minh Phan <phanquangminh217 at gmail.com>
Date: Tue Nov 29 19:37:22 2022 +0700
xwayland/output: properly return the current emulated mode when queried
This fixes an issue with GLFW-based games failing to set the resolution
when the user request to switch back to the native display mode.
Signed-off-by: Minh Phan <phanquangminh217 at gmail.com>
Acked-by: Olivier Fourdan <ofourdan at redhat.com>
diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c
index 818df6d08..9109145ab 100644
--- a/hw/xwayland/xwayland-output.c
+++ b/hw/xwayland/xwayland-output.c
@@ -271,6 +271,7 @@ xwl_output_add_emulated_mode_for_client(struct xwl_output *xwl_output,
emulated_mode->server_output_id = xwl_output->server_output_id;
emulated_mode->width = mode->mode.width;
emulated_mode->height = mode->mode.height;
+ emulated_mode->id = mode->mode.id;
emulated_mode->from_vidmode = from_vidmode;
}
@@ -936,6 +937,20 @@ xwl_randr_crtc_set(ScreenPtr pScreen,
return TRUE;
}
+static void
+xwl_randr_crtc_get(ScreenPtr pScreen,
+ RRCrtcPtr crtc,
+ xRRGetCrtcInfoReply *rep)
+{
+ struct xwl_output *xwl_output = crtc->devPrivate;
+
+ struct xwl_emulated_mode *mode = xwl_output_get_emulated_mode_for_client(
+ xwl_output, GetCurrentClient());
+
+ if (mode)
+ rep->mode = mode->id;
+}
+
static Bool
xwl_randr_crtc_set_gamma(ScreenPtr pScreen, RRCrtcPtr crtc)
{
@@ -996,6 +1011,7 @@ xwl_screen_init_output(struct xwl_screen *xwl_screen)
#if RANDR_12_INTERFACE
rp->rrScreenSetSize = xwl_randr_screen_set_size;
rp->rrCrtcSet = xwl_randr_crtc_set;
+ rp->rrCrtcGet = xwl_randr_crtc_get;
rp->rrCrtcSetGamma = xwl_randr_crtc_set_gamma;
rp->rrCrtcGetGamma = xwl_randr_crtc_get_gamma;
rp->rrOutputSetProperty = xwl_randr_output_set_property;
diff --git a/hw/xwayland/xwayland-output.h b/hw/xwayland/xwayland-output.h
index 603b54527..e975dfbf6 100644
--- a/hw/xwayland/xwayland-output.h
+++ b/hw/xwayland/xwayland-output.h
@@ -69,6 +69,7 @@ struct xwl_emulated_mode {
uint32_t server_output_id;
int32_t width;
int32_t height;
+ RRMode id;
Bool from_vidmode;
};
commit 5145742fb6e3d108b05db1521b51112e0dbfb95a
Author: Minh Phan <phanquangminh217 at gmail.com>
Date: Tue Nov 29 19:35:13 2022 +0700
randr: introduce rrCrtcGetInfo DDX function
This allows rrCrtcGetInfo to override the values in the XRRCrtcGetInfo
reply. One use case is to allow Xwayland to return the current emulated
mode for the specific client instead of the global mode.
Signed-off-by: Minh Phan <phanquangminh217 at gmail.com>
Acked-by: Olivier Fourdan <ofourdan at redhat.com>
diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h
index d5e858fc8..c77eefd7e 100644
--- a/hw/xfree86/common/xf86Module.h
+++ b/hw/xfree86/common/xf86Module.h
@@ -74,7 +74,7 @@
* mask is 0xFFFF0000.
*/
#define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 4)
-#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(26, 0)
+#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(26, 6)
#define ABI_XINPUT_VERSION SET_ABI_VERSION(24, 4)
#define ABI_EXTENSION_VERSION SET_ABI_VERSION(10, 0)
diff --git a/randr/randrstr.h b/randr/randrstr.h
index 173ecdf4e..545348835 100644
--- a/randr/randrstr.h
+++ b/randr/randrstr.h
@@ -218,6 +218,10 @@ typedef Bool (*RRCrtcSetProcPtr) (ScreenPtr pScreen,
Rotation rotation,
int numOutputs, RROutputPtr * outputs);
+typedef void (*RRCrtcGetProcPtr) (ScreenPtr pScreen,
+ RRCrtcPtr crtc,
+ xRRGetCrtcInfoReply *rep);
+
typedef Bool (*RRCrtcSetGammaProcPtr) (ScreenPtr pScreen, RRCrtcPtr crtc);
typedef Bool (*RRCrtcGetGammaProcPtr) (ScreenPtr pScreen, RRCrtcPtr crtc);
@@ -420,6 +424,10 @@ typedef struct _rrScrPriv {
RRRequestLeaseProcPtr rrRequestLease;
RRGetLeaseProcPtr rrGetLease;
+
+#if RANDR_12_INTERFACE
+ RRCrtcGetProcPtr rrCrtcGet;
+#endif
} rrScrPrivRec, *rrScrPrivPtr;
extern _X_EXPORT DevPrivateKeyRec rrPrivKeyRec;
diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index cf149768f..0044fecce 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -1261,6 +1261,9 @@ ProcRRGetCrtcInfo(ClientPtr client)
}
}
+ if (pScrPriv->rrCrtcGet)
+ pScrPriv->rrCrtcGet(pScreen, crtc, &rep);
+
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
More information about the xorg-commit
mailing list