|
|
1ced2a3 |
From f270ca8e1788453babe292bf2e67d3d30459effa Mon Sep 17 00:00:00 2001
|
|
|
1ced2a3 |
From: Dave Airlie <airlied@redhat.com>
|
|
|
1ced2a3 |
Date: Thu, 23 Apr 2009 12:02:22 +1000
|
|
|
1ced2a3 |
Subject: [PATCH] exa: add support for tiling to create pixmap hooks
|
|
|
1ced2a3 |
|
|
|
1ced2a3 |
This adds support for passing w/h/d info to the pixmap creation
|
|
|
1ced2a3 |
hook in the driver so they can support tiling better.
|
|
|
1ced2a3 |
---
|
|
|
1ced2a3 |
exa/exa.c | 11 +++++++----
|
|
|
1ced2a3 |
exa/exa.h | 4 +++-
|
|
|
1ced2a3 |
2 files changed, 10 insertions(+), 5 deletions(-)
|
|
|
1ced2a3 |
|
|
|
1ced2a3 |
diff --git a/exa/exa.c b/exa/exa.c
|
|
|
1ced2a3 |
index 9b7091d..9e284a4 100644
|
|
|
1ced2a3 |
--- a/exa/exa.c
|
|
|
1ced2a3 |
+++ b/exa/exa.c
|
|
|
1ced2a3 |
@@ -285,7 +285,7 @@ exaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth,
|
|
|
1ced2a3 |
if (w > 32767 || h > 32767)
|
|
|
1ced2a3 |
return NullPixmap;
|
|
|
1ced2a3 |
|
|
|
1ced2a3 |
- if (!pExaScr->info->CreatePixmap) {
|
|
|
1ced2a3 |
+ if (!pExaScr->info->CreatePixmap && !pExaScr->info->CreatePixmap2) {
|
|
|
1ced2a3 |
pPixmap = fbCreatePixmap (pScreen, w, h, depth, usage_hint);
|
|
|
1ced2a3 |
} else {
|
|
|
1ced2a3 |
driver_alloc = 1;
|
|
|
1ced2a3 |
@@ -319,7 +319,10 @@ exaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth,
|
|
|
1ced2a3 |
*/
|
|
|
1ced2a3 |
pPixmap->devPrivate.ptr = NULL;
|
|
|
1ced2a3 |
|
|
|
1ced2a3 |
- pExaPixmap->driverPriv = pExaScr->info->CreatePixmap(pScreen, datasize, 0);
|
|
|
1ced2a3 |
+ if (pExaScr->info->CreatePixmap2)
|
|
|
1ced2a3 |
+ pExaPixmap->driverPriv = pExaScr->info->CreatePixmap2(pScreen, w, h, depth, usage_hint, bpp);
|
|
|
1ced2a3 |
+ else
|
|
|
1ced2a3 |
+ pExaPixmap->driverPriv = pExaScr->info->CreatePixmap(pScreen, datasize, 0);
|
|
|
1ced2a3 |
if (!pExaPixmap->driverPriv) {
|
|
|
1ced2a3 |
fbDestroyPixmap(pPixmap);
|
|
|
1ced2a3 |
return NULL;
|
|
|
1ced2a3 |
@@ -964,7 +967,7 @@ exaDriverInit (ScreenPtr pScreen,
|
|
|
1ced2a3 |
|
|
|
1ced2a3 |
pExaScr->SavedModifyPixmapHeader = pScreen->ModifyPixmapHeader;
|
|
|
1ced2a3 |
pScreen->ModifyPixmapHeader = exaModifyPixmapHeader;
|
|
|
1ced2a3 |
- if (!pExaScr->info->CreatePixmap) {
|
|
|
1ced2a3 |
+ if (!(pExaScr->info->flags & EXA_HANDLES_PIXMAPS)) {
|
|
|
1ced2a3 |
LogMessage(X_INFO, "EXA(%d): Offscreen pixmap area of %lu bytes\n",
|
|
|
1ced2a3 |
pScreen->myNum,
|
|
|
1ced2a3 |
pExaScr->info->memorySize - pExaScr->info->offScreenBase);
|
|
|
1ced2a3 |
@@ -977,7 +980,7 @@ exaDriverInit (ScreenPtr pScreen,
|
|
|
1ced2a3 |
else
|
|
|
1ced2a3 |
LogMessage(X_INFO, "EXA(%d): No offscreen pixmaps\n", pScreen->myNum);
|
|
|
1ced2a3 |
|
|
|
1ced2a3 |
- if (!pExaScr->info->CreatePixmap) {
|
|
|
1ced2a3 |
+ if (!(pExaScr->info->flags & EXA_HANDLES_PIXMAPS)) {
|
|
|
1ced2a3 |
DBG_PIXMAP(("============== %ld < %ld\n", pExaScr->info->offScreenBase,
|
|
|
1ced2a3 |
pExaScr->info->memorySize));
|
|
|
1ced2a3 |
if (pExaScr->info->offScreenBase < pExaScr->info->memorySize) {
|
|
|
1ced2a3 |
diff --git a/exa/exa.h b/exa/exa.h
|
|
|
1ced2a3 |
index 5982e1a..d14b02d 100644
|
|
|
1ced2a3 |
--- a/exa/exa.h
|
|
|
1ced2a3 |
+++ b/exa/exa.h
|
|
|
1ced2a3 |
@@ -39,7 +39,7 @@
|
|
|
1ced2a3 |
#include "fb.h"
|
|
|
1ced2a3 |
|
|
|
1ced2a3 |
#define EXA_VERSION_MAJOR 2
|
|
|
1ced2a3 |
-#define EXA_VERSION_MINOR 4
|
|
|
1ced2a3 |
+#define EXA_VERSION_MINOR 5
|
|
|
1ced2a3 |
#define EXA_VERSION_RELEASE 0
|
|
|
1ced2a3 |
|
|
|
1ced2a3 |
typedef struct _ExaOffscreenArea ExaOffscreenArea;
|
|
|
1ced2a3 |
@@ -711,6 +711,8 @@ typedef struct _ExaDriver {
|
|
|
1ced2a3 |
int depth, int bitsPerPixel, int devKind,
|
|
|
1ced2a3 |
pointer pPixData);
|
|
|
1ced2a3 |
|
|
|
1ced2a3 |
+ void *(*CreatePixmap2)(ScreenPtr pScreen, int width, int height,
|
|
|
1ced2a3 |
+ int depth, int usage_hint, int bitsPerPixel);
|
|
|
1ced2a3 |
/** @} */
|
|
|
1ced2a3 |
} ExaDriverRec, *ExaDriverPtr;
|
|
|
1ced2a3 |
|
|
|
1ced2a3 |
--
|
|
|
1ced2a3 |
1.6.0.6
|
|
|
1ced2a3 |
|