mirror of
https://github.com/revyos/thead-kernel.git
synced 2026-06-21 09:12:26 +02:00
drm/verisilicon: add format_mod_supported to plane
Otherwise IN_FORMATS blob is corrupted. Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
This commit is contained in:
committed by
Han Gao/Revy/Rabenda
parent
833d4accd7
commit
90bcc90cb8
@@ -193,6 +193,27 @@ static int vs_plane_atomic_get_property(struct drm_plane *plane,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool vs_plane_format_mod_supported(struct drm_plane *plane,
|
||||
uint32_t format,
|
||||
uint64_t modifier)
|
||||
{
|
||||
struct vs_plane *vs_plane = to_vs_plane(plane);
|
||||
int i;
|
||||
|
||||
for(i = 0; i < vs_plane->info->num_modifiers; i++) {
|
||||
if (vs_plane->info->modifiers[i] == modifier)
|
||||
break;
|
||||
}
|
||||
if (i && i == vs_plane->info->num_modifiers)
|
||||
return false;
|
||||
|
||||
for(i = 0; i < vs_plane->info->num_formats; i++) {
|
||||
if (vs_plane->info->formats[i] == format)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
const struct drm_plane_funcs vs_plane_funcs = {
|
||||
.update_plane = drm_atomic_helper_update_plane,
|
||||
.disable_plane = drm_atomic_helper_disable_plane,
|
||||
@@ -202,6 +223,7 @@ const struct drm_plane_funcs vs_plane_funcs = {
|
||||
.atomic_destroy_state = vs_plane_atomic_destroy_state,
|
||||
.atomic_set_property = vs_plane_atomic_set_property,
|
||||
.atomic_get_property = vs_plane_atomic_get_property,
|
||||
.format_mod_supported = vs_plane_format_mod_supported,
|
||||
};
|
||||
|
||||
static unsigned char vs_get_plane_number(struct drm_framebuffer *fb)
|
||||
@@ -300,6 +322,8 @@ struct vs_plane *vs_plane_create(struct drm_device *drm_dev,
|
||||
if (!plane)
|
||||
return NULL;
|
||||
|
||||
plane->info = info;
|
||||
|
||||
ret = drm_universal_plane_init(drm_dev, &plane->base, possible_crtcs,
|
||||
&vs_plane_funcs, info->formats,
|
||||
info->num_formats, info->modifiers, info->type,
|
||||
|
||||
@@ -47,6 +47,7 @@ struct vs_plane {
|
||||
struct drm_plane base;
|
||||
u8 id;
|
||||
dma_addr_t dma_addr[MAX_NUM_PLANES];
|
||||
struct vs_plane_info *info;
|
||||
|
||||
struct drm_property *degamma_mode;
|
||||
struct drm_property *watermark_prop;
|
||||
|
||||
Reference in New Issue
Block a user