kernel: bump 5.15 to 5.15.62
[openwrt/staging/dedeckeh.git] / target / linux / bcm27xx / patches-5.15 / 950-0787-vc4-drm-vc4_plane-Keep-fractional-source-coords-insi.patch
index 715f9b1930c5a0e6889036fd1d5101b1c781940d..7bb57aafa5a41819687fcd78abee6cab6201d1be 100644 (file)
@@ -35,18 +35,19 @@ Signed-off-by: Dom Cobley <popcornmix@gmail.com>
                return VC4_SCALING_PPF;
        else
                return VC4_SCALING_TPZ;
-@@ -388,14 +388,10 @@ static int vc4_plane_setup_clipping_and_
+@@ -388,15 +388,10 @@ static int vc4_plane_setup_clipping_and_
        for (i = 0; i < num_planes; i++)
                vc4_state->offsets[i] = bo->paddr + fb->offsets[i];
  
--      /* We don't support subpixel source positioning for scaling,
+-      /*
+-       * We don't support subpixel source positioning for scaling,
 -       * but fractional coordinates can be generated by clipping
 -       * so just round for now
 -       */
--      vc4_state->src_x = DIV_ROUND_CLOSEST(state->src.x1, 1<<16);
--      vc4_state->src_y = DIV_ROUND_CLOSEST(state->src.y1, 1<<16);
--      vc4_state->src_w[0] = DIV_ROUND_CLOSEST(state->src.x2, 1<<16) - vc4_state->src_x;
--      vc4_state->src_h[0] = DIV_ROUND_CLOSEST(state->src.y2, 1<<16) - vc4_state->src_y;
+-      vc4_state->src_x = DIV_ROUND_CLOSEST(state->src.x1, 1 << 16);
+-      vc4_state->src_y = DIV_ROUND_CLOSEST(state->src.y1, 1 << 16);
+-      vc4_state->src_w[0] = DIV_ROUND_CLOSEST(state->src.x2, 1 << 16) - vc4_state->src_x;
+-      vc4_state->src_h[0] = DIV_ROUND_CLOSEST(state->src.y2, 1 << 16) - vc4_state->src_y;
 +      vc4_state->src_x = state->src.x1;
 +      vc4_state->src_y = state->src.y1;
 +      vc4_state->src_w[0] = state->src.x2 - vc4_state->src_x;
@@ -54,7 +55,7 @@ Signed-off-by: Dom Cobley <popcornmix@gmail.com>
  
        vc4_state->crtc_x = state->dst.x1;
        vc4_state->crtc_y = state->dst.y1;
