drm/radeon/kms: add MSAA texture support for r600-evergreen
authorMarek Olšák <maraeo@gmail.com>
Thu, 9 Aug 2012 14:34:16 +0000 (16:34 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 13 Aug 2012 14:50:56 +0000 (10:50 -0400)
Most of the checking seems to be in place already. As you can see,
log2(number of samples) resides in LAST_LEVEL.

This is required for MSAA support (namely for depth-stencil resolve and
blitting between MSAA resources).

Signed-off-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/evergreen_cs.c
drivers/gpu/drm/radeon/r600_cs.c
drivers/gpu/drm/radeon/radeon_drv.c

index f2e5c545c973d2b2e973f85fd3451749113271d0..e44a62a07fe396f36e70dd6dce1b4460c6786b45 100644 (file)
@@ -788,6 +788,13 @@ static int evergreen_cs_track_validate_texture(struct radeon_cs_parser *p,
        case V_030000_SQ_TEX_DIM_1D_ARRAY:
        case V_030000_SQ_TEX_DIM_2D_ARRAY:
                depth = 1;
+               break;
+       case V_030000_SQ_TEX_DIM_2D_MSAA:
+       case V_030000_SQ_TEX_DIM_2D_ARRAY_MSAA:
+               surf.nsamples = 1 << llevel;
+               llevel = 0;
+               depth = 1;
+               break;
        case V_030000_SQ_TEX_DIM_3D:
                break;
        default:
index ff61402ef795d12bc5e85f8d0bfb5743b4e8d56e..3dab49cb1d4a6455b517c118719ef0a08ede5f84 100644 (file)
@@ -1620,8 +1620,13 @@ static int r600_check_texture_resource(struct radeon_cs_parser *p,  u32 idx,
        case V_038000_SQ_TEX_DIM_2D_ARRAY:
                is_array = true;
                break;
-       case V_038000_SQ_TEX_DIM_2D_MSAA:
        case V_038000_SQ_TEX_DIM_2D_ARRAY_MSAA:
+               is_array = true;
+               /* fall through */
+       case V_038000_SQ_TEX_DIM_2D_MSAA:
+               array_check.nsamples = 1 << llevel;
+               llevel = 0;
+               break;
        default:
                dev_warn(p->dev, "this kernel doesn't support %d texture dim\n", G_038000_DIM(word0));
                return -EINVAL;
index 4b736ecb0aa5357da734fc80ba1fed5678559809..a7f8ac0d8f035f4c8d67e20ca7ddb6fce36a7f01 100644 (file)
  *   2.16.0 - fix evergreen 2D tiled surface calculation
  *   2.17.0 - add STRMOUT_BASE_UPDATE for r7xx
  *   2.18.0 - r600-eg: allow "invalid" DB formats
+ *   2.19.0 - r600-eg: MSAA textures
  */
 #define KMS_DRIVER_MAJOR       2
-#define KMS_DRIVER_MINOR       18
+#define KMS_DRIVER_MINOR       19
 #define KMS_DRIVER_PATCHLEVEL  0
 int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags);
 int radeon_driver_unload_kms(struct drm_device *dev);