]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915/fb: Rename i915_color_plane_view::stride to mapping_stride
authorImre Deak <imre.deak@intel.com>
Tue, 26 Oct 2021 22:51:03 +0000 (01:51 +0300)
committerImre Deak <imre.deak@intel.com>
Tue, 2 Nov 2021 16:07:52 +0000 (18:07 +0200)
The next patch needs to distinguish between a view's mapping and scanout
stride. Rename the current stride parameter to mapping_stride with the
script below. mapping_stride will keep the same meaning as stride had
on all platforms so far, while the meaning of it will change on ADLP.

No functional changes.

@@
identifier intel_fb_view;
identifier i915_color_plane_view;
identifier color_plane;
expression e;
type T;
@@
struct intel_fb_view {
...
struct i915_color_plane_view {
...
- T stride;
+ T mapping_stride;
...
} color_plane[e];
...
};

@@
struct i915_color_plane_view pv;
@@
  pv.
-    stride
+    mapping_stride

@@
struct i915_color_plane_view *pvp;
@@
  pvp->
-     stride
+     mapping_stride

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211026225105.2783797-6-imre.deak@intel.com
drivers/gpu/drm/i915/display/i9xx_plane.c
drivers/gpu/drm/i915/display/intel_cursor.c
drivers/gpu/drm/i915/display/intel_display.c
drivers/gpu/drm/i915/display/intel_display_types.h
drivers/gpu/drm/i915/display/intel_fb.c
drivers/gpu/drm/i915/display/intel_fbc.c
drivers/gpu/drm/i915/display/intel_sprite.c
drivers/gpu/drm/i915/display/skl_universal_plane.c

index 2e16a66e8f9e7efd2997848b19ddbcae0498b0f6..c8722771aa4069eda1772313a850ff90aa06f243 100644 (file)
@@ -256,7 +256,7 @@ int i9xx_check_plane_surface(struct intel_plane_state *plane_state)
                u32 alignment = intel_surf_alignment(fb, 0);
                int cpp = fb->format->cpp[0];
 
