drm: vkms: Add fb information to `vkms_writeback_job`
authorIgor Torrente <igormtorrente@gmail.com>
Mon, 5 Sep 2022 19:08:07 +0000 (16:08 -0300)
committerMelissa Wen <melissa.srw@gmail.com>
Mon, 5 Sep 2022 21:12:18 +0000 (20:12 -0100)
commitbbdf7b2a0b0e69e4e18b5722341dfa6266d19390
tree33d733b75d8f6b90a99051b1710049efaab3809a
parent2eef1ef6e22b241f26d7bf0f1554a9863277e526
drm: vkms: Add fb information to `vkms_writeback_job`

This commit is the groundwork to introduce new formats to the planes and
writeback buffer. As part of it, a new buffer metadata field is added to
`vkms_writeback_job`, this metadata is represented by the `vkms_frame_info`
struct.

Also adds two new function pointers (`line_to_frame_func` and
`frame_to_line_func`) are defined to handle format conversion
from/to internal format.

A new internal format(`struct pixel_argb_u16`) is introduced to deal with
all possible inputs. It consists of 16 bits fields that represent each of
the channels.

These things will allow us, in the future, to have different compositing
and wb format types.

V2: Change the code to get the drm_framebuffer reference and not copy its
    contents (Thomas Zimmermann).
V3: Drop the refcount in the wb code (Thomas Zimmermann).
V5: Add {wb,plane}_format_transform_func to vkms_writeback_job
    and vkms_plane_state (Pekka Paalanen)
V6: Improvements to some struct/struct members names (Pekka Paalanen).
    Splits this patch in two (Pekka Paalanen).
V7: Replace line_to_frame_func and frame_to_line_func typedefs
   with the function signature and void* (Melissa Wen).

Reviewed-by: Melissa Wen <mwen@igalia.com>
Signed-off-by: Igor Torrente <igormtorrente@gmail.com>
Signed-off-by: Melissa Wen <melissa.srw@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220905190811.25024-6-igormtorrente@gmail.com
drivers/gpu/drm/vkms/vkms_drv.h
drivers/gpu/drm/vkms/vkms_writeback.c