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, 38 insertions, 2 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 429e9cc..1521a32 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -51,6 +51,7 @@ typedef struct {
#ifdef HAVE_LIBUDEV
struct udev_monitor *uevent_monitor;
#endif
+ Bool called_csr;
} drmmode_rec, *drmmode_ptr;
typedef struct {
@@ -345,7 +346,9 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
drmmode_ConvertToKMode(crtc->scrn, &kmode, mode);
fb_id = drmmode->fb_id;
- if (drmmode_crtc->rotate_fb_id) {
+ if (crtc->randr_crtc->scanout_pixmap)
+ x = y = 0;
+ else if (drmmode_crtc->rotate_fb_id) {
fb_id = drmmode_crtc->rotate_fb_id;
x = 0;
y = 0;
@@ -536,6 +539,37 @@ drmmode_gamma_set(xf86CrtcPtr crtc, CARD16 *red, CARD16 *green, CARD16 *blue,
}
}
+static Bool
+drmmode_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr ppix)
+{
+ ScreenPtr screen = xf86ScrnToScreen(crtc->scrn);
+ drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
+ drmmode_ptr drmmode = drmmode_crtc->drmmode;
+ PixmapPtr screenpix = screen->GetScreenPixmap(screen);
+
+ if (!ppix) {
+ if (crtc->randr_crtc->scanout_pixmap)
+ PixmapStopDirtyTracking(crtc->randr_crtc->scanout_pixmap, screenpix);
+ return TRUE;
+ }
+
+ if (!drmmode->called_csr) {
+ NVPtr pNv = NVPTR(crtc->scrn);
+ drmmode->called_csr = TRUE;
+ miCreateScreenResources(screen);
+ screenpix = screen->GetScreenPixmap(screen);
+ nouveau_bo_ref(pNv->scanout, &nouveau_pixmap(screenpix)->bo);
+ }
+
+ PixmapStartDirtyTracking(ppix, screenpix, 0, 0);
+
+ /* need to set this pixmap into some sort of shadowing environment
+ for now */
+
+
+ return TRUE;
+}
+
static const xf86CrtcFuncsRec drmmode_crtc_funcs = {
.dpms = drmmode_crtc_dpms,
.set_mode_major = drmmode_set_mode_major,
@@ -547,6 +581,8 @@ static const xf86CrtcFuncsRec drmmode_crtc_funcs = {
.shadow_allocate = drmmode_crtc_shadow_allocate,
.shadow_destroy = drmmode_crtc_shadow_destroy,
.gamma_set = drmmode_gamma_set,
+
+ .set_scanout_pixmap = drmmode_set_scanout_pixmap,
};
@@ -1183,7 +1219,7 @@ Bool drmmode_pre_init(ScrnInfoPtr pScrn, int fd, int cpp)
drmmode = xnfalloc(sizeof *drmmode);
drmmode->fd = fd;
drmmode->fb_id = 0;
-
+ drmmode->called_csr = FALSE;
xf86CrtcConfigInit(pScrn, &drmmode_xf86crtc_config_funcs);
drmmode->cpp = cpp;