-@@ -448,7 +444,7 @@ static void vc4_write_tpz(struct vc4_pla
+@@ -449,7 +444,7 @@ static void vc4_write_tpz(struct vc4_pla
  {
        u32 scale, recip;
  
@@ -63,7 +64,7 @@ Signed-off-by: Dom Cobley <popcornmix@gmail.com>
  
        /* The specs note that while the reciprocal would be defined
         * as (1<<32)/scale, ~0 is close enough.
-@@ -494,7 +490,7 @@ static u32 vc4_lbm_size(struct drm_plane
+@@ -495,7 +490,7 @@ static u32 vc4_lbm_size(struct drm_plane
        if (vc4_state->x_scaling[0] == VC4_SCALING_TPZ)
                pix_per_line = vc4_state->crtc_w;
        else
@@ -72,7 +73,7 @@ Signed-off-by: Dom Cobley <popcornmix@gmail.com>
  
        if (!vc4_state->is_yuv) {
                if (vc4_state->y_scaling[0] == VC4_SCALING_TPZ)
-@@ -585,7 +581,8 @@ static void vc4_plane_calc_load(struct d
+@@ -586,7 +581,8 @@ static void vc4_plane_calc_load(struct d
        for (i = 0; i < fb->format->num_planes; i++) {
                /* Even if the bandwidth/plane required for a single frame is
                 *
@@ -82,7 +83,7 @@ Signed-off-by: Dom Cobley <popcornmix@gmail.com>
                 *
                 * when downscaling, we have to read more pixels per line in
                 * the time frame reserved for a single line, so the bandwidth
-@@ -594,11 +591,11 @@ static void vc4_plane_calc_load(struct d
+@@ -595,11 +591,11 @@ static void vc4_plane_calc_load(struct d
                 * load by this number. We're likely over-estimating the read
                 * demand, but that's better than under-estimating it.
                 */
@@ -98,7 +99,7 @@ Signed-off-by: Dom Cobley <popcornmix@gmail.com>
                vc4_state->hvs_load += vc4_state->crtc_h * vc4_state->crtc_w;
        }
  
-@@ -751,7 +748,8 @@ static int vc4_plane_mode_set(struct drm
+@@ -752,7 +748,8 @@ static int vc4_plane_mode_set(struct drm
        bool mix_plane_alpha;
        bool covers_screen;
        u32 scl0, scl1, pitch0;
@@ -108,7 +109,7 @@ Signed-off-by: Dom Cobley <popcornmix@gmail.com>
        u32 hvs_format = format->hvs;
        unsigned int rotation;
        int ret, i;
-@@ -763,6 +761,9 @@ static int vc4_plane_mode_set(struct drm
+@@ -764,6 +761,9 @@ static int vc4_plane_mode_set(struct drm
        if (ret)
                return ret;
  
@@ -118,7 +119,7 @@ Signed-off-by: Dom Cobley <popcornmix@gmail.com>
        /* SCL1 is used for Cb/Cr scaling of planar formats.  For RGB
         * and 4:4:4, scl1 should be set to scl0 so both channels of
         * the scaler do the same thing.  For YUV, the Y plane needs
-@@ -783,9 +784,11 @@ static int vc4_plane_mode_set(struct drm
+@@ -784,9 +784,11 @@ static int vc4_plane_mode_set(struct drm
                                         DRM_MODE_REFLECT_Y);
  
        /* We must point to the last line when Y reflection is enabled. */
@@ -132,7 +133,7 @@ Signed-off-by: Dom Cobley <popcornmix@gmail.com>
  
        switch (base_format_mod) {
        case DRM_FORMAT_MOD_LINEAR:
-@@ -800,7 +803,7 @@ static int vc4_plane_mode_set(struct drm
+@@ -801,7 +803,7 @@ static int vc4_plane_mode_set(struct drm
                                                 (i ? v_subsample : 1) *
                                                 fb->pitches[i];
  
@@ -141,7 +142,7 @@ Signed-off-by: Dom Cobley <popcornmix@gmail.com>
                                                 (i ? h_subsample : 1) *
                                                 fb->format->cpp[i];
                }
-@@ -823,7 +826,7 @@ static int vc4_plane_mode_set(struct drm
+@@ -824,7 +826,7 @@ static int vc4_plane_mode_set(struct drm
                 *      pitch * tile_h == tile_size * tiles_per_row
                 */
                u32 tiles_w = fb->pitches[0] >> (tile_size_shift - tile_h_shift);
@@ -150,7 +151,7 @@ Signed-off-by: Dom Cobley <popcornmix@gmail.com>
                u32 tiles_r = tiles_w - tiles_l;
                u32 tiles_t = src_y >> tile_h_shift;
                /* Intra-tile offsets, which modify the base address (the
-@@ -833,7 +836,7 @@ static int vc4_plane_mode_set(struct drm
+@@ -834,7 +836,7 @@ static int vc4_plane_mode_set(struct drm
                u32 tile_y = (src_y >> 4) & 1;
                u32 subtile_y = (src_y >> 2) & 3;
                u32 utile_y = src_y & 3;
@@ -159,7 +160,7 @@ Signed-off-by: Dom Cobley <popcornmix@gmail.com>
                u32 y_off = src_y & tile_h_mask;
  
                /* When Y reflection is requested we must set the
-@@ -929,7 +932,7 @@ static int vc4_plane_mode_set(struct drm
+@@ -930,7 +932,7 @@ static int vc4_plane_mode_set(struct drm
                                 * of the 12-pixels in that 128-bit word is the
                                 * first pixel to be used
                                 */
@@ -168,7 +169,7 @@ Signed-off-by: Dom Cobley <popcornmix@gmail.com>
                                u32 aligned = remaining_pixels / 12;
                                u32 last_bits = remaining_pixels % 12;
  
-@@ -951,12 +954,12 @@ static int vc4_plane_mode_set(struct drm
+@@ -952,12 +954,12 @@ static int vc4_plane_mode_set(struct drm
                                        return -EINVAL;
                                }
                                pix_per_tile = tile_w / fb->format->cpp[0];
@@ -183,7 +184,7 @@ Signed-off-by: Dom Cobley <popcornmix@gmail.com>
  
                        vc4_state->offsets[i] += param * tile_w * tile;
                        vc4_state->offsets[i] += src_y /
-@@ -1017,10 +1020,8 @@ static int vc4_plane_mode_set(struct drm
+@@ -1018,10 +1020,8 @@ static int vc4_plane_mode_set(struct drm
                vc4_dlist_write(vc4_state,
                                (mix_plane_alpha ? SCALER_POS2_ALPHA_MIX : 0) |
                                vc4_hvs4_get_alpha_blend_mode(state) |
@@ -196,7 +197,7 @@ Signed-off-by: Dom Cobley <popcornmix@gmail.com>
  
                /* Position Word 3: Context.  Written by the HVS. */
                vc4_dlist_write(vc4_state, 0xc0c0c0c0);
-@@ -1078,10 +1079,8 @@ static int vc4_plane_mode_set(struct drm
+@@ -1079,10 +1079,8 @@ static int vc4_plane_mode_set(struct drm
                /* Position Word 2: Source Image Size */
                vc4_state->pos2_offset = vc4_state->dlist_count;
                vc4_dlist_write(vc4_state,