diff options
author | Lucas Stach <l.stach@pengutronix.de> | 2017-11-10 11:09:59 -0500 |
---|---|---|
committer | Philipp Zabel <p.zabel@pengutronix.de> | 2017-12-19 06:49:11 -0500 |
commit | a2ceec52d9a48bd046e5496e266dda1c57872f4b (patch) | |
tree | 4cc2831f0045786572ec927b97ede1c184faf4ba | |
parent | 2f64a554435da851a9593115b96bdc67e455047a (diff) |
gpu: ipu-v3: prg: add modifier support
Allow to pass through the modifier to the PRE unit and extend the
format check with the supported modifiers.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
-rw-r--r-- | drivers/gpu/drm/imx/ipuv3-plane.c | 4 | ||||
-rw-r--r-- | drivers/gpu/ipu-v3/ipu-prg.c | 13 | ||||
-rw-r--r-- | include/video/imx-ipu-v3.h | 2 |
3 files changed, 13 insertions, 6 deletions
diff --git a/drivers/gpu/drm/imx/ipuv3-plane.c b/drivers/gpu/drm/imx/ipuv3-plane.c index 247c60e6bed2..091393cb9659 100644 --- a/drivers/gpu/drm/imx/ipuv3-plane.c +++ b/drivers/gpu/drm/imx/ipuv3-plane.c | |||
@@ -550,8 +550,8 @@ static void ipu_plane_atomic_update(struct drm_plane *plane, | |||
550 | ipu_prg_channel_configure(ipu_plane->ipu_ch, axi_id, | 550 | ipu_prg_channel_configure(ipu_plane->ipu_ch, axi_id, |
551 | drm_rect_width(&state->src) >> 16, | 551 | drm_rect_width(&state->src) >> 16, |
552 | drm_rect_height(&state->src) >> 16, | 552 | drm_rect_height(&state->src) >> 16, |
553 | fb->pitches[0], | 553 | fb->pitches[0], fb->format->format, |
554 | fb->format->format, &eba); | 554 | 0, &eba); |
555 | } | 555 | } |
556 | 556 | ||
557 | if (old_state->fb && !drm_atomic_crtc_needs_modeset(crtc_state)) { | 557 | if (old_state->fb && !drm_atomic_crtc_needs_modeset(crtc_state)) { |
diff --git a/drivers/gpu/ipu-v3/ipu-prg.c b/drivers/gpu/ipu-v3/ipu-prg.c index 1a4d3a635d1d..067365c733c6 100644 --- a/drivers/gpu/ipu-v3/ipu-prg.c +++ b/drivers/gpu/ipu-v3/ipu-prg.c | |||
@@ -133,7 +133,14 @@ bool ipu_prg_format_supported(struct ipu_soc *ipu, uint32_t format, | |||
133 | if (info->num_planes != 1) | 133 | if (info->num_planes != 1) |
134 | return false; | 134 | return false; |
135 | 135 | ||
136 | return true; | 136 | switch (modifier) { |
137 | case DRM_FORMAT_MOD_LINEAR: | ||
138 | case DRM_FORMAT_MOD_VIVANTE_TILED: | ||
139 | case DRM_FORMAT_MOD_VIVANTE_SUPER_TILED: | ||
140 | return true; | ||
141 | default: | ||
142 | return false; | ||
143 | } | ||
137 | } | 144 | } |
138 | EXPORT_SYMBOL_GPL(ipu_prg_format_supported); | 145 | EXPORT_SYMBOL_GPL(ipu_prg_format_supported); |
139 | 146 | ||
@@ -266,7 +273,7 @@ EXPORT_SYMBOL_GPL(ipu_prg_channel_disable); | |||
266 | int ipu_prg_channel_configure(struct ipuv3_channel *ipu_chan, | 273 | int ipu_prg_channel_configure(struct ipuv3_channel *ipu_chan, |
267 | unsigned int axi_id, unsigned int width, | 274 | unsigned int axi_id, unsigned int width, |
268 | unsigned int height, unsigned int stride, | 275 | unsigned int height, unsigned int stride, |
269 | u32 format, unsigned long *eba) | 276 | u32 format, uint64_t modifier, unsigned long *eba) |
270 | { | 277 | { |
271 | int prg_chan = ipu_prg_ipu_to_prg_chan(ipu_chan->num); | 278 | int prg_chan = ipu_prg_ipu_to_prg_chan(ipu_chan->num); |
272 | struct ipu_prg *prg = ipu_chan->ipu->prg_priv; | 279 | struct ipu_prg *prg = ipu_chan->ipu->prg_priv; |
@@ -287,7 +294,7 @@ int ipu_prg_channel_configure(struct ipuv3_channel *ipu_chan, | |||
287 | return ret; | 294 | return ret; |
288 | 295 | ||
289 | ipu_pre_configure(prg->pres[chan->used_pre], | 296 | ipu_pre_configure(prg->pres[chan->used_pre], |
290 | width, height, stride, format, 0, *eba); | 297 | width, height, stride, format, modifier, *eba); |
291 | 298 | ||
292 | 299 | ||
293 | pm_runtime_get_sync(prg->dev); | 300 | pm_runtime_get_sync(prg->dev); |
diff --git a/include/video/imx-ipu-v3.h b/include/video/imx-ipu-v3.h index ce4c07688b13..abbad94e14a1 100644 --- a/include/video/imx-ipu-v3.h +++ b/include/video/imx-ipu-v3.h | |||
@@ -344,7 +344,7 @@ void ipu_prg_channel_disable(struct ipuv3_channel *ipu_chan); | |||
344 | int ipu_prg_channel_configure(struct ipuv3_channel *ipu_chan, | 344 | int ipu_prg_channel_configure(struct ipuv3_channel *ipu_chan, |
345 | unsigned int axi_id, unsigned int width, | 345 | unsigned int axi_id, unsigned int width, |
346 | unsigned int height, unsigned int stride, | 346 | unsigned int height, unsigned int stride, |
347 | u32 format, unsigned long *eba); | 347 | u32 format, uint64_t modifier, unsigned long *eba); |
348 | 348 | ||
349 | /* | 349 | /* |
350 | * IPU CMOS Sensor Interface (csi) functions | 350 | * IPU CMOS Sensor Interface (csi) functions |