]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915: Add 10bpc formats with alpha for icl+
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 31 Oct 2019 16:56:50 +0000 (18:56 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 4 Nov 2019 15:59:06 +0000 (17:59 +0200)
ICL+ again supports alpha blending with 10bpc pixel formats.
Expose them.

v2: Add all the stuff I missed earlier!

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191031165652.10868-6-ville.syrjala@linux.intel.com
drivers/gpu/drm/i915/display/intel_display.c
drivers/gpu/drm/i915/display/intel_sprite.c

index 983649c483a154a48891a30483a8a211f2a3ea3f..512c797bfc696601096fd4470f449d5e564684f5 100644 (file)
@@ -3053,10 +3053,17 @@ int skl_format_to_fourcc(int format, bool rgb_order, bool alpha)
                                return DRM_FORMAT_XRGB8888;
                }
        case PLANE_CTL_FORMAT_XRGB_2101010:
-               if (rgb_order)
-                       return DRM_FORMAT_XBGR2101010;
-               else
-                       return DRM_FORMAT_XRGB2101010;
+               if (rgb_order) {
+                       if (alpha)
+                               return DRM_FORMAT_ABGR2101010;
+                       else
+                               return DRM_FORMAT_XBGR2101010;
+               } else {
+                       if (alpha)
+                               return DRM_FORMAT_ARGB2101010;
+                       else
+                               return DRM_FORMAT_XRGB2101010;
+               }
        case PLANE_CTL_FORMAT_XRGB_16161616F:
                if (rgb_order) {
                        if (alpha)
@@ -4102,8 +4109,10 @@ static u32 skl_plane_ctl_format(u32 pixel_format)
        case DRM_FORMAT_ARGB8888:
                return PLANE_CTL_FORMAT_XRGB_8888;
        case DRM_FORMAT_XBGR2101010:
+       case DRM_FORMAT_ABGR2101010:
                return PLANE_CTL_FORMAT_XRGB_2101010 | PLANE_CTL_ORDER_RGBX;
        case DRM_FORMAT_XRGB2101010:
+       case DRM_FORMAT_ARGB2101010:
                return PLANE_CTL_FORMAT_XRGB_2101010;
        case DRM_FORMAT_XBGR16161616F:
        case DRM_FORMAT_ABGR16161616F:
@@ -5705,6 +5714,8 @@ static int skl_update_scaler_plane(struct intel_crtc_state *crtc_state,
        case DRM_FORMAT_ARGB8888:
        case DRM_FORMAT_XRGB2101010:
        case DRM_FORMAT_XBGR2101010:
+       case DRM_FORMAT_ARGB2101010:
+       case DRM_FORMAT_ABGR2101010:
        case DRM_FORMAT_YUYV:
        case DRM_FORMAT_YVYU:
        case DRM_FORMAT_UYVY:
index 3364eeb0ea07e4cdb99bfffca469cd3b92f6023f..b30deef9e39d1a5d91242836422219ae69b3f29a 100644 (file)
@@ -2483,6 +2483,8 @@ static const u32 icl_sdr_y_plane_formats[] = {
        DRM_FORMAT_ABGR8888,
        DRM_FORMAT_XRGB2101010,
        DRM_FORMAT_XBGR2101010,
+       DRM_FORMAT_ARGB2101010,
+       DRM_FORMAT_ABGR2101010,
        DRM_FORMAT_YUYV,
        DRM_FORMAT_YVYU,
        DRM_FORMAT_UYVY,
@@ -2504,6 +2506,8 @@ static const u32 icl_sdr_uv_plane_formats[] = {
        DRM_FORMAT_ABGR8888,
        DRM_FORMAT_XRGB2101010,
        DRM_FORMAT_XBGR2101010,
+       DRM_FORMAT_ARGB2101010,
+       DRM_FORMAT_ABGR2101010,
        DRM_FORMAT_YUYV,
        DRM_FORMAT_YVYU,
        DRM_FORMAT_UYVY,
@@ -2529,6 +2533,8 @@ static const u32 icl_hdr_plane_formats[] = {
        DRM_FORMAT_ABGR8888,
        DRM_FORMAT_XRGB2101010,
        DRM_FORMAT_XBGR2101010,
+       DRM_FORMAT_ARGB2101010,
+       DRM_FORMAT_ABGR2101010,
        DRM_FORMAT_XRGB16161616F,
        DRM_FORMAT_XBGR16161616F,
        DRM_FORMAT_ARGB16161616F,
@@ -2697,6 +2703,8 @@ static bool skl_plane_format_mod_supported(struct drm_plane *_plane,
        case DRM_FORMAT_RGB565:
        case DRM_FORMAT_XRGB2101010:
        case DRM_FORMAT_XBGR2101010:
+       case DRM_FORMAT_ARGB2101010:
+       case DRM_FORMAT_ABGR2101010:
        case DRM_FORMAT_YUYV:
        case DRM_FORMAT_YVYU:
        case DRM_FORMAT_UYVY:
@@ -2749,6 +2757,8 @@ static bool gen12_plane_format_mod_supported(struct drm_plane *_plane,
        case DRM_FORMAT_RGB565:
        case DRM_FORMAT_XRGB2101010:
        case DRM_FORMAT_XBGR2101010:
+       case DRM_FORMAT_ARGB2101010:
+       case DRM_FORMAT_ABGR2101010:
        case DRM_FORMAT_YUYV:
        case DRM_FORMAT_YVYU:
        case DRM_FORMAT_UYVY: