summaryrefslogtreecommitdiff
path: root/src/drmmode_display.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/drmmode_display.c')
-rw-r--r--src/drmmode_display.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index a6142160..244a98f8 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -52,6 +52,9 @@
#define DEFAULT_NOMINAL_FRAME_RATE 60
static Bool
+drmmode_xf86crtc_resize (ScrnInfoPtr scrn, int width, int height);
+
+static Bool
RADEONZaphodStringMatches(ScrnInfoPtr pScrn, const char *s, char *output_name)
{
int i = 0;
@@ -522,6 +525,11 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
drmmode_ConvertToKMode(crtc->scrn, &kmode, mode);
fb_id = drmmode->fb_id;
+#ifdef RADEON_PIXMAP_SHARING
+ if (crtc->randr_crtc && crtc->randr_crtc->scanout_pixmap)
+ x = y = 0;
+ else
+#endif
if (drmmode_crtc->rotate_fb_id) {
fb_id = drmmode_crtc->rotate_fb_id;
x = y = 0;
@@ -727,6 +735,35 @@ drmmode_crtc_gamma_set(xf86CrtcPtr crtc, uint16_t *red, uint16_t *green,
size, red, green, blue);
}
+#ifdef RADEON_PIXMAP_SHARING
+static Bool
+drmmode_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr ppix)
+{
+ ScreenPtr screen = xf86ScrnToScreen(crtc->scrn);
+ PixmapPtr screenpix = screen->GetScreenPixmap(screen);
+
+ if (!ppix) {
+ if (crtc->randr_crtc->scanout_pixmap)
+ PixmapStopDirtyTracking(crtc->randr_crtc->scanout_pixmap, screenpix);
+ return TRUE;
+ }
+
+ if (ppix->drawable.width > screenpix->drawable.width ||
+ ppix->drawable.height > screenpix->drawable.height) {
+ Bool ret;
+ ret = drmmode_xf86crtc_resize(crtc->scrn, ppix->drawable.width, ppix->drawable.height);
+ if (ret == FALSE)
+ return FALSE;
+
+ screenpix = screen->GetScreenPixmap(screen);
+ screen->width = screenpix->drawable.width = ppix->drawable.width;
+ screen->height = screenpix->drawable.height = ppix->drawable.height;
+ }
+ PixmapStartDirtyTracking(ppix, screenpix, 0, 0);
+ return TRUE;
+}
+#endif
+
static const xf86CrtcFuncsRec drmmode_crtc_funcs = {
.dpms = drmmode_crtc_dpms,
.set_mode_major = drmmode_set_mode_major,
@@ -741,6 +778,9 @@ static const xf86CrtcFuncsRec drmmode_crtc_funcs = {
.shadow_allocate = drmmode_crtc_shadow_allocate,
.shadow_destroy = drmmode_crtc_shadow_destroy,
.destroy = NULL, /* XXX */
+#ifdef RADEON_PIXMAP_SHARING
+ .set_scanout_pixmap = drmmode_set_scanout_pixmap,
+#endif
};
int drmmode_get_crtc_id(xf86CrtcPtr crtc)