Skip to content

Commit

Permalink
drm/vkms: Reduce critical section
Browse files Browse the repository at this point in the history
The spinlock composer_lock protects the variables crc_pending,
wb_pending, frame_start and frame_end, which are variables that are used
by the composer worker. There is no need to protect the wb_frame_info
information with a spinlock. Therefore, reduce the critical section of
the lock by removing the assignments to the wb_frame_info from the
critical section.

Signed-off-by: Maíra Canal <[email protected]>
Reviewed-by: Arthur Grillo <[email protected]>
Signed-off-by: Maíra Canal <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
  • Loading branch information
mairacanal committed Jun 24, 2023
1 parent 26195af commit 6c494ca
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/gpu/drm/vkms/vkms_writeback.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,13 @@ static void vkms_wb_atomic_commit(struct drm_connector *conn,

spin_lock_irq(&output->composer_lock);
crtc_state->active_writeback = active_wb;
crtc_state->wb_pending = true;
spin_unlock_irq(&output->composer_lock);

wb_frame_info->offset = fb->offsets[0];
wb_frame_info->pitch = fb->pitches[0];
wb_frame_info->cpp = fb->format->cpp[0];
crtc_state->wb_pending = true;
spin_unlock_irq(&output->composer_lock);

drm_writeback_queue_job(wb_conn, connector_state);
active_wb->wb_write = get_line_to_frame_function(wb_format);
drm_rect_init(&wb_frame_info->src, 0, 0, crtc_width, crtc_height);
Expand Down

0 comments on commit 6c494ca

Please sign in to comment.