amd/vpelib: Augment swizzling modes

[WHY]
Support different generations of swizzle mode.

[HOW]
Added different swizzle mode parameters for supporting plane
description.

Acked-by: Chuanyu Tseng <Chuanyu.Tseng@amd.com>
Signed-off-by: Ricky Lin <Ricky.Lin@amdeng@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39848>
This commit is contained in:
Lin, Ricky 2025-10-02 14:26:07 +08:00 committed by Marge Bot
parent f3db1d5f46
commit dbff0fabf0
5 changed files with 17 additions and 9 deletions

View file

@ -653,7 +653,9 @@ struct vpe_color_adjust {
struct vpe_surface_info {
struct vpe_plane_address address; /**< Address */
enum vpe_swizzle_mode_values swizzle; /**< Swizzle mode */
union {
enum vpe_swizzle_mode_values swizzle; /**< Swizzle mode */
};
struct vpe_plane_size plane_size; /**< Pitch */
struct vpe_plane_dcc_param dcc; /**< DCC parameters */

View file

@ -1,4 +1,4 @@
/* Copyright 2022 Advanced Micro Devices, Inc.
/* Copyright 2025 Advanced Micro Devices, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@ -32,7 +32,8 @@ extern "C" {
void vpe10_construct_vpec(struct vpe_priv *vpe_priv, struct vpec *vpec);
/** functions for capability check */
bool vpe10_vpec_check_swmode_support(struct vpec *vpec, enum vpe_swizzle_mode_values sw_mode);
bool vpe10_vpec_check_swmode_support(
struct vpec *vpec, const struct vpe_surface_info *surface_info);
/** functions for generating command buffer */

View file

@ -1,4 +1,4 @@
/* Copyright 2022 Advanced Micro Devices, Inc.
/* Copyright 2022-2025 Advanced Micro Devices, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@ -25,7 +25,8 @@
#include "vpe10_vpec.h"
static struct vpec_funcs vpec_funcs = {
.check_swmode_support = vpe10_vpec_check_swmode_support,
.check_input_swmode_support = vpe10_vpec_check_swmode_support,
.check_output_swmode_support = vpe10_vpec_check_swmode_support,
};
void vpe10_construct_vpec(struct vpe_priv *vpe_priv, struct vpec *vpec)
@ -35,8 +36,9 @@ void vpe10_construct_vpec(struct vpe_priv *vpe_priv, struct vpec *vpec)
}
/** functions for capability check */
bool vpe10_vpec_check_swmode_support(struct vpec *vpec, enum vpe_swizzle_mode_values sw_mode)
bool vpe10_vpec_check_swmode_support(struct vpec *vpec, const struct vpe_surface_info *surface_info)
{
uint32_t sw_mode = surface_info->swizzle;
switch (sw_mode) {
case VPE_SW_LINEAR:
case VPE_SW_256B_D:

View file

@ -374,7 +374,7 @@ enum vpe_status vpe_check_output_support(struct vpe *vpe, const struct vpe_build
cdc_be = vpe_priv->resource.cdc_be[0];
// swizzle mode
support = vpec->funcs->check_swmode_support(vpec, surface_info->swizzle);
support = vpec->funcs->check_output_swmode_support(vpec, surface_info);
if (!support) {
vpe_log("output swizzle mode not supported %d\n", surface_info->swizzle);
return VPE_STATUS_SWIZZLE_NOT_SUPPORTED;
@ -478,7 +478,7 @@ enum vpe_status vpe_check_input_support(struct vpe *vpe, const struct vpe_stream
cdc_fe = vpe_priv->resource.cdc_fe[0];
// swizzle mode
support = vpec->funcs->check_swmode_support(vpec, surface_info->swizzle);
support = vpec->funcs->check_input_swmode_support(vpec, surface_info);
if (!support) {
vpe_log("input swizzle mode not supported %d\n", surface_info->swizzle);
return VPE_STATUS_SWIZZLE_NOT_SUPPORTED;

View file

@ -35,7 +35,10 @@ struct vpe_priv;
struct vpec_funcs {
/** functions for capability check */
bool (*check_swmode_support)(struct vpec *vpec, enum vpe_swizzle_mode_values sw_mode);
bool (*check_input_swmode_support)(
struct vpec *vpec, const struct vpe_surface_info *surface_info);
bool (*check_output_swmode_support)(
struct vpec *vpec, const struct vpe_surface_info *surface_info);
};
struct vpec {