-               while ((src_x + src_w) * cpp > plane_state->view.color_plane[0].stride) {
+               while ((src_x + src_w) * cpp > plane_state->view.color_plane[0].mapping_stride) {
                        if (offset == 0) {
                                drm_dbg_kms(&dev_priv->drm,
                                            "Unable to find suitable display surface offset due to X-tiling\n");
@@ -431,7 +431,7 @@ static void i9xx_update_plane(struct intel_plane *plane,
        spin_lock_irqsave(&dev_priv->uncore.lock, irqflags);
 
        intel_de_write_fw(dev_priv, DSPSTRIDE(i9xx_plane),
-                         plane_state->view.color_plane[0].stride);
+                         plane_state->view.color_plane[0].mapping_stride);
 
        if (DISPLAY_VER(dev_priv) < 4) {
                /*
index 5ddd3c8fbc63494af526a8db66a6cc0eacd49bb2..e069a3fb8b995f61e2d0fcd87c7942356729657f 100644 (file)
@@ -190,7 +190,7 @@ static u32 i845_cursor_ctl(const struct intel_crtc_state *crtc_state,
 {
        return CURSOR_ENABLE |
                CURSOR_FORMAT_ARGB |
-               CURSOR_STRIDE(plane_state->view.color_plane[0].stride);
+               CURSOR_STRIDE(plane_state->view.color_plane[0].mapping_stride);
 }
 
 static bool i845_cursor_size_ok(const struct intel_plane_state *plane_state)
@@ -229,7 +229,7 @@ static int i845_check_cursor(struct intel_crtc_state *crtc_state,
        }
 
        drm_WARN_ON(&i915->drm, plane_state->uapi.visible &&
-                   plane_state->view.color_plane[0].stride != fb->pitches[0]);
+                   plane_state->view.color_plane[0].mapping_stride != fb->pitches[0]);
 
        switch (fb->pitches[0]) {
        case 256:
@@ -450,7 +450,7 @@ static int i9xx_check_cursor(struct intel_crtc_state *crtc_state,
        }
 
        drm_WARN_ON(&dev_priv->drm, plane_state->uapi.visible &&
-                   plane_state->view.color_plane[0].stride != fb->pitches[0]);
+                   plane_state->view.color_plane[0].mapping_stride != fb->pitches[0]);
 
        if (fb->pitches[0] !=
            drm_rect_width(&plane_state->uapi.dst) * fb->format->cpp[0]) {
index cad8998e685366cab9a13a34929ddaa2c69ca6aa..29392dfc46c8d43ed1bd1160790433e1db35cf70 100644 (file)
@@ -661,7 +661,7 @@ u32 intel_fb_xy_to_linear(int x, int y,
 {
        const struct drm_framebuffer *fb = state->hw.fb;
        unsigned int cpp = fb->format->cpp[color_plane];
-       unsigned int pitch = state->view.color_plane[color_plane].stride;
+       unsigned int pitch = state->view.color_plane[color_plane].mapping_stride;
 
        return y * pitch + x * cpp;
 }
@@ -7775,8 +7775,8 @@ static int intel_atomic_check_async(struct intel_atomic_state *state, struct int
                        return -EINVAL;
                }
 
-               if (old_plane_state->view.color_plane[0].stride !=
-                   new_plane_state->view.color_plane[0].stride) {
+               if (old_plane_state->view.color_plane[0].mapping_stride !=
+                   new_plane_state->view.color_plane[0].mapping_stride) {
                        drm_dbg_kms(&i915->drm, "Stride cannot be changed in async flip\n");
                        return -EINVAL;
                }
index 991972da070380bdc729e74f50bca18324a18e9d..1107cbd93260d80e36c5aab449c2cef307ba398c 100644 (file)
@@ -115,7 +115,7 @@ struct intel_fb_view {
                 *   bytes for 0/180 degree rotation
                 *   pixels for 90/270 degree rotation
                 */
-               unsigned int stride;
+               unsigned int mapping_stride;
        } color_plane[4];
 };
 
index ded1f74f611c5c0dce2deecf594e3290c493fe90..e0414fb4b0369569009e035c9d8e51edcfa91c1c 100644 (file)
@@ -915,7 +915,7 @@ u32 intel_plane_adjust_aligned_offset(int *x, int *y,
 {
        return intel_adjust_aligned_offset(x, y, state->hw.fb, color_plane,
                                           state->hw.rotation,
-                                          state->view.color_plane[color_plane].stride,
+                                          state->view.color_plane[color_plane].mapping_stride,
                                           old_offset, new_offset);
 }
 
@@ -996,7 +996,7 @@ u32 intel_plane_compute_aligned_offset(int *x, int *y,
        struct drm_i915_private *i915 = to_i915(intel_plane->base.dev);
        const struct drm_framebuffer *fb = state->hw.fb;
        unsigned int rotation = state->hw.rotation;
-       int pitch = state->view.color_plane[color_plane].stride;
+       int pitch = state->view.color_plane[color_plane].mapping_stride;
        u32 alignment;
 
        if (intel_plane->id == PLANE_CURSOR)
@@ -1155,11 +1155,11 @@ bool intel_fb_needs_pot_stride_remap(const struct intel_framebuffer *fb)
 static int intel_fb_pitch(const struct intel_framebuffer *fb, int color_plane, unsigned int rotation)
 {
        if (drm_rotation_90_or_270(rotation))
-               return fb->rotated_view.color_plane[color_plane].stride;
+               return fb->rotated_view.color_plane[color_plane].mapping_stride;
        else if (intel_fb_needs_pot_stride_remap(fb))
-               return fb->remapped_view.color_plane[color_plane].stride;
+               return fb->remapped_view.color_plane[color_plane].mapping_stride;
        else
-               return fb->normal_view.color_plane[color_plane].stride;
+               return fb->normal_view.color_plane[color_plane].mapping_stride;
 }
 
 static bool intel_plane_needs_remap(const struct intel_plane_state *plane_state)
@@ -1370,7 +1370,7 @@ static u32 calc_plane_remap_info(const struct intel_framebuffer *fb, int color_p
                color_plane_info->x = r.x1;
                color_plane_info->y = r.y1;
 
-               color_plane_info->stride = remap_info->dst_stride * tile_height;
+               color_plane_info->mapping_stride = remap_info->dst_stride * tile_height;
 
                size += remap_info->dst_stride * remap_info->width;
 
@@ -1393,7 +1393,7 @@ static u32 calc_plane_remap_info(const struct intel_framebuffer *fb, int color_p
                color_plane_info->y = y;
 
                if (remap_info->linear) {
-                       color_plane_info->stride = fb->base.pitches[color_plane];
+                       color_plane_info->mapping_stride = fb->base.pitches[color_plane];
 
                        size += remap_info->size;
                } else {
@@ -1401,8 +1401,9 @@ static u32 calc_plane_remap_info(const struct intel_framebuffer *fb, int color_p
                                                                              remap_info->width);
 
                        assign_chk_ovf(i915, remap_info->dst_stride, dst_stride);
-                       color_plane_info->stride = dst_stride *
-                                                  tile_width * fb->base.format->cpp[color_plane];
+                       color_plane_info->mapping_stride = dst_stride *
+                                                          tile_width *
+                                                          fb->base.format->cpp[color_plane];
 
                        size += dst_stride * remap_info->height;
                }
@@ -1416,7 +1417,7 @@ static u32 calc_plane_remap_info(const struct intel_framebuffer *fb, int color_p
        if (remap_info->linear)
                intel_adjust_linear_offset(&color_plane_info->x, &color_plane_info->y,
                                           fb->base.format->cpp[color_plane],
-                                          color_plane_info->stride,
+                                          color_plane_info->mapping_stride,
                                           gtt_offset * tile_size, 0);
        else
                intel_adjust_tile_offset(&color_plane_info->x, &color_plane_info->y,
@@ -1527,7 +1528,7 @@ int intel_fill_fb_info(struct drm_i915_private *i915, struct intel_framebuffer *
                 */
                fb->normal_view.color_plane[i].x = x;
                fb->normal_view.color_plane[i].y = y;
-               fb->normal_view.color_plane[i].stride = fb->base.pitches[i];
+               fb->normal_view.color_plane[i].mapping_stride = fb->base.pitches[i];
 
                offset = calc_plane_aligned_offset(fb, i, &x, &y);
 
@@ -1721,7 +1722,7 @@ static int intel_plane_check_stride(const struct intel_plane_state *plane_state)
                return 0;
 
        /* FIXME other color planes? */
-       stride = plane_state->view.color_plane[0].stride;
+       stride = plane_state->view.color_plane[0].mapping_stride;
        max_stride = plane->max_stride(plane, fb->format->format,
                                       fb->modifier, rotation);
 
index 1f66de77a6b1e4934d62fec188f01607db2ad30d..834eb4cc7c1053e836b6ade2bfdb7aa040fa2c80 100644 (file)
@@ -68,7 +68,7 @@ static unsigned int intel_fbc_plane_stride(const struct intel_plane_state *plane
        const struct drm_framebuffer *fb = plane_state->hw.fb;
        unsigned int stride;
 
-       stride = plane_state->view.color_plane[0].stride;
+       stride = plane_state->view.color_plane[0].mapping_stride;
        if (!drm_rotation_90_or_270(plane_state->hw.rotation))
                stride /= fb->format->cpp[0];
 
index 367515a70ac4c8e9c2b80e7d758843313e28c45b..1d710b3e51ee72888d21a826eb9d0edd969855a4 100644 (file)
@@ -448,7 +448,7 @@ vlv_update_plane(struct intel_plane *plane,
        spin_lock_irqsave(&dev_priv->uncore.lock, irqflags);
 
        intel_de_write_fw(dev_priv, SPSTRIDE(pipe, plane_id),
-                         plane_state->view.color_plane[0].stride);
+                         plane_state->view.color_plane[0].mapping_stride);
        intel_de_write_fw(dev_priv, SPPOS(pipe, plane_id),
                          (crtc_y << 16) | crtc_x);
        intel_de_write_fw(dev_priv, SPSIZE(pipe, plane_id),
@@ -872,7 +872,7 @@ ivb_update_plane(struct intel_plane *plane,
        spin_lock_irqsave(&dev_priv->uncore.lock, irqflags);
 
        intel_de_write_fw(dev_priv, SPRSTRIDE(pipe),
-                         plane_state->view.color_plane[0].stride);
+                         plane_state->view.color_plane[0].mapping_stride);
        intel_de_write_fw(dev_priv, SPRPOS(pipe), (crtc_y << 16) | crtc_x);
        intel_de_write_fw(dev_priv, SPRSIZE(pipe), (crtc_h << 16) | crtc_w);
        if (IS_IVYBRIDGE(dev_priv))
@@ -1200,7 +1200,7 @@ g4x_update_plane(struct intel_plane *plane,
        spin_lock_irqsave(&dev_priv->uncore.lock, irqflags);
 
        intel_de_write_fw(dev_priv, DVSSTRIDE(pipe),
-                         plane_state->view.color_plane[0].stride);
+                         plane_state->view.color_plane[0].mapping_stride);
        intel_de_write_fw(dev_priv, DVSPOS(pipe), (crtc_y << 16) | crtc_x);
        intel_de_write_fw(dev_priv, DVSSIZE(pipe), (crtc_h << 16) | crtc_w);
        intel_de_write_fw(dev_priv, DVSSCALE(pipe), dvsscale);
@@ -1300,7 +1300,7 @@ g4x_sprite_check_scaling(struct intel_crtc_state *crtc_state,
        int src_x, src_w, src_h, crtc_w, crtc_h;
        const struct drm_display_mode *adjusted_mode =
                &crtc_state->hw.adjusted_mode;
-       unsigned int stride = plane_state->view.color_plane[0].stride;
+       unsigned int stride = plane_state->view.color_plane[0].mapping_stride;
        unsigned int cpp = fb->format->cpp[0];
        unsigned int width_bytes;
        int min_width, min_height;
index ef7856db09f7950f1d43186e83e74fd67ce3d758..7795ecd8c0fcdb51656c45a7039ee2764824bedf 100644 (file)
@@ -589,7 +589,7 @@ static u32 skl_plane_stride(const struct intel_plane_state *plane_state,
 {
        const struct drm_framebuffer *fb = plane_state->hw.fb;
        unsigned int rotation = plane_state->hw.rotation;
-       u32 stride = plane_state->view.color_plane[color_plane].stride;
+       u32 stride = plane_state->view.color_plane[color_plane].mapping_stride;
 
        if (color_plane >= fb->format->num_planes)
                return 0;
@@ -1433,7 +1433,7 @@ int skl_calc_main_surface_offset(const struct intel_plane_state *plane_state,
        if (fb->modifier == I915_FORMAT_MOD_X_TILED) {
                int cpp = fb->format->cpp[0];
 
-               while ((*x + w) * cpp > plane_state->view.color_plane[0].stride) {
+               while ((*x + w) * cpp > plane_state->view.color_plane[0].mapping_stride) {
                        if (*offset == 0) {
                                drm_dbg_kms(&dev_priv->drm,
                                            "Unable to find suitable display surface offset due to X-tiling\n");