mirror of
https://github.com/torvalds/linux.git
synced 2026-09-25 17:42:03 +02:00
drm/hibmc: Store fb in variable in atomic_update
The atomic-update helper frequently refers to the framebuffer in new_state->fb. Store it in a local variable to make the code more readable. No functional changes. Suggested-by: Yongbang Shi <shiyongbang@huawei.com> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Yongbang Shi <shiyongbang@huawei.com> Link: https://patch.msgid.link/20260618123142.92298-4-tzimmermann@suse.de
This commit is contained in:
parent
0e682e136c
commit
47decb5e94
|
|
@ -100,18 +100,18 @@ static int hibmc_plane_atomic_check(struct drm_plane *plane,
|
|||
static void hibmc_plane_atomic_update(struct drm_plane *plane,
|
||||
struct drm_atomic_commit *state)
|
||||
{
|
||||
struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state,
|
||||
plane);
|
||||
struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, plane);
|
||||
struct drm_framebuffer *fb = new_state->fb;
|
||||
u32 reg;
|
||||
s64 gpu_addr = 0;
|
||||
u32 line_l;
|
||||
struct hibmc_drm_private *priv = to_hibmc_drm_private(plane->dev);
|
||||
struct drm_gem_vram_object *gbo;
|
||||
|
||||
if (!new_state->fb)
|
||||
if (!fb)
|
||||
return;
|
||||
|
||||
gbo = drm_gem_vram_of_gem(new_state->fb->obj[0]);
|
||||
gbo = drm_gem_vram_of_gem(fb->obj[0]);
|
||||
|
||||
gpu_addr = drm_gem_vram_offset(gbo);
|
||||
if (WARN_ON_ONCE(gpu_addr < 0))
|
||||
|
|
@ -119,9 +119,9 @@ static void hibmc_plane_atomic_update(struct drm_plane *plane,
|
|||
|
||||
writel(gpu_addr, priv->mmio + HIBMC_CRT_FB_ADDRESS);
|
||||
|
||||
reg = new_state->fb->width * (new_state->fb->format->cpp[0]);
|
||||
reg = fb->width * fb->format->cpp[0];
|
||||
|
||||
line_l = new_state->fb->pitches[0];
|
||||
line_l = fb->pitches[0];
|
||||
writel(HIBMC_FIELD(HIBMC_CRT_FB_WIDTH_WIDTH, reg) |
|
||||
HIBMC_FIELD(HIBMC_CRT_FB_WIDTH_OFFS, line_l),
|
||||
priv->mmio + HIBMC_CRT_FB_WIDTH);
|
||||
|
|
@ -129,8 +129,7 @@ static void hibmc_plane_atomic_update(struct drm_plane *plane,
|
|||
/* SET PIXEL FORMAT */
|
||||
reg = readl(priv->mmio + HIBMC_CRT_DISP_CTL);
|
||||
reg &= ~HIBMC_CRT_DISP_CTL_FORMAT_MASK;
|
||||
reg |= HIBMC_FIELD(HIBMC_CRT_DISP_CTL_FORMAT,
|
||||
new_state->fb->format->cpp[0] * 8 / 16);
|
||||
reg |= HIBMC_FIELD(HIBMC_CRT_DISP_CTL_FORMAT, fb->format->cpp[0] * 8 / 16);
|
||||
writel(reg, priv->mmio + HIBMC_CRT_DISP_CTL);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user