i915: Choose TILE_4 vs TILE_Y at runtime
For all current ChromeOS boards, MTL and older, this patch should change
no behavior. It's just a refactor.
Do not choose at buildtime based on macro definitions. Decisions about
scanout-capable modifiers should be decided at runtime based on chipset
info.
We can safely delete the #ifdef blocks for I915_SCANOUT_4_TILED and
I915_SCANOUT_Y_TILED without changing any behavior. They were controlled
by the ebuild snippet below, and the USE flag is set if and only if
chipset >= MTL.
if use intel_drm_tile4 ; then
append-cppflags -DI915_SCANOUT_4_TILED
else
append-cppflags -DI915_SCANOUT_Y_TILED
fi
I tested the patch on rex (MTL) and brya (ADL), which pre-patch took
different #ifdef paths. Before and after the patch, On MTL, I confirmed
that fullscreen video from https://crosvideo.appspot.com/?codec=h264 was
promoted to a scanout plane with the expected pixel format and modifier:
I915_FORMAT_MOD_4_TILED + DRM_FORMAT_NV12. On ADL, I confirmed the same
for I915_FORMAT_MOD_Y_TILED + DRM_FORMAT_NV12. I confirmed by inspecting
/sys/kernel/debug/dri/0/state during video playback.
BUG=b:349135555
TEST=brya, rex. Confirm fullscreen h264 video gets promoted to scanout
plane with correct pixel format and modifier. See commit message.
Change-Id: I1c5155548287869279fec3aa0b02e057acc788fa
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/6082999
Reviewed-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Marcin Wojtas <mwojtas@google.com>
Tested-by: Lina Versace <linyaa@google.com>
Commit-Queue: ChromeOS Auto Retry <chromeos-auto-retry@chromeos-bot.iam.gserviceaccount.com>
Auto-Submit: Lina Versace <linyaa@google.com>
This commit is contained in:
parent
993130c58e
commit
ad29efaa71
1 changed files with 6 additions and 21 deletions
27
i915.c
27
i915.c
|
|
@ -283,20 +283,16 @@ static int i915_add_combinations(struct driver *drv)
|
|||
drv_add_combinations(drv, scanout_render_formats, ARRAY_SIZE(scanout_render_formats),
|
||||
&metadata_x_tiled, scanout_and_render_not_linear);
|
||||
|
||||
const uint64_t nv12_usage =
|
||||
BO_USE_TEXTURE | BO_USE_HW_VIDEO_DECODER | BO_USE_SCANOUT | hw_protected;
|
||||
const uint64_t p010_usage = BO_USE_TEXTURE | BO_USE_HW_VIDEO_DECODER | hw_protected |
|
||||
(i915->graphics_version >= 11 ? BO_USE_SCANOUT : 0);
|
||||
|
||||
if (i915->is_mtl) {
|
||||
struct format_metadata metadata_4_tiled = { .tiling = I915_TILING_4,
|
||||
.priority = 3,
|
||||
.modifier = I915_FORMAT_MOD_4_TILED };
|
||||
/* Support tile4 NV12 and P010 for libva */
|
||||
#ifdef I915_SCANOUT_4_TILED
|
||||
const uint64_t nv12_usage =
|
||||
BO_USE_TEXTURE | BO_USE_HW_VIDEO_DECODER | BO_USE_SCANOUT | hw_protected;
|
||||
const uint64_t p010_usage =
|
||||
BO_USE_TEXTURE | BO_USE_HW_VIDEO_DECODER | hw_protected | BO_USE_SCANOUT;
|
||||
#else
|
||||
const uint64_t nv12_usage = BO_USE_TEXTURE | BO_USE_HW_VIDEO_DECODER;
|
||||
const uint64_t p010_usage = nv12_usage;
|
||||
#endif
|
||||
|
||||
drv_add_combination(drv, DRM_FORMAT_NV12, &metadata_4_tiled, nv12_usage);
|
||||
drv_add_combination(drv, DRM_FORMAT_P010, &metadata_4_tiled, p010_usage);
|
||||
drv_add_combinations(drv, render_formats, ARRAY_SIZE(render_formats),
|
||||
|
|
@ -309,17 +305,6 @@ static int i915_add_combinations(struct driver *drv)
|
|||
.priority = 3,
|
||||
.modifier = I915_FORMAT_MOD_Y_TILED };
|
||||
|
||||
/* Support y-tiled NV12 and P010 for libva */
|
||||
#ifdef I915_SCANOUT_Y_TILED
|
||||
const uint64_t nv12_usage =
|
||||
BO_USE_TEXTURE | BO_USE_HW_VIDEO_DECODER | BO_USE_SCANOUT | hw_protected;
|
||||
const uint64_t p010_usage = BO_USE_TEXTURE | BO_USE_HW_VIDEO_DECODER |
|
||||
hw_protected |
|
||||
(i915->graphics_version >= 11 ? BO_USE_SCANOUT : 0);
|
||||
#else
|
||||
const uint64_t nv12_usage = BO_USE_TEXTURE | BO_USE_HW_VIDEO_DECODER;
|
||||
const uint64_t p010_usage = nv12_usage;
|
||||
#endif
|
||||
drv_add_combinations(drv, render_formats, ARRAY_SIZE(render_formats),
|
||||
&metadata_y_tiled, render_not_linear);
|
||||
/* Y-tiled scanout isn't available on old platforms so we add
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue