summaryrefslogtreecommitdiff
path: root/src/i830_memory.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2008-07-30 14:15:57 -0700
committerEric Anholt <eric@anholt.net>2008-07-30 14:15:57 -0700
commite9e6b4738573ffa3822ae68088bd53a645eedbce (patch)
treea9d2d1324d0e3e015e4b9c646726d6141b5b1a4a /src/i830_memory.c
parentd77d42e543ee82e801a8563a911826521c0ba557 (diff)
intel-gem: Use new getparam to detect kernel GEM support.
Diffstat (limited to 'src/i830_memory.c')
-rw-r--r--src/i830_memory.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/i830_memory.c b/src/i830_memory.c
index 2e238e25..b62bda05 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;