From c08c3fd534700ec9aa0f6b8c854d0c932f503dba Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Thu, 21 Nov 2013 09:36:27 +1000 Subject: kms: add some useful fetch methods Signed-off-by: Ben Skeggs --- src/drmmode_display.c | 15 +++++++++++++++ src/nv_proto.h | 3 +++ 2 files changed, 18 insertions(+) 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); -- cgit v1.2.1