Skip to content

Commit

Permalink
drm/sun4i: frontend: Determine input mode based on the number of planes
Browse files Browse the repository at this point in the history
Use the number of planes associated with the DRM format to determine the
input mode configuration instead of the format iteself. This way, the
helper can be used for all packed formats without future changes.

Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181123092515.2511-20-paul.kocialkowski@bootlin.com
  • Loading branch information
Paul Kocialkowski authored and Maxime Ripard committed Nov 27, 2018
1 parent 9579f91 commit ae4ba19
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions drivers/gpu/drm/sun4i/sun4i_frontend.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,12 @@ static int sun4i_frontend_drm_format_to_input_fmt(uint32_t fmt, u32 *val)

static int sun4i_frontend_drm_format_to_input_mode(uint32_t fmt, u32 *val)
{
switch (fmt) {
case DRM_FORMAT_XRGB8888:
if (drm_format_num_planes(fmt) == 1)
*val = SUN4I_FRONTEND_INPUT_FMT_DATA_MOD_PACKED;
return 0;

default:
else
return -EINVAL;
}

return 0;
}

static int sun4i_frontend_drm_format_to_input_sequence(uint32_t fmt, u32 *val)
Expand Down

0 comments on commit ae4ba19

Please sign in to comment.