summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2012-02-20 11:00:56 +0000
committerDave Airlie <airlied@redhat.com>2012-02-20 11:00:56 +0000
commit027a799d85a9d5cd8d599dc6f88e5a38adabe68b (patch)
treefc2e82bc28aa1773be5f0e65dd1dc3720ca99286
parentc4e451ac9229de32fd69e4f446fa740af55e014a (diff)
modesetting: move shadow stuff to other structure
we need this for resize to work properly. Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--src/driver.c28
-rw-r--r--src/driver.h3
-rw-r--r--src/drmmode_display.h4
3 files changed, 19 insertions, 16 deletions
diff --git a/src/driver.c b/src/driver.c
index b66f0d7..8703b0b 100644
--- a/src/driver.c
+++ b/src/driver.c
@@ -492,9 +492,9 @@ PreInit(ScrnInfoPtr pScrn, int flags)
prefer_shadow = !!value;
}
- ms->shadow_enable = xf86ReturnOptValBool(ms->Options, OPTION_SHADOW_FB, prefer_shadow);
+ ms->drmmode.shadow_enable = xf86ReturnOptValBool(ms->Options, OPTION_SHADOW_FB, prefer_shadow);
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ShadowFB: preferred %s, enabled %s\n", prefer_shadow ? "YES" : "NO", ms->shadow_enable ? "YES" : "NO");
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ShadowFB: preferred %s, enabled %s\n", prefer_shadow ? "YES" : "NO", ms->drmmode.shadow_enable ? "YES" : "NO");
ms->drmmode.fd = ms->fd;
if (drmmode_pre_init(pScrn, &ms->drmmode, pScrn->bitsPerPixel / 8) == FALSE) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "KMS setup failed\n");
@@ -527,7 +527,7 @@ PreInit(ScrnInfoPtr pScrn, int flags)
return FALSE;
}
- if (ms->shadow_enable) {
+ if (ms->drmmode.shadow_enable) {
if (!xf86LoadSubModule(pScrn, "shadow")) {
return FALSE;
}
@@ -577,13 +577,13 @@ CreateScreenResources(ScreenPtr pScreen)
rootPixmap = pScreen->GetScreenPixmap(pScreen);
- if (ms->shadow_enable)
- pixels = ms->shadow_fb;
+ if (ms->drmmode.shadow_enable)
+ pixels = ms->drmmode.shadow_fb;
if (!pScreen->ModifyPixmapHeader(rootPixmap, -1, -1, -1, -1, -1, pixels))
FatalError("Couldn't adjust screen pixmap\n");
- if (ms->shadow_enable) {
+ if (ms->drmmode.shadow_enable) {
if (!shadowAdd(pScreen, rootPixmap, shadowUpdatePackedWeak(),
msShadowWindow, 0, 0))
return FALSE;
@@ -634,11 +634,11 @@ ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
if (!drmmode_create_initial_bos(pScrn, &ms->drmmode))
return FALSE;
- if (ms->shadow_enable) {
- ms->shadow_fb = calloc(1, pScrn->displayWidth * pScrn->virtualY *
+ if (ms->drmmode.shadow_enable) {
+ ms->drmmode.shadow_fb = calloc(1, pScrn->displayWidth * pScrn->virtualY *
((pScrn->bitsPerPixel + 7) >> 3));
- if (!ms->shadow_fb)
- ms->shadow_enable = FALSE;
+ if (!ms->drmmode.shadow_fb)
+ ms->drmmode.shadow_enable = FALSE;
}
miClearVisualTypes();
@@ -677,7 +677,7 @@ ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
fbPictureInit(pScreen, NULL, 0);
- if (ms->shadow_enable && !msShadowInit(pScreen)) {
+ if (ms->drmmode.shadow_enable && !msShadowInit(pScreen)) {
xf86DrvMsg(scrnIndex, X_ERROR,
"shadow fb init failed\n");
return FALSE;
@@ -791,10 +791,10 @@ CloseScreen(int scrnIndex, ScreenPtr pScreen)
ms->damage = NULL;
}
- if (ms->shadow_enable) {
+ if (ms->drmmode.shadow_enable) {
shadowRemove(pScreen, pScreen->GetScreenPixmap(pScreen));
- free(ms->shadow_fb);
- ms->shadow_fb = NULL;
+ free(ms->drmmode.shadow_fb);
+ ms->drmmode.shadow_fb = NULL;
}
drmmode_uevent_fini(pScrn, &ms->drmmode);
diff --git a/src/driver.h b/src/driver.h
index 2e51089..79561c8 100644
--- a/src/driver.h
+++ b/src/driver.h
@@ -75,8 +75,7 @@ typedef struct _modesettingRec
DamagePtr damage;
Bool dirty_enabled;
- Bool shadow_enable;
- void *shadow_fb;
+
} modesettingRec, *modesettingPtr;
#define modesettingPTR(p) ((modesettingPtr)((p)->driverPrivate))
diff --git a/src/drmmode_display.h b/src/drmmode_display.h
index 7ede159..e83167b 100644
--- a/src/drmmode_display.h
+++ b/src/drmmode_display.h
@@ -54,6 +54,10 @@ typedef struct {
drmEventContext event_context;
struct dumb_bo *front_bo;
Bool sw_cursor;
+
+ Bool shadow_enable;
+ void *shadow_fb;
+
} drmmode_rec, *drmmode_ptr;
typedef struct {