diff options
author | Jakob Bornecrantz <jakob@vmware.com> | 2010-01-30 06:38:06 +0300 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-02-01 04:29:03 +0300 |
commit | 8e19a951774a16cf2626292ae06fd2b62630e67e (patch) | |
tree | b1abc1cf6c493200d45663f71b1ff59ab3cd9477 /drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c | |
parent | 110b20c3ddcfa98cc932aef3af2d59b4e0841f08 (diff) | |
download | linux-8e19a951774a16cf2626292ae06fd2b62630e67e.tar.xz |
drm/vmwgfx: Correctly detect 3D
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c')
-rw-r--r-- | drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c index f7d5f70b52dd..4157547cc6e4 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c @@ -29,6 +29,25 @@ #include "drmP.h" #include "ttm/ttm_placement.h" +bool vmw_fifo_have_3d(struct vmw_private *dev_priv) +{ + __le32 __iomem *fifo_mem = dev_priv->mmio_virt; + uint32_t fifo_min, hwversion; + + fifo_min = ioread32(fifo_mem + SVGA_FIFO_MIN); + if (fifo_min <= SVGA_FIFO_3D_HWVERSION * sizeof(unsigned int)) + return false; + + hwversion = ioread32(fifo_mem + SVGA_FIFO_3D_HWVERSION); + if (hwversion == 0) + return false; + + if (hwversion < SVGA3D_HWVERSION_WS65_B1) + return false; + + return true; +} + int vmw_fifo_init(struct vmw_private *dev_priv, struct vmw_fifo_state *fifo) { __le32 __iomem *fifo_mem = dev_priv->mmio_virt; |