diff options
author | Jernej Skrabec <jernej.skrabec@siol.net> | 2017-12-01 07:05:33 +0100 |
---|---|---|
committer | Maxime Ripard <maxime.ripard@free-electrons.com> | 2017-12-05 13:22:42 +0100 |
commit | f356fe8e0fb630b4b00c6207d5af53a5d1fab660 (patch) | |
tree | fd953f6a411c91af484342a455e24182b1d02ead /drivers/gpu/drm/sun4i/sun8i_layer.c | |
parent | 26264ceeb55617fe9ddee84d9dd98645f5f62d34 (diff) |
drm/sun4i: Start using layer id in DE2 driver
Till now, plane selection was hardcoded to first overlay in first UI
channel and layer parameter is unused.
Rename and add parameters to layer functions so they would represent HW
more accurately and start using then.
It turns out that overlays don't fit well in current DRM design, because
they can't be blended together or scaled independetly when they are set
to same channel. Because of that, always use only first overlay in each
channel.
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171201060550.10392-11-jernej.skrabec@siol.net
Diffstat (limited to 'drivers/gpu/drm/sun4i/sun8i_layer.c')
-rw-r--r-- | drivers/gpu/drm/sun4i/sun8i_layer.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/gpu/drm/sun4i/sun8i_layer.c b/drivers/gpu/drm/sun4i/sun8i_layer.c index 23810ff72684..5aa6e2c9728e 100644 --- a/drivers/gpu/drm/sun4i/sun8i_layer.c +++ b/drivers/gpu/drm/sun4i/sun8i_layer.c @@ -32,7 +32,8 @@ static void sun8i_mixer_layer_atomic_disable(struct drm_plane *plane, struct sun8i_layer *layer = plane_to_sun8i_layer(plane); struct sun8i_mixer *mixer = layer->mixer; - sun8i_mixer_layer_enable(mixer, layer->id, false); + sun8i_mixer_layer_enable(mixer, layer->channel, + layer->overlay, false); } static void sun8i_mixer_layer_atomic_update(struct drm_plane *plane, @@ -41,10 +42,14 @@ static void sun8i_mixer_layer_atomic_update(struct drm_plane *plane, struct sun8i_layer *layer = plane_to_sun8i_layer(plane); struct sun8i_mixer *mixer = layer->mixer; - sun8i_mixer_update_layer_coord(mixer, layer->id, plane); - sun8i_mixer_update_layer_formats(mixer, layer->id, plane); - sun8i_mixer_update_layer_buffer(mixer, layer->id, plane); - sun8i_mixer_layer_enable(mixer, layer->id, true); + sun8i_mixer_update_layer_coord(mixer, layer->channel, + layer->overlay, plane); + sun8i_mixer_update_layer_formats(mixer, layer->channel, + layer->overlay, plane); + sun8i_mixer_update_layer_buffer(mixer, layer->channel, + layer->overlay, plane); + sun8i_mixer_layer_enable(mixer, layer->channel, + layer->overlay, true); } static struct drm_plane_helper_funcs sun8i_mixer_layer_helper_funcs = { @@ -126,7 +131,8 @@ struct drm_plane **sun8i_layers_init(struct drm_device *drm, return ERR_CAST(layer); }; - layer->id = i; + layer->channel = mixer->cfg->vi_num + i; + layer->overlay = 0; planes[i] = &layer->plane; }; |