i915: gfx hw and i945gme fixes from upstream
authorDave Airlie <airlied@linux.ie>
Tue, 22 Apr 2008 06:08:17 +0000 (16:08 +1000)
committerDave Airlie <airlied@linux.ie>
Tue, 22 Apr 2008 06:08:17 +0000 (16:08 +1000)
From Jesse and Zhenyu originally.

shared-core/i915_dma.c
shared-core/i915_drv.h

index 1e493e3..7ccd185 100644 (file)
@@ -245,7 +245,7 @@ static int i915_initialize(struct drm_device * dev,
        dev_priv->vblank_pipe = DRM_I915_VBLANK_PIPE_A;
 
        /* 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);
 
@@ -970,6 +970,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 3fd416c..412a259 100644 (file)
@@ -1274,8 +1274,8 @@ extern int i915_wait_ring(struct drm_device * dev, int n, const char *caller);
 #define IS_I915G(dev) ((dev)->pci_device == 0x2582 || (dev)->pci_device == 0x258a)
 #define IS_I915GM(dev) ((dev)->pci_device == 0x2592)
 #define IS_I945G(dev) ((dev)->pci_device == 0x2772)
-#define IS_I945GM(dev) ((dev)->pci_device == 0x27A2)
-
+#define IS_I945GM(dev) ((dev)->pci_device == 0x27A2 ||\
+                       (dev)->pci_device == 0x27AE)
 #define IS_I965G(dev) ((dev)->pci_device == 0x2972 || \
                       (dev)->pci_device == 0x2982 || \
                       (dev)->pci_device == 0x2992 || \
@@ -1298,6 +1298,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