mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 09:38:07 +02:00
iris: Simplify get_main_plane_for_plane
Dropping the mod_info parameter simplifies a future commit. Reviewed-by: Jianxun Zhang <jianxun.zhang@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25768>
This commit is contained in:
parent
d9ba75e2e1
commit
79222e5884
1 changed files with 2 additions and 15 deletions
|
|
@ -1418,23 +1418,10 @@ get_num_planes(const struct pipe_resource *resource)
|
||||||
|
|
||||||
static unsigned
|
static unsigned
|
||||||
get_main_plane_for_plane(enum pipe_format format,
|
get_main_plane_for_plane(enum pipe_format format,
|
||||||
const struct isl_drm_modifier_info *mod_info,
|
|
||||||
unsigned plane)
|
unsigned plane)
|
||||||
{
|
{
|
||||||
unsigned int n_planes = util_format_get_num_planes(format);
|
unsigned int n_planes = util_format_get_num_planes(format);
|
||||||
|
return plane % n_planes;
|
||||||
if (n_planes == 1)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (!mod_info)
|
|
||||||
return plane;
|
|
||||||
|
|
||||||
if (mod_info->supports_media_compression) {
|
|
||||||
return plane % n_planes;
|
|
||||||
} else {
|
|
||||||
assert(!mod_info->supports_render_compression);
|
|
||||||
return plane;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct pipe_resource *
|
static struct pipe_resource *
|
||||||
|
|
@ -1794,7 +1781,7 @@ iris_resource_get_param(struct pipe_screen *pscreen,
|
||||||
struct iris_screen *screen = (struct iris_screen *)pscreen;
|
struct iris_screen *screen = (struct iris_screen *)pscreen;
|
||||||
struct iris_resource *base_res = (struct iris_resource *)resource;
|
struct iris_resource *base_res = (struct iris_resource *)resource;
|
||||||
unsigned main_plane = get_main_plane_for_plane(base_res->external_format,
|
unsigned main_plane = get_main_plane_for_plane(base_res->external_format,
|
||||||
base_res->mod_info, plane);
|
plane);
|
||||||
struct iris_resource *res =
|
struct iris_resource *res =
|
||||||
(struct iris_resource *)util_resource_at_index(resource, main_plane);
|
(struct iris_resource *)util_resource_at_index(resource, main_plane);
|
||||||
assert(res);
|
assert(res);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue