diff --git a/src/amd/vpelib/inc/vpe_types.h b/src/amd/vpelib/inc/vpe_types.h index 363f2a02ead..d6d1f096a24 100644 --- a/src/amd/vpelib/inc/vpe_types.h +++ b/src/amd/vpelib/inc/vpe_types.h @@ -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 */ diff --git a/src/amd/vpelib/src/chip/vpe10/inc/vpe10_vpec.h b/src/amd/vpelib/src/chip/vpe10/inc/vpe10_vpec.h index 06d127c6f5d..e50c5c7e85b 100644 --- a/src/amd/vpelib/src/chip/vpe10/inc/vpe10_vpec.h +++ b/src/amd/vpelib/src/chip/vpe10/inc/vpe10_vpec.h @@ -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 */ diff --git a/src/amd/vpelib/src/chip/vpe10/vpe10_vpec.c b/src/amd/vpelib/src/chip/vpe10/vpe10_vpec.c index 99f8f9328f1..49be35f0b29 100644 --- a/src/amd/vpelib/src/chip/vpe10/vpe10_vpec.c +++ b/src/amd/vpelib/src/chip/vpe10/vpe10_vpec.c @@ -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: diff --git a/src/amd/vpelib/src/core/common.c b/src/amd/vpelib/src/core/common.c index 4e23c71a17c..38c9f142d51 100644 --- a/src/amd/vpelib/src/core/common.c +++ b/src/amd/vpelib/src/core/common.c @@ -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; diff --git a/src/amd/vpelib/src/core/inc/vpec.h b/src/amd/vpelib/src/core/inc/vpec.h index c335c863e10..a73f0a1bf29 100644 --- a/src/amd/vpelib/src/core/inc/vpec.h +++ b/src/amd/vpelib/src/core/inc/vpec.h @@ -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 {