gpu: ipu-v3: prg: add modifier support
authorLucas Stach <l.stach@pengutronix.de>
Fri, 10 Nov 2017 16:09:59 +0000 (17:09 +0100)
committerPhilipp Zabel <p.zabel@pengutronix.de>
Tue, 19 Dec 2017 11:49:11 +0000 (12:49 +0100)
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>
drivers/gpu/drm/imx/ipuv3-plane.c
drivers/gpu/ipu-v3/ipu-prg.c
include/video/imx-ipu-v3.h

index 247c60e6bed27a208599b12d018c3141a3995dee..091393cb96597d8a0f016b709e38683d8ef327e9 100644 (file)
@@ -550,8 +550,8 @@ static void ipu_plane_atomic_update(struct drm_plane *plane,
                ipu_prg_channel_configure(ipu_plane->ipu_ch, axi_id,
                                          drm_rect_width(&state->src) >> 16,
                                          drm_rect_height(&state->src) >> 16,
-                                         fb->pitches[0],
-                                         fb->format->format, &eba);
+                                         fb->pitches[0], fb->format->format,
+                                         0, &eba);
        }
 
        if (old_state->fb && !drm_atomic_crtc_needs_modeset(crtc_state)) {
index 1a4d3a635d1d21d3f5eac1408bbf7c9461f107fe..067365c733c63b257f3be41102d7f54354d52f18 100644 (file)
@@ -133,7 +133,14 @@ bool ipu_prg_format_supported(struct ipu_soc *ipu, uint32_t format,
        if (info->num_planes != 1)
                return false;
 
-       return true;
+       switch (modifier) {
+       case DRM_FORMAT_MOD_LINEAR:
+       case DRM_FORMAT_MOD_VIVANTE_TILED:
+       case DRM_FORMAT_MOD_VIVANTE_SUPER_TILED:
+               return true;
+       default:
+               return false;
+       }
 }
 EXPORT_SYMBOL_GPL(ipu_prg_format_supported);
 
@@ -266,7 +273,7 @@ EXPORT_SYMBOL_GPL(ipu_prg_channel_disable);
 int ipu_prg_channel_configure(struct ipuv3_channel *ipu_chan,
                              unsigned int axi_id, unsigned int width,
                              unsigned int height, unsigned int stride,
-                             u32 format, unsigned long *eba)
+                             u32 format, uint64_t modifier, unsigned long *eba)
 {
        int prg_chan = ipu_prg_ipu_to_prg_chan(ipu_chan->num);
        struct ipu_prg *prg = ipu_chan->ipu->prg_priv;
@@ -287,7 +294,7 @@ int ipu_prg_channel_configure(struct ipuv3_channel *ipu_chan,
                return ret;
 
        ipu_pre_configure(prg->pres[chan->used_pre],
-                         width, height, stride, format, 0, *eba);
+                         width, height, stride, format, modifier, *eba);
 
 
        pm_runtime_get_sync(prg->dev);
index ce4c07688b13d86b7d4dffc3b1db27a3406ef81c..abbad94e14a1021ed622ef428cbd5a6fee9ed86c 100644 (file)
@@ -344,7 +344,7 @@ void ipu_prg_channel_disable(struct ipuv3_channel *ipu_chan);
 int ipu_prg_channel_configure(struct ipuv3_channel *ipu_chan,
                              unsigned int axi_id,  unsigned int width,
                              unsigned int height, unsigned int stride,
-                             u32 format, unsigned long *eba);
+                             u32 format, uint64_t modifier, unsigned long *eba);
 
 /*
  * IPU CMOS Sensor Interface (csi) functions