diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-03-09 08:27:02 +0000 |
---|---|---|
committer | Owain G. Ainsworth <oga@openbsd.org> | 2011-05-29 23:29:07 +0100 |
commit | 90829643d08dd1bef06bb9c27d8a8d8abaf935a1 (patch) | |
tree | 7777a3a41c244acca7ab3ba9810d2360b278c50d | |
parent | 15f093148847f47b67c9be72c1c86173d4df5302 (diff) |
Give each user of tiling separate xorg.conf options
So that you can indeed allocate a linear framebuffer if you so desire
without breaking mesa.
Adds:
Section "Driver"
Option "LinearFramebuffer" "False|True" # default false
EndSection
to xorg.conf
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
(cherry picked from commit 049ce4397ddf7fd088ce364cbb53cacf5133176f)
Conflicts:
man/intel.man
src/intel_driver.c
src/intel_driver.h
-rw-r--r-- | man/intel.man | 12 | ||||
-rw-r--r-- | src/intel.h | 7 | ||||
-rw-r--r-- | src/intel_dri.c | 4 | ||||
-rw-r--r-- | src/intel_driver.c | 27 | ||||
-rw-r--r-- | src/intel_driver.h | 1 | ||||
-rw-r--r-- | src/intel_memory.c | 4 |
6 files changed, 37 insertions, 18 deletions
diff --git a/man/intel.man b/man/intel.man index e11ced17..4923c89b 100644 --- a/man/intel.man +++ b/man/intel.man @@ -243,6 +243,18 @@ allows the driver to automatically figure out the correct fixed panel timings. See further in the section about LVDS fixed timing for more information. .TP +.BI "Option \*qTiling\*q \*q" boolean \*q +This option controls whether memory buffers for Pixmaps are allocated in tiled mode. In +most cases (especially for complex rendering), tiling dramatically improves +performance. +.BI "Option \*qLinearFramebuffer\*q \*q" boolean \*q +This option controls whether the memory for the scanout (also known as the +front or frame buffer) is allocated in linear memory. A tiled framebuffer is +required for power conservation features, but for certain system configurations +you may wish to override this and force a linear layout. +.IP +Default: disabled +.TP .BI "Option \*qXvMC\*q \*q" boolean \*q Enable XvMC driver. Current support MPEG2 MC on 915/945 and G33 series. User should provide absolute path to libIntelXvMC.so in XvMCConfig file. diff --git a/src/intel.h b/src/intel.h index 1e04d9b2..06faf2da 100644 --- a/src/intel.h +++ b/src/intel.h @@ -541,7 +541,12 @@ typedef struct intel_screen_private { Bool need_mi_flush; - Bool tiling; + unsigned int tiling; +#define INTEL_TILING_FB 0x1 +#define INTEL_TILING_2D 0x2 +#define INTEL_TILING_3D 0x4 +#define INTEL_TILING_ALL (~0) + Bool swapbuffers_wait; Bool has_relaxed_fencing; diff --git a/src/intel_dri.c b/src/intel_dri.c index 1fafd5e3..4b5567e1 100644 --- a/src/intel_dri.c +++ b/src/intel_dri.c @@ -227,7 +227,7 @@ I830DRI2CreateBuffers(DrawablePtr drawable, unsigned int *attachments, if (pixmap == NULL) { unsigned int hint = INTEL_CREATE_PIXMAP_DRI2; - if (intel->tiling) { + if (intel->tiling & INTEL_TILING_3D) { switch (attachments[i]) { case DRI2BufferDepth: if (SUPPORTS_YTILING(intel)) @@ -318,7 +318,7 @@ I830DRI2CreateBuffer(DrawablePtr drawable, unsigned int attachment, if (pixmap == NULL) { unsigned int hint = INTEL_CREATE_PIXMAP_DRI2; - if (intel->tiling) { + if (intel->tiling & INTEL_TILING_3D) { switch (attachment) { case DRI2BufferDepth: case DRI2BufferDepthStencil: diff --git a/src/intel_driver.c b/src/intel_driver.c index 7ca802a5..15437023 100644 --- a/src/intel_driver.c +++ b/src/intel_driver.c @@ -104,7 +104,8 @@ typedef enum { OPTION_FALLBACKDEBUG, OPTION_LVDS24BITMODE, OPTION_FBC, - OPTION_TILING, + OPTION_TILING_FB, + OPTION_TILING_2D, OPTION_SHADOW, OPTION_SWAPBUFFERS_WAIT, OPTION_LVDSFIXEDMODE, @@ -127,7 +128,8 @@ static OptionInfoRec I830Options[] = { {OPTION_FALLBACKDEBUG, "FallbackDebug", OPTV_BOOLEAN, {0}, FALSE}, {OPTION_LVDS24BITMODE, "LVDS24Bit", OPTV_BOOLEAN, {0}, FALSE}, {OPTION_FBC, "FramebufferCompression", OPTV_BOOLEAN, {0}, TRUE}, - {OPTION_TILING, "Tiling", OPTV_BOOLEAN, {0}, TRUE}, + {OPTION_TILING_2D, "Tiling", OPTV_BOOLEAN, {0}, TRUE}, + {OPTION_TILING_FB, "LinearFramebuffer", OPTV_BOOLEAN, {0}, FALSE}, {OPTION_SHADOW, "Shadow", OPTV_BOOLEAN, {0}, FALSE}, {OPTION_SWAPBUFFERS_WAIT, "SwapbuffersWait", OPTV_BOOLEAN, {0}, TRUE}, {OPTION_LVDSFIXEDMODE, "LVDSFixedMode", OPTV_BOOLEAN, {0}, FALSE}, @@ -2254,16 +2256,13 @@ I830ScreenInit(int scrnIndex, ScreenPtr screen, int argc, char **argv) intel->use_shadow = !intel->can_blt; /* Enable tiling by default */ - intel->tiling = TRUE; + intel->tiling = INTEL_TILING_ALL; /* Allow user override if they set a value */ - /* Allow user override if they set a value */ - if (!ALWAYS_TILING(intel) && xf86IsOptionSet(intel->Options, OPTION_TILING)) { - if (xf86ReturnOptValBool(intel->Options, OPTION_TILING, FALSE)) - intel->tiling = TRUE; - else - intel->tiling = FALSE; - } + if (!xf86ReturnOptValBool(intel->Options, OPTION_TILING_2D, TRUE)) + intel->tiling &= ~INTEL_TILING_2D; + if (xf86ReturnOptValBool(intel->Options, OPTION_TILING_FB, FALSE)) + intel->tiling &= ~INTEL_TILING_FB; if (xf86IsOptionSet(intel->Options, OPTION_SHADOW)) { if (xf86ReturnOptValBool(intel->Options, OPTION_SHADOW, FALSE)) @@ -2288,8 +2287,12 @@ I830ScreenInit(int scrnIndex, ScreenPtr screen, int argc, char **argv) intel->swapbuffers_wait = FALSE; } - xf86DrvMsg(scrn->scrnIndex, X_CONFIG, "Tiling %sabled\n", - intel->tiling ? "en" : "dis"); + xf86DrvMsg(scrn->scrnIndex, X_CONFIG, "Framebuffer %s\n", + intel->tiling & INTEL_TILING_FB ? "tiled" : "linear"); + xf86DrvMsg(scrn->scrnIndex, X_CONFIG, "Pixmaps %s\n", + intel->tiling & INTEL_TILING_2D ? "tiled" : "linear"); + xf86DrvMsg(scrn->scrnIndex, X_CONFIG, "3D buffers %s\n", + intel->tiling & INTEL_TILING_3D ? "tiled" : "linear"); xf86DrvMsg(scrn->scrnIndex, X_CONFIG, "SwapBuffers wait %sabled\n", intel->swapbuffers_wait ? "en" : "dis"); diff --git a/src/intel_driver.h b/src/intel_driver.h index 17591014..3bbc0214 100644 --- a/src/intel_driver.h +++ b/src/intel_driver.h @@ -266,7 +266,6 @@ #define DSPARB_HWCONTROL(pI810) (IS_G4X(pI810) || IS_IGDNG(pI810)) /* supports Y tiled surfaces (pre-965 Mesa isn't ready yet) */ #define SUPPORTS_YTILING(pI810) (INTEL_INFO(intel)->gen >= 40) -#define ALWAYS_TILING(intel) IS_GEN6(intel) extern SymTabRec *intel_chipsets; diff --git a/src/intel_memory.c b/src/intel_memory.c index 90e7be7d..017a2898 100644 --- a/src/intel_memory.c +++ b/src/intel_memory.c @@ -897,7 +897,7 @@ drm_intel_bo *intel_allocate_framebuffer(ScrnInfoPtr scrn, uint32_t tiling_mode; unsigned long pitch; - if (intel->tiling) + if (intel->tiling & INTEL_TILING_FB) tiling_mode = I915_TILING_X; else tiling_mode = I915_TILING_NONE; @@ -943,7 +943,7 @@ retry: return NULL; } - if (intel->tiling && tiling_mode != I915_TILING_X) { + if ((intel->tiling & INTEL_TILING_FB) && tiling_mode != I915_TILING_X) { xf86DrvMsg(scrn->scrnIndex, X_WARNING, "Failed to set tiling on frontbuffer.\n"); } |