]> err.no Git - linux-2.6/commitdiff
i915: wrap chipset types requiring hw status set ioctl
authorZhenyu Wang <zhenyu.z.wang@intel.com>
Tue, 19 Feb 2008 10:59:09 +0000 (20:59 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 19 Feb 2008 23:37:09 +0000 (09:37 +1000)
Also applys to recent added new chipset.

Signed-off-by: Zhenyu Wang <zhenyu.z.wang@intel.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
drivers/char/drm/i915_dma.c
drivers/char/drm/i915_drv.h

index 43986d81ae34f4b26fd8b1c4f717f1ae0ea13c17..e9d6663bec73ec5e9a2642d6af29bab81b0b9f40 100644 (file)
@@ -171,7 +171,7 @@ static int i915_initialize(struct drm_device * dev, drm_i915_init_t * init)
        dev_priv->allow_batchbuffer = 1;
 
        /* Program Hardware Status Page */
-       if (!IS_G33(dev)) {
+       if (!I915_NEED_GFX_HWS(dev)) {
                dev_priv->status_page_dmah =
                        drm_pci_alloc(dev, PAGE_SIZE, PAGE_SIZE, 0xffffffff);
 
@@ -720,6 +720,9 @@ static int i915_set_status_page(struct drm_device *dev, void *data,
        drm_i915_private_t *dev_priv = dev->dev_private;
        drm_i915_hws_addr_t *hws = data;
 
+       if (!I915_NEED_GFX_HWS(dev))
+               return -EINVAL;
+
        if (!dev_priv) {
                DRM_ERROR("called with no initialization\n");
                return -EINVAL;
index f8308bfb26131ced8c68fa0d5fdf2a1220b1f993..786460d6b1a31bcceb83ed8d6d672e98aa339ade 100644 (file)
@@ -1101,6 +1101,8 @@ extern int i915_wait_ring(struct drm_device * dev, int n, const char *caller);
 #define IS_MOBILE(dev) (IS_I830(dev) || IS_I85X(dev) || IS_I915GM(dev) || \
                        IS_I945GM(dev) || IS_I965GM(dev) || IS_IGD_GM(dev))
 
+#define I915_NEED_GFX_HWS(dev) (IS_G33(dev) || IS_IGD_GM(dev))
+
 #define PRIMARY_RINGBUFFER_SIZE         (128*1024)
 
 #endif