mirror of
https://github.com/torvalds/linux.git
synced 2026-05-22 14:12:07 +02:00
drm/vkms: Use drm_frame directly
Remove intermidiary variables and access the variables directly from drm_frame. These changes should be noop. Signed-off-by: Arthur Grillo <arthurgrillo@riseup.net> Acked-by: Pekka Paalanen <pekka.paalanen@collabora.com> Reviewed-by: Maíra Canal <mcanal@igalia.com> Reviewed-by: José Expósito <jose.exposito89@gmail.com> Reviewed-by: Louis Chauvet <louis.chauvet@bootlin.com> [Louis Chauvet: Applied review from Maíra] Link: https://patchwork.freedesktop.org/patch/msgid/20241118-yuv-v14-2-2dbc2f1e222c@bootlin.com Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
This commit is contained in:
parent
22f16c50be
commit
2f9741ac3b
|
|
@ -42,9 +42,6 @@ struct vkms_frame_info {
|
|||
struct drm_rect rotated;
|
||||
struct iosys_map map[DRM_FORMAT_MAX_PLANES];
|
||||
unsigned int rotation;
|
||||
unsigned int offset;
|
||||
unsigned int pitch;
|
||||
unsigned int cpp;
|
||||
};
|
||||
|
||||
struct pixel_argb_u16 {
|
||||
|
|
|
|||
|
|
@ -23,8 +23,9 @@
|
|||
*/
|
||||
static size_t pixel_offset(const struct vkms_frame_info *frame_info, int x, int y)
|
||||
{
|
||||
return frame_info->offset + (y * frame_info->pitch)
|
||||
+ (x * frame_info->cpp);
|
||||
struct drm_framebuffer *fb = frame_info->fb;
|
||||
|
||||
return fb->offsets[0] + (y * fb->pitches[0]) + (x * fb->format->cpp[0]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -154,12 +155,12 @@ void vkms_compose_row(struct line_buffer *stage_buffer, struct vkms_plane_state
|
|||
u8 *src_pixels = get_packed_src_addr(frame_info, y);
|
||||
int limit = min_t(size_t, drm_rect_width(&frame_info->dst), stage_buffer->n_pixels);
|
||||
|
||||
for (size_t x = 0; x < limit; x++, src_pixels += frame_info->cpp) {
|
||||
for (size_t x = 0; x < limit; x++, src_pixels += frame_info->fb->format->cpp[0]) {
|
||||
int x_pos = get_x_position(frame_info, limit, x);
|
||||
|
||||
if (drm_rotation_90_or_270(frame_info->rotation))
|
||||
src_pixels = get_packed_src_addr(frame_info, x + frame_info->rotated.y1)
|
||||
+ frame_info->cpp * y;
|
||||
+ frame_info->fb->format->cpp[0] * y;
|
||||
|
||||
plane->pixel_read(src_pixels, &out_pixels[x_pos]);
|
||||
}
|
||||
|
|
@ -253,7 +254,7 @@ void vkms_writeback_row(struct vkms_writeback_job *wb,
|
|||
struct pixel_argb_u16 *in_pixels = src_buffer->pixels;
|
||||
int x_limit = min_t(size_t, drm_rect_width(&frame_info->dst), src_buffer->n_pixels);
|
||||
|
||||
for (size_t x = 0; x < x_limit; x++, dst_pixels += frame_info->cpp)
|
||||
for (size_t x = 0; x < x_limit; x++, dst_pixels += frame_info->fb->format->cpp[0])
|
||||
wb->pixel_write(dst_pixels, &in_pixels[x]);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -125,9 +125,6 @@ static void vkms_plane_atomic_update(struct drm_plane *plane,
|
|||
drm_rect_rotate(&frame_info->rotated, drm_rect_width(&frame_info->rotated),
|
||||
drm_rect_height(&frame_info->rotated), frame_info->rotation);
|
||||
|
||||
frame_info->offset = fb->offsets[0];
|
||||
frame_info->pitch = fb->pitches[0];
|
||||
frame_info->cpp = fb->format->cpp[0];
|
||||
vkms_plane_state->pixel_read = get_pixel_conversion_function(fmt);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -149,11 +149,6 @@ static void vkms_wb_atomic_commit(struct drm_connector *conn,
|
|||
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];
|
||||
|
||||
drm_writeback_queue_job(wb_conn, connector_state);
|
||||
active_wb->pixel_write = get_pixel_write_function(wb_format);
|
||||
drm_rect_init(&wb_frame_info->src, 0, 0, crtc_width, crtc_height);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user