Skip to content

Commit aafc45d

Browse files
committed
drm/vkms: Remove usage of legacy drm_crtc members
Some members of the drm_crtc structure have been deprecated in favor of equivalent members in the drm_crtc_state structure. As reported by Ville Syrjala [1], the VKMS driver was still using these deprecated fields. This commit updates the VKMS driver to use the new drm_crtc_state fields instead. Additionally, this commit removes the call to `drm_calc_timestamping_constants` in `vkms_enable_vblank` as it is redundant. This calculation is already performed in `vkms_atomic_commit_tail` by calling `drm_atomic_helper_commit_modeset_disables`. [1]:https://lore.kernel.org/all/[email protected]/ Reviewed-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Louis Chauvet <[email protected]>
1 parent d78f0ee commit aafc45d

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

drivers/gpu/drm/vkms/vkms_composer.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ static void blend(struct vkms_writeback_job *wb,
187187

188188
const struct pixel_argb_u16 background_color = { .a = 0xffff };
189189

190-
size_t crtc_y_limit = crtc_state->base.crtc->mode.vdisplay;
190+
size_t crtc_y_limit = crtc_state->base.mode.vdisplay;
191191

192192
/*
193193
* The planes are composed line-by-line to avoid heavy memory usage. It is a necessary
@@ -270,7 +270,7 @@ static int compose_active_planes(struct vkms_writeback_job *active_wb,
270270
if (WARN_ON(check_format_funcs(crtc_state, active_wb)))
271271
return -EINVAL;
272272

273-
line_width = crtc_state->base.crtc->mode.hdisplay;
273+
line_width = crtc_state->base.mode.hdisplay;
274274
stage_buffer.n_pixels = line_width;
275275
output_buffer.n_pixels = line_width;
276276

drivers/gpu/drm/vkms/vkms_crtc.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ static int vkms_enable_vblank(struct drm_crtc *crtc)
6464
struct drm_vblank_crtc *vblank = drm_crtc_vblank_crtc(crtc);
6565
struct vkms_output *out = drm_crtc_to_vkms_output(crtc);
6666

67-
drm_calc_timestamping_constants(crtc, &crtc->mode);
68-
6967
hrtimer_init(&out->vblank_hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
7068
out->vblank_hrtimer.function = &vkms_vblank_simulate;
7169
out->period_ns = ktime_set(0, vblank->framedur_ns);

drivers/gpu/drm/vkms/vkms_writeback.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ static void vkms_wb_atomic_commit(struct drm_connector *conn,
131131
struct drm_connector_state *conn_state = wb_conn->base.state;
132132
struct vkms_crtc_state *crtc_state = output->composer_state;
133133
struct drm_framebuffer *fb = connector_state->writeback_job->fb;
134-
u16 crtc_height = crtc_state->base.crtc->mode.vdisplay;
135-
u16 crtc_width = crtc_state->base.crtc->mode.hdisplay;
134+
u16 crtc_height = crtc_state->base.mode.vdisplay;
135+
u16 crtc_width = crtc_state->base.mode.hdisplay;
136136
struct vkms_writeback_job *active_wb;
137137
struct vkms_frame_info *wb_frame_info;
138138
u32 wb_format = fb->format->format;

0 commit comments

Comments
 (0)