Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Lucas Stach and committed by
Philipp Zabel
a2ceec52 2f64a554

+13 -6
+2 -2
drivers/gpu/drm/imx/ipuv3-plane.c
··· 550 550 ipu_prg_channel_configure(ipu_plane->ipu_ch, axi_id, 551 551 drm_rect_width(&state->src) >> 16, 552 552 drm_rect_height(&state->src) >> 16, 553 - fb->pitches[0], 554 - fb->format->format, &eba); 553 + fb->pitches[0], fb->format->format, 554 + 0, &eba); 555 555 } 556 556 557 557 if (old_state->fb && !drm_atomic_crtc_needs_modeset(crtc_state)) {
+10 -3
drivers/gpu/ipu-v3/ipu-prg.c
··· 133 133 if (info->num_planes != 1) 134 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 145 EXPORT_SYMBOL_GPL(ipu_prg_format_supported); 139 146 ··· 273 266 int ipu_prg_channel_configure(struct ipuv3_channel *ipu_chan, 274 267 unsigned int axi_id, unsigned int width, 275 268 unsigned int height, unsigned int stride, 276 - u32 format, unsigned long *eba) 269 + u32 format, uint64_t modifier, unsigned long *eba) 277 270 { 278 271 int prg_chan = ipu_prg_ipu_to_prg_chan(ipu_chan->num); 279 272 struct ipu_prg *prg = ipu_chan->ipu->prg_priv; ··· 294 287 return ret; 295 288 296 289 ipu_pre_configure(prg->pres[chan->used_pre], 297 - width, height, stride, format, 0, *eba); 290 + width, height, stride, format, modifier, *eba); 298 291 299 292 300 293 pm_runtime_get_sync(prg->dev);
+1 -1
include/video/imx-ipu-v3.h
··· 344 344 int ipu_prg_channel_configure(struct ipuv3_channel *ipu_chan, 345 345 unsigned int axi_id, unsigned int width, 346 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 350 * IPU CMOS Sensor Interface (csi) functions