/** * struct vkms_frame_info - Structure to store the state of a frame * * @fb: backing drm framebuffer * @src: source rectangle of this frame in the source framebuffer, stored in 16.16 fixed-point form * @dst: destination rectangle in the crtc buffer, stored in whole pixel units * @map: see @drm_shadow_plane_state.data * @rotation: rotation applied to the source. * * @src and @dst should have the same size modulo the rotation.
*/ struct vkms_frame_info { struct drm_framebuffer *fb; struct drm_rect src, dst; struct iosys_map map[DRM_FORMAT_MAX_PLANES]; unsignedint rotation;
};
/** * struct pixel_argb_u16 - Internal representation of a pixel color. * @a: Alpha component value, stored in 16 bits, without padding, using * machine endianness * @r: Red component value, stored in 16 bits, without padding, using * machine endianness * @g: Green component value, stored in 16 bits, without padding, using * machine endianness * @b: Blue component value, stored in 16 bits, without padding, using * machine endianness * * The goal of this structure is to keep enough precision to ensure * correct composition results in VKMS and simplifying color * manipulation by splitting each component into its own field. * Caution: the byte ordering of this structure is machine-dependent, * you can't cast it directly to AR48 or xR48.
*/ struct pixel_argb_u16 {
u16 a, r, g, b;
};
/** * typedef pixel_write_t - These functions are used to read a pixel from a * &struct pixel_argb_u16, convert it in a specific format and write it in the @out_pixel * buffer. * * @out_pixel: destination address to write the pixel * @in_pixel: pixel to write
*/ typedefvoid (*pixel_write_t)(u8 *out_pixel, conststruct pixel_argb_u16 *in_pixel);
/** * enum pixel_read_direction - Enum used internally by VKMS to represent a reading direction in a * plane.
*/ enum pixel_read_direction {
READ_BOTTOM_TO_TOP,
READ_TOP_TO_BOTTOM,
READ_RIGHT_TO_LEFT,
READ_LEFT_TO_RIGHT
};
struct vkms_plane_state;
/** * typedef pixel_read_line_t - These functions are used to read a pixel line in the source frame, * convert it to `struct pixel_argb_u16` and write it to @out_pixel. * * @plane: plane used as source for the pixel value * @x_start: X (width) coordinate of the first pixel to copy. The caller must ensure that x_start * is non-negative and smaller than @plane->frame_info->fb->width. * @y_start: Y (height) coordinate of the first pixel to copy. The caller must ensure that y_start * is non-negative and smaller than @plane->frame_info->fb->height. * @direction: direction to use for the copy, starting at @x_start/@y_start * @count: number of pixels to copy * @out_pixel: pointer where to write the pixel values. They will be written from @out_pixel[0] * (included) to @out_pixel[@count] (excluded). The caller must ensure that out_pixel have a * length of at least @count.
*/ typedefvoid (*pixel_read_line_t)(conststruct vkms_plane_state *plane, int x_start, int y_start, enum pixel_read_direction direction, int count, struct pixel_argb_u16 out_pixel[]);
/** * struct conversion_matrix - Matrix to use for a specific encoding and range * * @matrix: Conversion matrix from yuv to rgb. The matrix is stored in a row-major manner and is * used to compute rgb values from yuv values: * [[r],[g],[b]] = @matrix * [[y],[u],[v]] * OR for yvu formats: * [[r],[g],[b]] = @matrix * [[y],[v],[u]] * The values of the matrix are signed fixed-point values with 32 bits fractional part. * @y_offset: Offset to apply on the y value.
*/ struct conversion_matrix {
s64 matrix[3][3]; int y_offset;
};
/** * struct vkms_plane_state - Driver specific plane state * @base: base plane state * @frame_info: data required for composing computation * @pixel_read_line: function to read a pixel line in this plane. The creator of a * struct vkms_plane_state must ensure that this pointer is valid * @conversion_matrix: matrix used for yuv formats to convert to rgb
*/ struct vkms_plane_state { struct drm_shadow_plane_state base; struct vkms_frame_info *frame_info;
pixel_read_line_t pixel_read_line; struct conversion_matrix conversion_matrix;
};
/** * struct vkms_crtc_state - Driver specific CRTC state * * @base: base CRTC state * @composer_work: work struct to compose and add CRC entries * * @num_active_planes: Number of active planes * @active_planes: List containing all the active planes (counted by * @num_active_planes). They should be stored in z-order. * @active_writeback: Current active writeback job * @gamma_lut: Look up table for gamma used in this CRTC * @crc_pending: Protected by @vkms_output.composer_lock, true when the frame CRC is not computed * yet. Used by vblank to detect if the composer is too slow. * @wb_pending: Protected by @vkms_output.composer_lock, true when a writeback frame is requested. * @frame_start: Protected by @vkms_output.composer_lock, saves the frame number before the start * of the composition process. * @frame_end: Protected by @vkms_output.composer_lock, saves the last requested frame number. * This is used to generate enough CRC entries when the composition worker is too slow.
*/ struct vkms_crtc_state { struct drm_crtc_state base; struct work_struct composer_work;
/** * struct vkms_output - Internal representation of all output components in VKMS * * @crtc: Base CRTC in DRM * @encoder: DRM encoder used for this output * @connector: DRM connector used for this output * @wb_connecter: DRM writeback connector used for this output * @vblank_hrtimer: Timer used to trigger the vblank * @period_ns: vblank period, in nanoseconds, used to configure @vblank_hrtimer and to compute * vblank timestamps * @composer_workq: Ordered workqueue for @composer_state.composer_work. * @lock: Lock used to protect concurrent access to the composer * @composer_enabled: Protected by @lock, true when the VKMS composer is active (crc needed or * writeback) * @composer_state: Protected by @lock, current state of this VKMS output * @composer_lock: Lock used internally to protect @composer_state members
*/ struct vkms_output { struct drm_crtc crtc; struct drm_writeback_connector wb_connector; struct drm_encoder wb_encoder; struct hrtimer vblank_hrtimer;
ktime_t period_ns; struct workqueue_struct *composer_workq;
spinlock_t lock;
/** * vkms_crtc_init() - Initialize a CRTC for VKMS * @dev: DRM device associated with the VKMS buffer * @crtc: uninitialized CRTC device * @primary: primary plane to attach to the CRTC * @cursor: plane to attach to the CRTC
*/ struct vkms_output *vkms_crtc_init(struct drm_device *dev, struct drm_plane *primary, struct drm_plane *cursor);
/** * vkms_output_init() - Initialize all sub-components needed for a VKMS device. * * @vkmsdev: VKMS device to initialize
*/ int vkms_output_init(struct vkms_device *vkmsdev);
/** * vkms_plane_init() - Initialize a plane * * @vkmsdev: VKMS device containing the plane * @type: type of plane to initialize
*/ struct vkms_plane *vkms_plane_init(struct vkms_device *vkmsdev, enum drm_plane_type type);
/* CRC Support */ constchar *const *vkms_get_crc_sources(struct drm_crtc *crtc,
size_t *count); int vkms_set_crc_source(struct drm_crtc *crtc, constchar *src_name); int vkms_verify_crc_source(struct drm_crtc *crtc, constchar *source_name,
size_t *values_cnt);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.