Skip to content

Commit 33cbeea

Browse files
fooishbarmmind
authored andcommitted
drm/rockchip: Rename variables for clarity
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
1 parent 70e3f77 commit 33cbeea

1 file changed

Lines changed: 19 additions & 19 deletions

File tree

drivers/gpu/drm/rockchip/rockchip_drm_vop2.c

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,7 +1139,7 @@ static void vop2_plane_atomic_update(struct drm_plane *plane,
11391139
struct vop2 *vop2 = win->vop2;
11401140
struct drm_framebuffer *fb = pstate->fb;
11411141
u32 bpp = vop2_get_bpp(fb->format);
1142-
u32 actual_w, actual_h, dsp_w, dsp_h;
1142+
u32 src_w, src_h, dsp_w, dsp_h;
11431143
u32 act_info, dsp_info;
11441144
u32 format;
11451145
u32 afbc_format;
@@ -1203,8 +1203,8 @@ static void vop2_plane_atomic_update(struct drm_plane *plane,
12031203
uv_mst = rk_obj->dma_addr + offset + fb->offsets[1];
12041204
}
12051205

1206-
actual_w = drm_rect_width(src) >> 16;
1207-
actual_h = drm_rect_height(src) >> 16;
1206+
src_w = drm_rect_width(src) >> 16;
1207+
src_h = drm_rect_height(src) >> 16;
12081208
dsp_w = drm_rect_width(dest);
12091209

12101210
if (dest->x1 + dsp_w > adjusted_mode->hdisplay) {
@@ -1214,7 +1214,7 @@ static void vop2_plane_atomic_update(struct drm_plane *plane,
12141214
dsp_w = adjusted_mode->hdisplay - dest->x1;
12151215
if (dsp_w < 4)
12161216
dsp_w = 4;
1217-
actual_w = dsp_w * actual_w / drm_rect_width(dest);
1217+
src_w = dsp_w * src_w / drm_rect_width(dest);
12181218
}
12191219

12201220
dsp_h = drm_rect_height(dest);
@@ -1226,35 +1226,35 @@ static void vop2_plane_atomic_update(struct drm_plane *plane,
12261226
dsp_h = adjusted_mode->vdisplay - dest->y1;
12271227
if (dsp_h < 4)
12281228
dsp_h = 4;
1229-
actual_h = dsp_h * actual_h / drm_rect_height(dest);
1229+
src_h = dsp_h * src_h / drm_rect_height(dest);
12301230
}
12311231

12321232
/*
12331233
* This is workaround solution for IC design:
1234-
* esmart can't support scale down when actual_w % 16 == 1.
1234+
* esmart can't support scale down when src_w % 16 == 1.
12351235
*/
12361236
if (!(win->data->feature & WIN_FEATURE_AFBDC)) {
1237-
if (actual_w > dsp_w && (actual_w & 0xf) == 1) {
1237+
if (src_w > dsp_w && (src_w & 0xf) == 1) {
12381238
drm_dbg_kms(vop2->drm, "vp%d %s act_w[%d] MODE 16 == 1\n",
1239-
vp->id, win->data->name, actual_w);
1240-
actual_w -= 1;
1239+
vp->id, win->data->name, src_w);
1240+
src_w -= 1;
12411241
}
12421242
}
12431243

1244-
if (afbc_en && actual_w % 4) {
1245-
drm_dbg_kms(vop2->drm, "vp%d %s actual_w[%d] not 4 pixel aligned\n",
1246-
vp->id, win->data->name, actual_w);
1247-
actual_w = ALIGN_DOWN(actual_w, 4);
1244+
if (afbc_en && src_w % 4) {
1245+
drm_dbg_kms(vop2->drm, "vp%d %s src_w[%d] not 4 pixel aligned\n",
1246+
vp->id, win->data->name, src_w);
1247+
src_w = ALIGN_DOWN(src_w, 4);
12481248
}
12491249

1250-
act_info = (actual_h - 1) << 16 | ((actual_w - 1) & 0xffff);
1250+
act_info = (src_h - 1) << 16 | ((src_w - 1) & 0xffff);
12511251
dsp_info = (dsp_h - 1) << 16 | ((dsp_w - 1) & 0xffff);
12521252

12531253
format = vop2_convert_format(fb->format->format);
12541254
half_block_en = vop2_half_block_enable(pstate);
12551255

12561256
drm_dbg(vop2->drm, "vp%d update %s[%dx%d->%dx%d@%dx%d] fmt[%p4cc_%s] addr[%pad]\n",
1257-
vp->id, win->data->name, actual_w, actual_h, dsp_w, dsp_h,
1257+
vp->id, win->data->name, src_w, src_h, dsp_w, dsp_h,
12581258
dest->x1, dest->y1,
12591259
&fb->format->format,
12601260
afbc_en ? "AFBC" : "", &yrgb_mst);
@@ -1283,7 +1283,7 @@ static void vop2_plane_atomic_update(struct drm_plane *plane,
12831283
if (fb->modifier & AFBC_FORMAT_MOD_YTR)
12841284
afbc_format |= (1 << 4);
12851285

1286-
afbc_tile_num = ALIGN(actual_w, block_w) / block_w;
1286+
afbc_tile_num = ALIGN(src_w, block_w) / block_w;
12871287

12881288
/*
12891289
* 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,
13611361

13621362
if (rotate_90 || rotate_270) {
13631363
act_info = swahw32(act_info);
1364-
actual_w = drm_rect_height(src) >> 16;
1365-
actual_h = drm_rect_width(src) >> 16;
1364+
src_w = drm_rect_height(src) >> 16;
1365+
src_h = drm_rect_width(src) >> 16;
13661366
}
13671367

13681368
vop2_win_write(win, VOP2_WIN_FORMAT, format);
@@ -1378,7 +1378,7 @@ static void vop2_plane_atomic_update(struct drm_plane *plane,
13781378
vop2_win_write(win, VOP2_WIN_UV_MST, uv_mst);
13791379
}
13801380

1381-
vop2_setup_scale(vop2, win, actual_w, actual_h, dsp_w, dsp_h, fb->format->format);
1381+
vop2_setup_scale(vop2, win, src_w, src_h, dsp_w, dsp_h, fb->format->format);
13821382
if (!vop2_cluster_window(win))
13831383
vop2_plane_setup_color_key(plane, 0);
13841384
vop2_win_write(win, VOP2_WIN_ACT_INFO, act_info);

0 commit comments

Comments
 (0)