Skip to content

Commit 0c787d4

Browse files
committed
drm/i915: Enable 10bpc + CCS on ICL
ICL also supports compressed 10bpc scanout. Enable it. v2: Set .depth=30 for all variants to match drm_fourcc.c Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Juha-Pekka Heikkila <[email protected]>
1 parent c315fbf commit 0c787d4

File tree

2 files changed

+73
-0
lines changed

2 files changed

+73
-0
lines changed

drivers/gpu/drm/i915/display/intel_fb.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ static const struct drm_format_info skl_ccs_formats[] = {
4545
.cpp = { 4, 1, }, .hsub = 8, .vsub = 16, .has_alpha = true, },
4646
{ .format = DRM_FORMAT_ABGR8888, .depth = 32, .num_planes = 2,
4747
.cpp = { 4, 1, }, .hsub = 8, .vsub = 16, .has_alpha = true, },
48+
{ .format = DRM_FORMAT_XRGB2101010, .depth = 30, .num_planes = 2,
49+
.cpp = { 4, 1, }, .hsub = 8, .vsub = 16, },
50+
{ .format = DRM_FORMAT_XBGR2101010, .depth = 30, .num_planes = 2,
51+
.cpp = { 4, 1, }, .hsub = 8, .vsub = 16, },
52+
{ .format = DRM_FORMAT_ARGB2101010, .depth = 30, .num_planes = 2,
53+
.cpp = { 4, 1, }, .hsub = 8, .vsub = 16, .has_alpha = true, },
54+
{ .format = DRM_FORMAT_ABGR2101010, .depth = 30, .num_planes = 2,
55+
.cpp = { 4, 1, }, .hsub = 8, .vsub = 16, .has_alpha = true, },
4856
};
4957

5058
/*

drivers/gpu/drm/i915/display/skl_universal_plane.c

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2330,6 +2330,60 @@ static bool skl_plane_format_mod_supported(struct drm_plane *_plane,
23302330
}
23312331
}
23322332

2333+
static bool icl_plane_format_mod_supported(struct drm_plane *_plane,
2334+
u32 format, u64 modifier)
2335+
{
2336+
struct intel_plane *plane = to_intel_plane(_plane);
2337+
2338+
if (!intel_fb_plane_supports_modifier(plane, modifier))
2339+
return false;
2340+
2341+
switch (format) {
2342+
case DRM_FORMAT_XRGB8888:
2343+
case DRM_FORMAT_XBGR8888:
2344+
case DRM_FORMAT_ARGB8888:
2345+
case DRM_FORMAT_ABGR8888:
2346+
case DRM_FORMAT_XRGB2101010:
2347+
case DRM_FORMAT_XBGR2101010:
2348+
case DRM_FORMAT_ARGB2101010:
2349+
case DRM_FORMAT_ABGR2101010:
2350+
if (intel_fb_is_ccs_modifier(modifier))
2351+
return true;
2352+
fallthrough;
2353+
case DRM_FORMAT_RGB565:
2354+
case DRM_FORMAT_YUYV:
2355+
case DRM_FORMAT_YVYU:
2356+
case DRM_FORMAT_UYVY:
2357+
case DRM_FORMAT_VYUY:
2358+
case DRM_FORMAT_NV12:
2359+
case DRM_FORMAT_XYUV8888:
2360+
case DRM_FORMAT_P010:
2361+
case DRM_FORMAT_P012:
2362+
case DRM_FORMAT_P016:
2363+
case DRM_FORMAT_XVYU2101010:
2364+
if (modifier == I915_FORMAT_MOD_Yf_TILED)
2365+
return true;
2366+
fallthrough;
2367+
case DRM_FORMAT_C8:
2368+
case DRM_FORMAT_XBGR16161616F:
2369+
case DRM_FORMAT_ABGR16161616F:
2370+
case DRM_FORMAT_XRGB16161616F:
2371+
case DRM_FORMAT_ARGB16161616F:
2372+
case DRM_FORMAT_Y210:
2373+
case DRM_FORMAT_Y212:
2374+
case DRM_FORMAT_Y216:
2375+
case DRM_FORMAT_XVYU12_16161616:
2376+
case DRM_FORMAT_XVYU16161616:
2377+
if (modifier == DRM_FORMAT_MOD_LINEAR ||
2378+
modifier == I915_FORMAT_MOD_X_TILED ||
2379+
modifier == I915_FORMAT_MOD_Y_TILED)
2380+
return true;
2381+
fallthrough;
2382+
default:
2383+
return false;
2384+
}
2385+
}
2386+
23332387
static bool gen12_plane_format_mod_supported(struct drm_plane *_plane,
23342388
u32 format, u64 modifier)
23352389
{
@@ -2391,6 +2445,15 @@ static const struct drm_plane_funcs skl_plane_funcs = {
23912445
.format_mod_supported = skl_plane_format_mod_supported,
23922446
};
23932447

2448+
static const struct drm_plane_funcs icl_plane_funcs = {
2449+
.update_plane = drm_atomic_helper_update_plane,
2450+
.disable_plane = drm_atomic_helper_disable_plane,
2451+
.destroy = intel_plane_destroy,
2452+
.atomic_duplicate_state = intel_plane_duplicate_state,
2453+
.atomic_destroy_state = intel_plane_destroy_state,
2454+
.format_mod_supported = icl_plane_format_mod_supported,
2455+
};
2456+
23942457
static const struct drm_plane_funcs gen12_plane_funcs = {
23952458
.update_plane = drm_atomic_helper_update_plane,
23962459
.disable_plane = drm_atomic_helper_disable_plane,
@@ -2570,6 +2633,8 @@ skl_universal_plane_create(struct drm_i915_private *dev_priv,
25702633

25712634
if (DISPLAY_VER(dev_priv) >= 12)
25722635
plane_funcs = &gen12_plane_funcs;
2636+
else if (DISPLAY_VER(dev_priv) == 11)
2637+
plane_funcs = &icl_plane_funcs;
25732638
else
25742639
plane_funcs = &skl_plane_funcs;
25752640

0 commit comments

Comments
 (0)