r600g: add family retrival
authorDave Airlie <airlied@redhat.com>
Wed, 21 Jul 2010 05:39:01 +0000 (15:39 +1000)
committerJerome Glisse <jglisse@redhat.com>
Wed, 21 Jul 2010 21:05:36 +0000 (17:05 -0400)
allow pipe driver to get the family of the gpu.

src/gallium/drivers/r600/r600_screen.c
src/gallium/drivers/r600/radeon.h
src/gallium/winsys/r600/drm/radeon.c

index 20758b049c51c09f6674812c1880c93f7882ce6b..dec6fa8d272ecf5d0593c4795bd74787da8f9e42 100644 (file)
@@ -41,7 +41,13 @@ static const char* r600_get_vendor(struct pipe_screen* pscreen)
 
 static const char* r600_get_name(struct pipe_screen* pscreen)
 {
-       return "R600/R700 (HD2XXX,HD3XXX,HD4XXX)";
+       struct r600_screen *screen = r600_screen(pscreen);
+       enum radeon_family family = radeon_get_family(screen->rw);
+
+       if (family >= CHIP_R600 && family < CHIP_RV770)
+               return "R600 (HD2XXX,HD3XXX)";
+       else
+               return "R700 (HD4XXX)";
 }
 
 static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
index 2a82aadd8ce48f2a9207e74d5857670bf241c7eb..3a8405f9b40572af785cf398caa79908128ac656 100644 (file)
@@ -77,6 +77,8 @@ enum radeon_family {
        CHIP_LAST,
 };
 
+enum radeon_family radeon_get_family(struct radeon *rw);
+
 /*
  * radeon object functions
  */
index f2113c5807e4d0e19c70b2a77da455628607250d..7e6566980640c28db5afdcec37a3de142db1fd08 100644 (file)
 #include "radeon_drm.h"
 #include "r600d.h"
 
+enum radeon_family radeon_get_family(struct radeon *radeon)
+{
+       return radeon->family;
+}
+
 static int radeon_get_device(struct radeon *radeon)
 {
        struct drm_radeon_info info;