summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2018-05-07 17:21:17 -0400
committerAdam Jackson <ajax@redhat.com>2018-05-08 12:15:29 -0400
commitcc66777d85f3509b0f9dfc9210d0a0415a2a388d (patch)
tree908d5f2b044d7b9e369a21b322671d5143d904b0
parentb23a0e4ded62500f2c248f23962ff5ac718467e6 (diff)
xwayland: Don't create a "fake" crtc for Present
We probably don't want a fake crtc to be visible to clients, and we definitely don't want to generate events every time we create such a fake (which would happen as a side effect from RRCrtcCreate hitting RRTellChanged). As it happens we're not actually using that crtc for anything because xwayland doesn't store any state on the crtc object, so it suffices to use the real crtc for the screen. Signed-off-by: Adam Jackson <ajax@redhat.com> Tested-by: Roman Gilg <subdiff@gmail.com> Reviewed-by: Roman Gilg <subdiff@gmail.com>
-rw-r--r--hw/xwayland/xwayland-present.c21
-rw-r--r--hw/xwayland/xwayland.h1
2 files changed, 4 insertions, 18 deletions
diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c
index ae9f47eba..b5ae80dcf 100644
--- a/hw/xwayland/xwayland-present.c
+++ b/hw/xwayland/xwayland-present.c
@@ -51,14 +51,10 @@ xwl_present_window_get_priv(WindowPtr window)
struct xwl_present_window *xwl_present_window = xwl_present_window_priv(window);
if (xwl_present_window == NULL) {
- ScreenPtr screen = window->drawable.pScreen;
-
xwl_present_window = calloc (1, sizeof (struct xwl_present_window));
if (!xwl_present_window)
return NULL;
- xwl_present_window->crtc_fake = RRCrtcCreate(screen,
- xwl_present_window);
xwl_present_window->window = window;
xwl_present_window->msc = 1;
xwl_present_window->ust = GetTimeInMicros();
@@ -131,8 +127,6 @@ xwl_present_cleanup(WindowPtr window)
if (xwl_window && xwl_window->present_window == window)
xwl_window->present_window = NULL;
- RRCrtcDestroy(xwl_present_window->crtc_fake);
-
if (xwl_present_window->frame_callback) {
wl_callback_destroy(xwl_present_window->frame_callback);
xwl_present_window->frame_callback = NULL;
@@ -306,10 +300,13 @@ static RRCrtcPtr
xwl_present_get_crtc(WindowPtr present_window)
{
struct xwl_present_window *xwl_present_window = xwl_present_window_get_priv(present_window);
+ rrScrPrivPtr rr_private;
+
if (xwl_present_window == NULL)
return NULL;
- return xwl_present_window->crtc_fake;
+ rr_private = rrGetScrPriv(present_window->drawable.pScreen);
+ return rr_private->crtcs[0];
}
static int
@@ -342,9 +339,6 @@ xwl_present_queue_vblank(WindowPtr present_window,
if (!xwl_window)
return BadMatch;
- if (xwl_present_window->crtc_fake != crtc)
- return BadRequest;
-
if (xwl_window->present_window &&
xwl_window->present_window != present_window)
return BadMatch;
@@ -454,13 +448,6 @@ xwl_present_flip(WindowPtr present_window,
if (!xwl_window)
return FALSE;
- /*
- * Make sure the client doesn't try to flip to another crtc
- * than the one created for 'xwl_window'.
- */
- if (xwl_present_window->crtc_fake != crtc)
- return FALSE;
-
present_box = RegionExtents(&present_window->winSize);
damage_box = RegionExtents(damage);
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index ce290d490..25112e2cb 100644
--- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h
@@ -182,7 +182,6 @@ struct xwl_present_window {
WindowPtr window;
struct xorg_list link;
- RRCrtcPtr crtc_fake;
uint64_t msc;
uint64_t ust;