xf86-video-intel: Branch 'drm-gem' - 2 commits - src/i830_memory.c
Eric Anholt
anholt at kemper.freedesktop.org
Wed Jul 30 14:16:41 PDT 2008
src/i830_memory.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
New commits:
commit e9e6b4738573ffa3822ae68088bd53a645eedbce
Author: Eric Anholt <eric at anholt.net>
Date: Wed Jul 30 14:15:57 2008 -0700
intel-gem: Use new getparam to detect kernel GEM support.
diff --git a/src/i830_memory.c b/src/i830_memory.c
index 2e238e2..b62bda0 100644
--- a/src/i830_memory.c
+++ b/src/i830_memory.c
@@ -384,6 +384,8 @@ i830_allocator_init(ScrnInfoPtr pScrn, unsigned long offset, unsigned long size)
i830_memory *start, *end;
#ifdef XF86DRI
int dri_major, dri_minor, dri_patch;
+ struct drm_i915_getparam gp;
+ int has_gem;
#endif
start = xcalloc(1, sizeof(*start));
@@ -424,12 +426,19 @@ i830_allocator_init(ScrnInfoPtr pScrn, unsigned long offset, unsigned long size)
#ifdef XF86DRI
DRIQueryVersion(&dri_major, &dri_minor, &dri_patch);
+ has_gem = 0;
+ gp.param = I915_PARAM_HAS_GEM;
+ gp.value = &has_gem;
+
+ (void)drmCommandWriteRead(pI830->drmSubFD, DRM_I915_GETPARAM,
+ &gp, sizeof(gp));
+
/* Now that we have our manager set up, initialize the kernel MM if
* possible, covering almost all of the aperture. We need libdri interface
* 5.4 or newer so we can rely on the lock being held after DRIScreenInit,
* rather than after DRIFinishScreenInit.
*/
- if (pI830->directRenderingEnabled && pI830->drmMinor >= 7 &&
+ if (pI830->directRenderingEnabled && has_gem &&
(dri_major > 5 || (dri_major == 5 && dri_minor >= 4)))
{
int mmsize;
commit d77d42e543ee82e801a8563a911826521c0ba557
Author: Eric Anholt <eric at anholt.net>
Date: Sat Jul 26 16:10:05 2008 -0700
intel-gem: Give a better error message if the kernel rejects the tiling mode.
diff --git a/src/i830_memory.c b/src/i830_memory.c
index 222882c..2e238e2 100644
--- a/src/i830_memory.c
+++ b/src/i830_memory.c
@@ -914,7 +914,8 @@ i830_allocate_memory_tiled(ScrnInfoPtr pScrn, const char *name,
if (ret != 0 || set_tiling.tiling_mode == I915_TILING_NONE) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Failed to set tiling on %s: %s\n",
- mem->name, strerror(errno));
+ mem->name,
+ ret == 0 ? "rejected by kernel" : strerror(errno));
i830_free_memory(pScrn, mem);
return i830_allocate_memory(pScrn, name, size, alignment,
flags);
More information about the xorg-commit
mailing list