diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2013-11-21 09:36:27 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2013-11-21 09:36:27 +1000 |
commit | c08c3fd534700ec9aa0f6b8c854d0c932f503dba (patch) | |
tree | 9fa45880787b4eecafc52f0d7072cc7389edd899 | |
parent | 480f0998ffed6d9a5c6656dba75182f00fd88a1b (diff) | |
download | xorg-driver-xf86-video-nouveau-c08c3fd534700ec9aa0f6b8c854d0c932f503dba.tar.gz |
kms: add some useful fetch methods
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r-- | src/drmmode_display.c | 15 | ||||
-rw-r--r-- | src/nv_proto.h | 3 |
2 files changed, 18 insertions, 0 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c index cc141a0..3e8ccec 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -115,6 +115,21 @@ drmmode_from_scrn(ScrnInfoPtr scrn) return NULL; } +int +drmmode_head(xf86CrtcPtr crtc) +{ + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + return drmmode_crtc->mode_crtc->crtc_id; +} + +void +drmmode_swap(ScrnInfoPtr scrn, uint32_t next, uint32_t *prev) +{ + drmmode_ptr drmmode = drmmode_from_scrn(scrn); + *prev = drmmode->fb_id; + drmmode->fb_id = next; +} + static PixmapPtr drmmode_pixmap_wrap(ScreenPtr pScreen, int width, int height, int depth, int bpp, int pitch, struct nouveau_bo *bo, void *data) diff --git a/src/nv_proto.h b/src/nv_proto.h index a573269..f45c0d6 100644 --- a/src/nv_proto.h +++ b/src/nv_proto.h @@ -12,6 +12,9 @@ Bool drmmode_page_flip(DrawablePtr draw, PixmapPtr back, void *priv, void drmmode_screen_init(ScreenPtr pScreen); void drmmode_screen_fini(ScreenPtr pScreen); +int drmmode_head(xf86CrtcPtr crtc); +void drmmode_swap(ScrnInfoPtr, uint32_t, uint32_t *); + /* in nv_accel_common.c */ Bool NVAccelCommonInit(ScrnInfoPtr pScrn); Bool NVAccelGetCtxSurf2DFormatFromPixmap(PixmapPtr pPix, int *fmt_ret); |