drm/amd/display: Support P010 pixel format
authorStylon Wang <stylon.wang@amd.com>
Fri, 6 Mar 2020 14:55:29 +0000 (09:55 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 31 Mar 2020 16:26:14 +0000 (12:26 -0400)
[Why]
P010 pixel format is not declared as supported in DRM and DM.

[How]
Add P010 format to the support list presented to DRM and checked in DM

Signed-off-by: Stylon Wang <stylon.wang@amd.com>
Reviewed-by: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c

index d3674d805a0adc4631222ae721652767a83772dd..ad14c1a3084337a8ea61025d0433f831f78937a9 100644 (file)
@@ -3639,6 +3639,9 @@ fill_dc_plane_info_and_addr(struct amdgpu_device *adev,
        case DRM_FORMAT_NV12:
                plane_info->format = SURFACE_PIXEL_FORMAT_VIDEO_420_YCrCb;
                break;
+       case DRM_FORMAT_P010:
+               plane_info->format = SURFACE_PIXEL_FORMAT_VIDEO_420_10bpc_YCrCb;
+               break;
        default:
                DRM_ERROR(
                        "Unsupported screen format %s\n",
@@ -5535,6 +5538,8 @@ static int get_plane_formats(const struct drm_plane *plane,
 
                if (plane_cap && plane_cap->pixel_format_support.nv12)
                        formats[num_formats++] = DRM_FORMAT_NV12;
+               if (plane_cap && plane_cap->pixel_format_support.p010)
+                       formats[num_formats++] = DRM_FORMAT_P010;
                break;
 
        case DRM_PLANE_TYPE_OVERLAY:
index 261bdc3a8218c1e8b03cd8f3fd930561dcb849b7..8b7122249ddc6c3679b59cfba37595e6e0271b43 100644 (file)
@@ -552,7 +552,8 @@ static const struct dc_plane_cap plane_cap = {
        .pixel_format_support = {
                        .argb8888 = true,
                        .nv12 = true,
-                       .fp16 = true
+                       .fp16 = true,
+                       .p010 = true
        },
 
        .max_upscale_factor = {
index a67395208991f83e01be1f219f3714a4215b3ecf..54e096055c6fdb13cf1cf3dc5e7eb3d1f939ba31 100644 (file)
@@ -1012,7 +1012,8 @@ static const struct dc_plane_cap plane_cap = {
        .pixel_format_support = {
                        .argb8888 = true,
                        .nv12 = true,
-                       .fp16 = true
+                       .fp16 = true,
+                       .p010 = true
        },
 
        .max_upscale_factor = {
index 51b5910cd05fab3e5efd7c8ddbbc1e88e4684382..deda1a6b603b9811de6234dbf9f8d78769754c20 100644 (file)
@@ -838,7 +838,8 @@ static const struct dc_plane_cap plane_cap = {
        .pixel_format_support = {
                        .argb8888 = true,
                        .nv12 = true,
-                       .fp16 = true
+                       .fp16 = true,
+                       .p010 = true
        },
 
        .max_upscale_factor = {