From: Zhenyu W. <zhe...@in...> - 2008-02-19 01:30:42
|
On 2008.01.30 10:55:40 +0800, Zhenyu Wang wrote: > Rebase this patch to current drm git tree, and attach patch to drm-patches kernel tree for 2.6.25 inclusion. Thanks. --- [PATCH] i915: wrap chipset types requiring hw status set ioctl Also applys to recent added new chipset. Signed-off-by: Zhenyu Wang <zhe...@in...> --- shared-core/i915_dma.c | 5 ++++- shared-core/i915_drv.h | 2 ++ 2 files changed, 6 insertions(+), 1 deletions(-) diff --git a/shared-core/i915_dma.c b/shared-core/i915_dma.c index 3874ed5..9fa4a60 100644 --- a/shared-core/i915_dma.c +++ b/shared-core/i915_dma.c @@ -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); @@ -1396,6 +1396,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; diff --git a/shared-core/i915_drv.h b/shared-core/i915_drv.h index 4d3ac0a..be7a47e 100644 --- a/shared-core/i915_drv.h +++ b/shared-core/i915_drv.h @@ -1239,6 +1239,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 -- 1.5.3.8 |