]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/rockchip: Rename variables for clarity
authorDaniel Stone <daniels@collabora.com>
Wed, 15 Oct 2025 11:00:33 +0000 (12:00 +0100)
committerHeiko Stuebner <heiko@sntech.de>
Mon, 20 Oct 2025 13:56:12 +0000 (15:56 +0200)
actual_w and actual_h were the clipped source width, so rename them to
fit the use.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://lore.kernel.org/r/20251015110042.41273-5-daniels@collabora.com
drivers/gpu/drm/rockchip/rockchip_drm_vop2.c

index 659b2565dee42d32af6a02620752c432b832e0b6..e2bf2dbd882b632d86977f4743b2350f60fae476 100644 (file)
@@ -1139,7 +1139,7 @@ static void vop2_plane_atomic_update(struct drm_plane *plane,
        struct vop2 *vop2 = win->vop2;
        struct drm_framebuffer *fb = pstate->fb;
        u32 bpp = vop2_get_bpp(fb->format);
-       u32 actual_w, actual_h, dsp_w, dsp_h;
+       u32 src_w, src_h, dsp_w, dsp_h;
        u32 act_info, dsp_info;
        u32 format;
        u32 afbc_format;
@@ -1203,8 +1203,8 @@ static void vop2_plane_atomic_update(struct drm_plane *plane,
                uv_mst = rk_obj->dma_addr + offset + fb->offsets[1];
        }
 
-       actual_w = drm_rect_width(src) >> 16;
-       actual_h = drm_rect_height(src) >> 16;
+       src_w = drm_rect_width(src) >> 16;
+       src_h = drm_rect_height(src) >> 16;
        dsp_w = drm_rect_width(dest);
 
        if (dest->x1 + dsp_w > adjusted_mode->hdisplay) {
@@ -1214,7 +1214,7 @@ static void vop2_plane_atomic_update(struct drm_plane *plane,
                dsp_w = adjusted_mode->hdisplay - dest->x1;
                if (dsp_w < 4)
                        dsp_w = 4;
-               actual_w = dsp_w * actual_w / drm_rect_width(dest);
+               src_w = dsp_w * src_w / drm_rect_width(dest);
        }
 
        dsp_h = drm_rect_height(dest);
@@ -1226,35 +1226,35 @@ static void vop2_plane_atomic_update(struct drm_plane *plane,
                dsp_h = adjusted_mode->vdisplay - dest->y1;
                if (dsp_h < 4)
                        dsp_h = 4;
-               actual_h = dsp_h * actual_h / drm_rect_height(dest);
+               src_h = dsp_h * src_h / drm_rect_height(dest);
        }
 
        /*
         * This is workaround solution for IC design:
-        * esmart can't support scale down when actual_w % 16 == 1.
+        * esmart can't support scale down when src_w % 16 == 1.
         */
        if (!(win->data->feature & WIN_FEATURE_AFBDC)) {
-               if (actual_w > dsp_w && (actual_w & 0xf) == 1) {
+               if (src_w > dsp_w && (src_w & 0xf) == 1) {
                        drm_dbg_kms(vop2->drm, "vp%d %s act_w[%d] MODE 16 == 1\n",
-                                   vp->id, win->data->name, actual_w);
-                       actual_w -= 1;
+                                   vp->id, win->data->name, src_w);
+                       src_w -= 1;
                }
        }
 
-       if (afbc_en && actual_w % 4) {
-               drm_dbg_kms(vop2->drm, "vp%d %s actual_w[%d] not 4 pixel aligned\n",
-                           vp->id, win->data->name, actual_w);
-               actual_w = ALIGN_DOWN(actual_w, 4);
+       if (afbc_en && src_w % 4) {
+               drm_dbg_kms(vop2->drm, "vp%d %s src_w[%d] not 4 pixel aligned\n",
+                           vp->id, win->data->name, src_w);
+               src_w = ALIGN_DOWN(src_w, 4);
        }
 
-       act_info = (actual_h - 1) << 16 | ((actual_w - 1) & 0xffff);
+       act_info = (src_h - 1) << 16 | ((src_w - 1) & 0xffff);
        dsp_info = (dsp_h - 1) << 16 | ((dsp_w - 1) & 0xffff);
 
        format = vop2_convert_format(fb->format->format);
        half_block_en = vop2_half_block_enable(pstate);
 
        drm_dbg(vop2->drm, "vp%d update %s[%dx%d->%dx%d@%dx%d] fmt[%p4cc_%s] addr[%pad]\n",
-               vp->id, win->data->name, actual_w, actual_h, dsp_w, dsp_h,
+               vp->id, win->data->name, src_w, src_h, dsp_w, dsp_h,
                dest->x1, dest->y1,
                &fb->format->format,
                afbc_en ? "AFBC" : "", &yrgb_mst);
@@ -1283,7 +1283,7 @@ static void vop2_plane_atomic_update(struct drm_plane *plane,
                if (fb->modifier & AFBC_FORMAT_MOD_YTR)
                        afbc_format |= (1 << 4);
 
-               afbc_tile_num = ALIGN(actual_w, block_w) / block_w;
+               afbc_tile_num = ALIGN(src_w, block_w) / block_w;
 
                /*
                 * AFBC pic_vir_width is count by pixel, this is different
@@ -1361,8 +1361,8 @@ static void vop2_plane_atomic_update(struct drm_plane *plane,
 
        if (rotate_90 || rotate_270) {
                act_info = swahw32(act_info);
-               actual_w = drm_rect_height(src) >> 16;
-               actual_h = drm_rect_width(src) >> 16;
+               src_w = drm_rect_height(src) >> 16;
+               src_h = drm_rect_width(src) >> 16;
        }
 
        vop2_win_write(win, VOP2_WIN_FORMAT, format);
@@ -1378,7 +1378,7 @@ static void vop2_plane_atomic_update(struct drm_plane *plane,
                vop2_win_write(win, VOP2_WIN_UV_MST, uv_mst);
        }
 
-       vop2_setup_scale(vop2, win, actual_w, actual_h, dsp_w, dsp_h, fb->format->format);
+       vop2_setup_scale(vop2, win, src_w, src_h, dsp_w, dsp_h, fb->format->format);
        if (!vop2_cluster_window(win))
                vop2_plane_setup_color_key(plane, 0);
        vop2_win_write(win, VOP2_WIN_ACT_INFO, act_info);