From patchwork Wed Aug 14 09:08:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Louis Chauvet X-Patchwork-Id: 13763132 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AE716C52D7F for ; Wed, 14 Aug 2024 09:09:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7CB4810E441; Wed, 14 Aug 2024 09:09:03 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=bootlin.com header.i=@bootlin.com header.b="k8XgZP6S"; dkim-atps=neutral Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1EC0F10E43C for ; Wed, 14 Aug 2024 09:09:00 +0000 (UTC) Received: by mail.gandi.net (Postfix) with ESMTPSA id B2AE1E0002; Wed, 14 Aug 2024 09:08:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1723626539; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gOZFHW+W/DVmEYqLRNmRdAR4MlZjPTzw/O+T3sV03RE=; b=k8XgZP6SMwBrFMhCZAbcTGaM/z8hgEN4JrPtL9ijO5frLiUydr/5Aq2Di2tmlSgSQXhIM4 iYUENN3GA2lBScBFT3x6EHP/aGdVyZto95bL42qgWwYzAKX+EPecm+y3xnKlRxo2vEs8NL sFORunG6yAXm2J+creeoIl+G0ABPlyq/dJnGBdJZSkOGPciX92wBdI/I5A220acoxuBL8Y /QtY+aSl6SGklzYPtlGG0B3E2xlSygxnCkOV3WMtvTCSbI4bH23fzAh+bSeN0viyF5xu9n O+bh0xgtZh2XYUmolKHnmS/160ksW0dQNeTH7uE8QuLSU4dZVPzIBXUIcV/jKg== From: Louis Chauvet Date: Wed, 14 Aug 2024 11:08:54 +0200 Subject: [PATCH RFC 1/6] drm/vkms: Properly extract vkms_formats header MIME-Version: 1.0 Message-Id: <20240814-google-split-headers-v1-1-51712f088f5d@bootlin.com> References: <20240814-google-split-headers-v1-0-51712f088f5d@bootlin.com> In-Reply-To: <20240814-google-split-headers-v1-0-51712f088f5d@bootlin.com> To: Rodrigo Siqueira , Melissa Wen , =?utf-8?q?Ma=C3=ADra_Canal?= , Haneen Mohammed , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie Cc: dri-devel@lists.freedesktop.org, arthurgrillo@riseup.net, linux-kernel@vger.kernel.org, jeremie.dautheribes@bootlin.com, miquel.raynal@bootlin.com, thomas.petazzoni@bootlin.com, seanpaul@google.com, marcheu@google.com, nicolejadeyee@google.com, Louis Chauvet X-Mailer: b4 0.15-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=8030; i=louis.chauvet@bootlin.com; h=from:subject:message-id; bh=wcn5rhlykOkvmwik/0bRg72AOmiKANLOex5UmwYu3Ag=; b=owEBbQKS/ZANAwAIASCtLsZbECziAcsmYgBmvHQoqC6pywi1DFW1PbPfhsqUFJGOQ9t9E9B5h w3qXXFZGweJAjMEAAEIAB0WIQRPj7g/vng8MQxQWQQgrS7GWxAs4gUCZrx0KAAKCRAgrS7GWxAs 4gZJD/4sBFGVdOB/71UDrLopJkJUxFhcSOW/90xJKjReMnMHSzUaw3LAEM6BGlexyICZyQbcZWg 6VQh/gUb87V05kCUxItGNeJlbbIErTHYOvlindlKPp0+m3pZGDzSPiJrTVMrdxUlNDyDhUjZxwM 4xwfzA2QeYf0bhCZ65GDbEKSzZSPkUOlTLQWwgOhvVppsYcU8u5TkCVwL6jNzSkETK7NiexDJZF V5hmV1BlrU0N2AjJnariOlAFdnq4PDJ1Cte3W5ImgCbmuTGTwQ25xdQUixpEi8u0X0kWuiGdFe7 SmEebxBD6DaZWG0sb2zLlwTUj2uOL6zmnfMGq+APSrBOPUkEI/R95vVFBO3Gc1gGWA1IAW/cjq6 T3+5FapIsGQ4ah3wEb3h9I4Nv566qwLGET+SE3oam9zogqkMWzLLgfof5cHPgH2Ju7MOGyYpTH+ Qr5bM35HbteFlBa9DDTVIYEkdLpjt0LlDaBfT+Lt/wOFeCQiGx8VYgtUKtoBJsZBW3BJ5CVWfak uMxgNHf7hWMviLHHxJQ0Gq/ZrNWxjSryp2eDnKxI30UeXUXOYbhA4yd8BOux3x2reH5SbM3iqGV +iFX+GQvl4Wnmotfiv9q5PETgmUFH/pwC6eaflYiLDSzpNXY9rgXoyngOnAdP00g8Y0Va2EAyqL 89rpxsfBrJkFEyw== X-Developer-Key: i=louis.chauvet@bootlin.com; a=openpgp; fpr=8B7104AE9A272D6693F527F2EC1883F55E0B40A5 X-GND-Sasl: louis.chauvet@bootlin.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The vkms_format.h header was already separated from vkms_drv.h, but some function were missing. Move those function in vkms_format.h. Signed-off-by: Louis Chauvet Reviewed-by: José Expósito --- drivers/gpu/drm/vkms/vkms_drv.h | 74 +--------------------------------- drivers/gpu/drm/vkms/vkms_formats.c | 3 ++ drivers/gpu/drm/vkms/vkms_formats.h | 80 ++++++++++++++++++++++++++++++++++++- 3 files changed, 84 insertions(+), 73 deletions(-) diff --git a/drivers/gpu/drm/vkms/vkms_drv.h b/drivers/gpu/drm/vkms/vkms_drv.h index 8f6c9e67e671..0db443924a15 100644 --- a/drivers/gpu/drm/vkms/vkms_drv.h +++ b/drivers/gpu/drm/vkms/vkms_drv.h @@ -12,6 +12,8 @@ #include #include +#include "vkms_formats.h" + #define XRES_MIN 10 #define YRES_MIN 10 @@ -43,29 +45,6 @@ struct vkms_frame_info { unsigned int rotation; }; -struct pixel_argb_u16 { - u16 a, r, g, b; -}; - -struct line_buffer { - size_t n_pixels; - struct pixel_argb_u16 *pixels; -}; - -struct vkms_writeback_job; -/** - * typedef pixel_write_line_t - These functions are used to read a pixel line from a - * struct pixel_argb_u16 buffer, convert it and write it in the @wb job. - * - * @wb: the writeback job to write the output of the conversion - * @in_pixels: Source buffer containing the line to convert - * @count: The width of a line - * @x_start: The x (width) coordinate in the destination plane - * @y_start: The y (height) coordinate in the destination plane - */ -typedef void (*pixel_write_line_t)(struct vkms_writeback_job *wb, - struct pixel_argb_u16 *in_pixels, int count, int x_start, - int y_start); struct vkms_writeback_job { struct iosys_map data[DRM_FORMAT_MAX_PLANES]; @@ -73,53 +52,10 @@ struct vkms_writeback_job { pixel_write_line_t pixel_write; }; -/** - * enum pixel_read_direction - Enum used internaly 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. - */ -typedef void (*pixel_read_line_t)(const struct 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 @@ -140,12 +76,6 @@ struct vkms_plane { struct drm_plane base; }; -struct vkms_color_lut { - struct drm_color_lut *base; - size_t lut_length; - s64 channel_value2index_ratio; -}; - /** * struct vkms_crtc_state - Driver specific CRTC state * diff --git a/drivers/gpu/drm/vkms/vkms_formats.c b/drivers/gpu/drm/vkms/vkms_formats.c index 65fdd3999441..5ab84801d8da 100644 --- a/drivers/gpu/drm/vkms/vkms_formats.c +++ b/drivers/gpu/drm/vkms/vkms_formats.c @@ -6,9 +6,12 @@ #include #include #include +#include +#include #include +#include "vkms_drv.h" #include "vkms_formats.h" /** diff --git a/drivers/gpu/drm/vkms/vkms_formats.h b/drivers/gpu/drm/vkms/vkms_formats.h index 852ab9a4cee5..62b06bc26e79 100644 --- a/drivers/gpu/drm/vkms/vkms_formats.h +++ b/drivers/gpu/drm/vkms/vkms_formats.h @@ -3,7 +3,85 @@ #ifndef _VKMS_FORMATS_H_ #define _VKMS_FORMATS_H_ -#include "vkms_drv.h" +#include + +struct vkms_plane_state; +struct vkms_writeback_job; + +struct pixel_argb_u16 { + u16 a, r, g, b; +}; + +/** + * typedef pixel_write_line_t - These functions are used to read a pixel line from a + * struct pixel_argb_u16 buffer, convert it and write it in the @wb_job. + * + * @wb: the writeback job to write the output of the conversion + * @in_pixels: Source buffer containing the line to convert + * @count: The width of a line + * @x_start: The x (width) coordinate in the destination plane + * @y_start: The y (height) coordinate in the destination plane + */ +typedef void (*pixel_write_line_t)(struct vkms_writeback_job *wb, + struct pixel_argb_u16 *in_pixels, int count, int x_start, + int y_start); + +struct line_buffer { + size_t n_pixels; + struct pixel_argb_u16 *pixels; +}; + +/** + * enum pixel_read_direction - Enum used internaly 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 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_color_lut { + struct drm_color_lut *base; + size_t lut_length; + s64 channel_value2index_ratio; +}; + +/** + * 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. + */ +typedef void (*pixel_read_line_t)(const struct vkms_plane_state *plane, int x_start, + int y_start, enum pixel_read_direction direction, int count, + struct pixel_argb_u16 out_pixel[]); pixel_read_line_t get_pixel_read_line_function(u32 format); From patchwork Wed Aug 14 09:08:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Louis Chauvet X-Patchwork-Id: 13763131 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EC4FEC531DC for ; Wed, 14 Aug 2024 09:09:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6604310E440; Wed, 14 Aug 2024 09:09:03 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=bootlin.com header.i=@bootlin.com header.b="avj3XkD8"; dkim-atps=neutral Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by gabe.freedesktop.org (Postfix) with ESMTPS id F0AF110E43C for ; Wed, 14 Aug 2024 09:09:01 +0000 (UTC) Received: by mail.gandi.net (Postfix) with ESMTPSA id BEB98E0009; Wed, 14 Aug 2024 09:08:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1723626540; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iMyLkRGQhKcP4c3c0598fLvU0CW/sowhcsEn8e+aUBU=; b=avj3XkD8sxmz7jvZL6kdKjwcnbF8+qp9sZSWKEMDv+ysGbKqNwKTPCBlHEPF+XzSsUL8PV 5lbK3JzzLWi5RPLsBu44nX8uu0ClgTnWV3kCgrOYp3tN2t4lILIgXwJqwgc2Hw6VD5yNjs 2l3mrtUrtx9SBvFPS+0CMrg4ISdirKN/qJvbGRhPO1WNIOs6IyVuENxdck3fB2Y/98Wt3i +SKwO5OH4SK/FsG3b/PadGK4uez+Ao9Me4Gf/xl9pvgsKNx3Hg0JnD4u37E+e/gQRlGeYB hMSkewZ6nc+A3dRuuQO4aqkRQFBHGd6XFQsdIwBWkKL3n0/j7KXv0vF3W/7dQg== From: Louis Chauvet Date: Wed, 14 Aug 2024 11:08:55 +0200 Subject: [PATCH RFC 2/6] drm/vkms: Extract vkms_writeback header MIME-Version: 1.0 Message-Id: <20240814-google-split-headers-v1-2-51712f088f5d@bootlin.com> References: <20240814-google-split-headers-v1-0-51712f088f5d@bootlin.com> In-Reply-To: <20240814-google-split-headers-v1-0-51712f088f5d@bootlin.com> To: Rodrigo Siqueira , Melissa Wen , =?utf-8?q?Ma=C3=ADra_Canal?= , Haneen Mohammed , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie Cc: dri-devel@lists.freedesktop.org, arthurgrillo@riseup.net, linux-kernel@vger.kernel.org, jeremie.dautheribes@bootlin.com, miquel.raynal@bootlin.com, thomas.petazzoni@bootlin.com, seanpaul@google.com, marcheu@google.com, nicolejadeyee@google.com, Louis Chauvet X-Mailer: b4 0.15-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=3863; i=louis.chauvet@bootlin.com; h=from:subject:message-id; bh=fnG8pGOeJLMxmn04io3JIQ0+cXQo2UouKDjQL6gXcyc=; b=owEBbQKS/ZANAwAIASCtLsZbECziAcsmYgBmvHQoa//98A+yCJRJ7UobkdsmAqg5qclS2rDC1 2Mgge5m9bKJAjMEAAEIAB0WIQRPj7g/vng8MQxQWQQgrS7GWxAs4gUCZrx0KAAKCRAgrS7GWxAs 4vP9D/9UrEwRUGijYD8URsz+RGG7Cgs4rMPsVOaHktAmO0zrOQ7UCkfBk402eMztG8dCGCrZRtG wbuvGiWccThGXJQJSxFyx0GCTTKKGBGYBsz5UnZAscSZG/LWRpbOPAGeWppa5agFwvecB1C9oAz 2PG0uq4ryPRXNAGNoChMfrys8rWcaMutjwwrGNXn8CYauvmEAa0UeVBOW2PeEGSiw0tlnOV0Yo1 oN3DN/nlg6mx+Ej2nXQIZQJLKxPal9ax9JgGx38dxfyi9jCkD3zvKtpU7b/ELBw8+Qyi0NJSwlw OcIP/RQXFWr/JGlnaVTq1gwgU1FXeLc1/cGNXMSiSwCzqjFSMEzIWxPcADBzN8qH/K8uynQDwmV 4lAT2Ef2i7C/RwgDKCeTwBNgjjVvgkveZPbqGnyS9SOqfQsvMmNcmIq28EO6TstUCEfLOycU/4S plVuSSryKUtPYkxdTK9KquI/a/JBlidLZUk/4Lb9MLE0EixozX1WJJ5kZhBfV7K73kP1s5Xz7FN 4jU1FBd8b1QUpiKzXzi8x5PyXRuRgulrFt6l14dgHTaZ8xg8upb0za0er/KOwp/FbUQSqLysoWJ 9BXpAbMhJ7iF+4NDYHrQw0Ub2FSsXcuzX31Q9NCVaS1bidqdZCWPUEpdkQuNxZ1c4ef5Vwt3May py+nO9+T83eRu4g== X-Developer-Key: i=louis.chauvet@bootlin.com; a=openpgp; fpr=8B7104AE9A272D6693F527F2EC1883F55E0B40A5 X-GND-Sasl: louis.chauvet@bootlin.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The vkms writeback functions are defined in a different .c, so make the same thing for the function declaration in the headers and create vkms_writeback.h. Signed-off-by: Louis Chauvet Reviewed-by: José Expósito --- drivers/gpu/drm/vkms/vkms_composer.c | 1 + drivers/gpu/drm/vkms/vkms_drv.h | 10 ---------- drivers/gpu/drm/vkms/vkms_formats.c | 2 +- drivers/gpu/drm/vkms/vkms_output.c | 2 ++ drivers/gpu/drm/vkms/vkms_writeback.c | 2 ++ drivers/gpu/drm/vkms/vkms_writeback.h | 20 ++++++++++++++++++++ 6 files changed, 26 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/vkms/vkms_composer.c b/drivers/gpu/drm/vkms/vkms_composer.c index f0cae142ac22..825011f696ee 100644 --- a/drivers/gpu/drm/vkms/vkms_composer.c +++ b/drivers/gpu/drm/vkms/vkms_composer.c @@ -12,6 +12,7 @@ #include #include "vkms_drv.h" +#include "vkms_writeback.h" static u16 pre_mul_blend_channel(u16 src, u16 dst, u16 alpha) { diff --git a/drivers/gpu/drm/vkms/vkms_drv.h b/drivers/gpu/drm/vkms/vkms_drv.h index 0db443924a15..46daa2fab6e8 100644 --- a/drivers/gpu/drm/vkms/vkms_drv.h +++ b/drivers/gpu/drm/vkms/vkms_drv.h @@ -46,13 +46,6 @@ struct vkms_frame_info { }; -struct vkms_writeback_job { - struct iosys_map data[DRM_FORMAT_MAX_PLANES]; - struct vkms_frame_info wb_frame_info; - pixel_write_line_t pixel_write; -}; - - struct vkms_plane_state; @@ -225,7 +218,4 @@ int vkms_verify_crc_source(struct drm_crtc *crtc, const char *source_name, void vkms_composer_worker(struct work_struct *work); void vkms_set_composer(struct vkms_output *out, bool enabled); -/* Writeback */ -int vkms_enable_writeback_connector(struct vkms_device *vkmsdev); - #endif /* _VKMS_DRV_H_ */ diff --git a/drivers/gpu/drm/vkms/vkms_formats.c b/drivers/gpu/drm/vkms/vkms_formats.c index 5ab84801d8da..cbfa7943e948 100644 --- a/drivers/gpu/drm/vkms/vkms_formats.c +++ b/drivers/gpu/drm/vkms/vkms_formats.c @@ -11,7 +11,7 @@ #include -#include "vkms_drv.h" +#include "vkms_writeback.h" #include "vkms_formats.h" /** diff --git a/drivers/gpu/drm/vkms/vkms_output.c b/drivers/gpu/drm/vkms/vkms_output.c index 36db2c8923cb..0c55682337a4 100644 --- a/drivers/gpu/drm/vkms/vkms_output.c +++ b/drivers/gpu/drm/vkms/vkms_output.c @@ -5,6 +5,8 @@ #include #include +#include "vkms_writeback.h" + static const struct drm_connector_funcs vkms_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .destroy = drm_connector_cleanup, diff --git a/drivers/gpu/drm/vkms/vkms_writeback.c b/drivers/gpu/drm/vkms/vkms_writeback.c index 7e0302c0830c..4a830a4c4d64 100644 --- a/drivers/gpu/drm/vkms/vkms_writeback.c +++ b/drivers/gpu/drm/vkms/vkms_writeback.c @@ -10,8 +10,10 @@ #include #include #include +#include #include "vkms_drv.h" +#include "vkms_writeback.h" #include "vkms_formats.h" static const u32 vkms_wb_formats[] = { diff --git a/drivers/gpu/drm/vkms/vkms_writeback.h b/drivers/gpu/drm/vkms/vkms_writeback.h new file mode 100644 index 000000000000..70f0c4c26c23 --- /dev/null +++ b/drivers/gpu/drm/vkms/vkms_writeback.h @@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ + +#ifndef _VKMS_WRITEBACK_H +#define _VKMS_WRITEBACK_H + +#include "vkms_drv.h" +#include "vkms_formats.h" + +struct vkms_crtc; + +struct vkms_writeback_job { + struct iosys_map data[DRM_FORMAT_MAX_PLANES]; + struct vkms_frame_info wb_frame_info; + pixel_write_line_t pixel_write; +}; + +/* Writeback */ +int vkms_enable_writeback_connector(struct vkms_device *vkmsdev); + +#endif //_VKMS_WRITEBACK_H From patchwork Wed Aug 14 09:08:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Louis Chauvet X-Patchwork-Id: 13763133 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 17BB4C531DC for ; Wed, 14 Aug 2024 09:09:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6DE8C10E442; Wed, 14 Aug 2024 09:09:06 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=bootlin.com header.i=@bootlin.com header.b="VqzqakD1"; dkim-atps=neutral Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0A43810E43C for ; Wed, 14 Aug 2024 09:09:02 +0000 (UTC) Received: by mail.gandi.net (Postfix) with ESMTPSA id C44C0E000A; Wed, 14 Aug 2024 09:09:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1723626541; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3ccj83HTETu9GyQ6a2/Qu3RNL9QxAiBPKNMjAtCQjRk=; b=VqzqakD1uHdS3CUrmhw6oU3mEoAnv2xV35zo4W7Zm6jGw3RmTAzNXjtIK/XtUM8IGcwLa1 5voA9KWcbmOf0QBTQV2Mu2RH5lrLFDyKhOOXuITL6VVjERZf/FdWU2NKeOcNiec653EnUi 5kG7/zDEgsuHSI9LpREbgQRKENTtBuAt4Uo2iR2digs+J+6clP5NlqLit9c5uCS7oeBi5O 7WRpxYUMqYRWcQCwcgc7Nyf+8aPuTtro5rum2wAkq+GHVbzhxgokXsAAaTHxozwG21ehMU YPrnkXdVo0yohswSB42wHSoaQCbOI1FQVddNPi2WO/D67segrkjWV97+Bm3Cxw== From: Louis Chauvet Date: Wed, 14 Aug 2024 11:08:56 +0200 Subject: [PATCH RFC 3/6] drm/vkms: Extract vkms_plane header MIME-Version: 1.0 Message-Id: <20240814-google-split-headers-v1-3-51712f088f5d@bootlin.com> References: <20240814-google-split-headers-v1-0-51712f088f5d@bootlin.com> In-Reply-To: <20240814-google-split-headers-v1-0-51712f088f5d@bootlin.com> To: Rodrigo Siqueira , Melissa Wen , =?utf-8?q?Ma=C3=ADra_Canal?= , Haneen Mohammed , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie Cc: dri-devel@lists.freedesktop.org, arthurgrillo@riseup.net, linux-kernel@vger.kernel.org, jeremie.dautheribes@bootlin.com, miquel.raynal@bootlin.com, thomas.petazzoni@bootlin.com, seanpaul@google.com, marcheu@google.com, nicolejadeyee@google.com, Louis Chauvet X-Mailer: b4 0.15-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=8581; i=louis.chauvet@bootlin.com; h=from:subject:message-id; bh=fyAeIkGSRQVinqmyGsIRq2K9J9tzWZ2mkZ6uyv0flas=; b=owEBbQKS/ZANAwAIASCtLsZbECziAcsmYgBmvHQoTaeK1jbPrrdym0zeLq+7iIN7/E21ILgBX MuacZOA5BqJAjMEAAEIAB0WIQRPj7g/vng8MQxQWQQgrS7GWxAs4gUCZrx0KAAKCRAgrS7GWxAs 4gfuEACHCP2YvedAr1kUJQZjd5061MCbxP2YH+90Sz4pTSku+kpDShQFucV+mIzDD5CNJSW+PGM uQnlQSdtVj9v60Mjm1HU4SZwJXEMyYQ6gac63UMjfFEioXMfMjJLdH1U8/vvekoGp5FcTptYFjg BiNcNYmg2TN0Ia9/6GXDQr2ZxmCWPr8Qdqh0wJBdYE0vaOP+lCdroBSE8/mDwDY2qYPa1OhB2Jq 3XJX+KxpkGRI2GzXFeyN6E1ZlcGm0rbpCCjFAXe8Sh8HwnGGYVV0pmWqYIV63FGlXQe6gHj7C5p VllQHq7u15XN08VK1V14+/v/RMChHPLlyUYNSrS5kBNfdUHwP5Clc+8gSGkfkdYDK3WI/aqjYWZ AF5zF03n/TYsc5HLvUxJdOzAyf87S2tKJ8qG2mYtkq1lesS7Z2pZXZWCuFGg075EMLZF/dNhrVX wWaBkeokEV2bKURs7nty3EXA1wbp+w9n91oeBj6aB38tH5tJuFKbGWvNVaqdn3YzcYkA6Fsw6Rn KVJ6XLAYz4FCNUZJxQHsl/YEFKa2hmP9PEdBFK57W5XjQRelIVkj1OklJW9as12GOAf4r5LqLqW gZuQujmWgOUbzTNOSQCPPM74IKoGLJs8sBv1f1nnY1eX7uotPNlBZxvzIb0GxV0/I20afEQ2bak lkXggAPWBx96sfA== X-Developer-Key: i=louis.chauvet@bootlin.com; a=openpgp; fpr=8B7104AE9A272D6693F527F2EC1883F55E0B40A5 X-GND-Sasl: louis.chauvet@bootlin.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" In order to properly split vkms_output function, extract all its function to its own header. Signed-off-by: Louis Chauvet Reviewed-by: José Expósito --- drivers/gpu/drm/vkms/vkms_crtc.c | 2 ++ drivers/gpu/drm/vkms/vkms_drv.h | 56 ------------------------------ drivers/gpu/drm/vkms/vkms_formats.c | 3 +- drivers/gpu/drm/vkms/vkms_output.c | 2 +- drivers/gpu/drm/vkms/vkms_plane.c | 3 ++ drivers/gpu/drm/vkms/vkms_plane.h | 65 +++++++++++++++++++++++++++++++++++ drivers/gpu/drm/vkms/vkms_writeback.c | 1 - drivers/gpu/drm/vkms/vkms_writeback.h | 1 + 8 files changed, 74 insertions(+), 59 deletions(-) diff --git a/drivers/gpu/drm/vkms/vkms_crtc.c b/drivers/gpu/drm/vkms/vkms_crtc.c index 06e28305d660..6a4de8f7a678 100644 --- a/drivers/gpu/drm/vkms/vkms_crtc.c +++ b/drivers/gpu/drm/vkms/vkms_crtc.c @@ -6,8 +6,10 @@ #include #include #include +#include #include "vkms_drv.h" +#include "vkms_plane.h" static enum hrtimer_restart vkms_vblank_simulate(struct hrtimer *timer) { diff --git a/drivers/gpu/drm/vkms/vkms_drv.h b/drivers/gpu/drm/vkms/vkms_drv.h index 46daa2fab6e8..ea73f01fcc74 100644 --- a/drivers/gpu/drm/vkms/vkms_drv.h +++ b/drivers/gpu/drm/vkms/vkms_drv.h @@ -27,48 +27,6 @@ #define VKMS_LUT_SIZE 256 -/** - * 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]; - unsigned int rotation; -}; - - -struct vkms_plane_state; - - - -/** - * 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_plane { - struct drm_plane base; -}; - /** * struct vkms_crtc_state - Driver specific CRTC state * @@ -174,9 +132,6 @@ struct vkms_device { #define to_vkms_crtc_state(target)\ container_of(target, struct vkms_crtc_state, base) -#define to_vkms_plane_state(target)\ - container_of(target, struct vkms_plane_state, base.base) - /** * vkms_crtc_init() - Initialize a crtc for vkms * @dev: drm_device associated with the vkms buffer @@ -196,17 +151,6 @@ int vkms_crtc_init(struct drm_device *dev, struct drm_crtc *crtc, int vkms_output_init(struct vkms_device *vkmsdev, int possible_crtc_index); -/** - * vkms_plane_init() - Initialize a plane - * - * @vkmsdev: vkms device containing the plane - * @type: type of plane to initialize - * @possible_crtc_index: Crtc which can be attached to the plane. The caller must ensure that - * possible_crtc_index is positive and less or equals to 31. - */ -struct vkms_plane *vkms_plane_init(struct vkms_device *vkmsdev, - enum drm_plane_type type, int possible_crtc_index); - /* CRC Support */ const char *const *vkms_get_crc_sources(struct drm_crtc *crtc, size_t *count); diff --git a/drivers/gpu/drm/vkms/vkms_formats.c b/drivers/gpu/drm/vkms/vkms_formats.c index cbfa7943e948..4e8494d4ade4 100644 --- a/drivers/gpu/drm/vkms/vkms_formats.c +++ b/drivers/gpu/drm/vkms/vkms_formats.c @@ -11,8 +11,9 @@ #include -#include "vkms_writeback.h" +#include "vkms_plane.h" #include "vkms_formats.h" +#include "vkms_writeback.h" /** * packed_pixels_offset() - Get the offset of the block containing the pixel at coordinates x/y diff --git a/drivers/gpu/drm/vkms/vkms_output.c b/drivers/gpu/drm/vkms/vkms_output.c index 0c55682337a4..09fcf242ecf7 100644 --- a/drivers/gpu/drm/vkms/vkms_output.c +++ b/drivers/gpu/drm/vkms/vkms_output.c @@ -1,11 +1,11 @@ // SPDX-License-Identifier: GPL-2.0+ -#include "vkms_drv.h" #include #include #include #include "vkms_writeback.h" +#include "vkms_plane.h" static const struct drm_connector_funcs vkms_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, diff --git a/drivers/gpu/drm/vkms/vkms_plane.c b/drivers/gpu/drm/vkms/vkms_plane.c index 9d85464ee0e9..de2c83e1b02c 100644 --- a/drivers/gpu/drm/vkms/vkms_plane.c +++ b/drivers/gpu/drm/vkms/vkms_plane.c @@ -8,9 +8,12 @@ #include #include #include +#include +#include #include "vkms_drv.h" #include "vkms_formats.h" +#include "vkms_plane.h" static const u32 vkms_formats[] = { DRM_FORMAT_ARGB8888, diff --git a/drivers/gpu/drm/vkms/vkms_plane.h b/drivers/gpu/drm/vkms/vkms_plane.h new file mode 100644 index 000000000000..161b44da0240 --- /dev/null +++ b/drivers/gpu/drm/vkms/vkms_plane.h @@ -0,0 +1,65 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ + +#ifndef _VKMS_PLANE_H +#define _VKMS_PLANE_H + +#include +#include +#include +#include + +#include "vkms_drv.h" +#include "vkms_formats.h" + +struct vkms_plane { + struct drm_plane base; +}; + +/** + * 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 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_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]; + unsigned int rotation; +}; + +/** + * vkms_plane_init() - Initialize a plane + * + * @vkmsdev: vkms device containing the plane + * @type: type of plane to initialize + * @possible_crtc_index: Crtc which can be attached to the plane. The caller must ensure that + * possible_crtc_index is positive and less or equals to 31. + */ +struct vkms_plane *vkms_plane_init(struct vkms_device *vkmsdev, + enum drm_plane_type type, int possible_crtc_index); + +#define to_vkms_plane_state(target)\ + container_of(target, struct vkms_plane_state, base.base) + +#endif //_VKMS_PLANE_H diff --git a/drivers/gpu/drm/vkms/vkms_writeback.c b/drivers/gpu/drm/vkms/vkms_writeback.c index 4a830a4c4d64..740d9e2f3d71 100644 --- a/drivers/gpu/drm/vkms/vkms_writeback.c +++ b/drivers/gpu/drm/vkms/vkms_writeback.c @@ -12,7 +12,6 @@ #include #include -#include "vkms_drv.h" #include "vkms_writeback.h" #include "vkms_formats.h" diff --git a/drivers/gpu/drm/vkms/vkms_writeback.h b/drivers/gpu/drm/vkms/vkms_writeback.h index 70f0c4c26c23..44dff15faff6 100644 --- a/drivers/gpu/drm/vkms/vkms_writeback.h +++ b/drivers/gpu/drm/vkms/vkms_writeback.h @@ -5,6 +5,7 @@ #include "vkms_drv.h" #include "vkms_formats.h" +#include "vkms_plane.h" struct vkms_crtc; From patchwork Wed Aug 14 09:08:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Louis Chauvet X-Patchwork-Id: 13763134 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 109AEC3DA4A for ; Wed, 14 Aug 2024 09:09:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6D81210E43C; Wed, 14 Aug 2024 09:09:06 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=bootlin.com header.i=@bootlin.com header.b="h4mKfWQD"; dkim-atps=neutral Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by gabe.freedesktop.org (Postfix) with ESMTPS id 07AD410E43C for ; Wed, 14 Aug 2024 09:09:03 +0000 (UTC) Received: by mail.gandi.net (Postfix) with ESMTPSA id CFA59E000B; Wed, 14 Aug 2024 09:09:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1723626542; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ay8zrJmUwREqv/Y23bPMShgknzMKJwZC2dV8queNC/Y=; b=h4mKfWQD52+1fSXg3nr+oUSUqRP16dlvYh6ZnfDHXOBeuMowoQ6HEifbM0uTw6e+1GOSc5 U116rTs3zSGwd9PyZjIZChXhWQpbSZBtZZMDCgHH9GidpkDrAGH9iKx3kbt7Q/eZXn9LCb nqb2x6TyVXXQbTp7O01CnieBgKTuIA8XCEDuY4E3GDMvBZlmfpCPtpZyzVcbjuQOUT+qb6 xVgV/zoV1wj19EGv7x9ggZ5V5awjASD+uwiYcHQ+2vO+BNRt/aCvk87QpoaIUJ+/YChu2T VXy2gQOjawesN1Ca+FV/NPXkRyxIT/PPTXKrWQnFpRhZoCFYwOOiSDUDjcoTEw== From: Louis Chauvet Date: Wed, 14 Aug 2024 11:08:57 +0200 Subject: [PATCH RFC 4/6] drm/vkms: Rename to_vkms_plane_state to avoid confusion MIME-Version: 1.0 Message-Id: <20240814-google-split-headers-v1-4-51712f088f5d@bootlin.com> References: <20240814-google-split-headers-v1-0-51712f088f5d@bootlin.com> In-Reply-To: <20240814-google-split-headers-v1-0-51712f088f5d@bootlin.com> To: Rodrigo Siqueira , Melissa Wen , =?utf-8?q?Ma=C3=ADra_Canal?= , Haneen Mohammed , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie Cc: dri-devel@lists.freedesktop.org, arthurgrillo@riseup.net, linux-kernel@vger.kernel.org, jeremie.dautheribes@bootlin.com, miquel.raynal@bootlin.com, thomas.petazzoni@bootlin.com, seanpaul@google.com, marcheu@google.com, nicolejadeyee@google.com, Louis Chauvet X-Mailer: b4 0.15-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=2452; i=louis.chauvet@bootlin.com; h=from:subject:message-id; bh=6G3NSf+iYqXCMNWCe9u4SM0a20rjAGCplRxqdIkYnmU=; b=owEBbQKS/ZANAwAIASCtLsZbECziAcsmYgBmvHQoVMrnB64ImEWuLV1/ffH74zHSaeX+KwapC 1NOvwb3in2JAjMEAAEIAB0WIQRPj7g/vng8MQxQWQQgrS7GWxAs4gUCZrx0KAAKCRAgrS7GWxAs 4ks3D/sFjCULgWSAwBy31vsNdtHOYHi/Rm3AIoApSN7eQpNRnJpYNEbHuwF+APfX5uXmrzxR8/G r92A3wqkAZTsecKvZVZsi86ZiURIbW33YuZurcVfkjIufGerj49BVz0RTUTlP/2WqowFw8fsI8J QEmHj9GLNx7MbdxjuHVVmyxekj/mub90c566RMdamb2Zq7hOvpf+rPP07m8puQ4+s/aQLZMEmhQ UQ2awVamPiDXeLVz1dyPVlwVzPJ/0xDsm1nRDXm4nhiKbxM+vM+LJNjTaF1VtBHHuG12v+ECiWf XZ4IGnh60Yy0AodkBOFwedygSbnFRmoL/t9fMLRttugTP64fAi4tNqTtn/TnjHYv74I2i5TMAT+ NeUMI2JewQxRR614GjwuYCNZnIlhD4W9967jD2vYIkQ1B0gEDJRjVpAT17BywOSHKLiRvao7xF6 KGwNAuIMylM7316Hlmu/ymGQVbbrMDLVZRVXhMm7aCOT8F3MEJNV9Uq+dbbAu38sP9h+0eWMBOc 3XcqqylNBXATQibH4J2CtdCa4DMG2GE5uAjFdIVh5jo16/BnyQRzKJLTJ30szjXB7iRD2vzSg+3 NLkMl8KS+779UekjHGhnEPr7rf3PK2Qc4Tb2CZkDUVPs4VK2ySquCiqtZT4m6xTwmh1WfutYq8U pvcxZ2+koX6Uvzg== X-Developer-Key: i=louis.chauvet@bootlin.com; a=openpgp; fpr=8B7104AE9A272D6693F527F2EC1883F55E0B40A5 X-GND-Sasl: louis.chauvet@bootlin.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The macro to_vkms_plane_state was not explicit about its expected content. Rename it to drm_plane_state_to_vkms_plane_state to avoid confusion and help the reader. Signed-off-by: Louis Chauvet Reviewed-by: José Expósito --- drivers/gpu/drm/vkms/vkms_crtc.c | 2 +- drivers/gpu/drm/vkms/vkms_plane.c | 4 ++-- drivers/gpu/drm/vkms/vkms_plane.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/vkms/vkms_crtc.c b/drivers/gpu/drm/vkms/vkms_crtc.c index 6a4de8f7a678..08e5db07aca6 100644 --- a/drivers/gpu/drm/vkms/vkms_crtc.c +++ b/drivers/gpu/drm/vkms/vkms_crtc.c @@ -212,7 +212,7 @@ static int vkms_crtc_atomic_check(struct drm_crtc *crtc, continue; vkms_state->active_planes[i++] = - to_vkms_plane_state(plane_state); + drm_plane_state_to_vkms_plane_state(plane_state); } return 0; diff --git a/drivers/gpu/drm/vkms/vkms_plane.c b/drivers/gpu/drm/vkms/vkms_plane.c index de2c83e1b02c..e549c9523a34 100644 --- a/drivers/gpu/drm/vkms/vkms_plane.c +++ b/drivers/gpu/drm/vkms/vkms_plane.c @@ -80,7 +80,7 @@ vkms_plane_duplicate_state(struct drm_plane *plane) static void vkms_plane_destroy_state(struct drm_plane *plane, struct drm_plane_state *old_state) { - struct vkms_plane_state *vkms_state = to_vkms_plane_state(old_state); + struct vkms_plane_state *vkms_state = drm_plane_state_to_vkms_plane_state(old_state); struct drm_crtc *crtc = vkms_state->base.base.crtc; if (crtc && vkms_state->frame_info->fb) { @@ -139,7 +139,7 @@ static void vkms_plane_atomic_update(struct drm_plane *plane, return; fmt = fb->format->format; - vkms_plane_state = to_vkms_plane_state(new_state); + vkms_plane_state = drm_plane_state_to_vkms_plane_state(new_state); shadow_plane_state = &vkms_plane_state->base; frame_info = vkms_plane_state->frame_info; diff --git a/drivers/gpu/drm/vkms/vkms_plane.h b/drivers/gpu/drm/vkms/vkms_plane.h index 161b44da0240..68170a75e9c9 100644 --- a/drivers/gpu/drm/vkms/vkms_plane.h +++ b/drivers/gpu/drm/vkms/vkms_plane.h @@ -59,7 +59,7 @@ struct vkms_frame_info { struct vkms_plane *vkms_plane_init(struct vkms_device *vkmsdev, enum drm_plane_type type, int possible_crtc_index); -#define to_vkms_plane_state(target)\ +#define drm_plane_state_to_vkms_plane_state(target) \ container_of(target, struct vkms_plane_state, base.base) #endif //_VKMS_PLANE_H From patchwork Wed Aug 14 09:08:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Louis Chauvet X-Patchwork-Id: 13763136 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CFFCCC531DD for ; Wed, 14 Aug 2024 09:09:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E5E3B10E445; Wed, 14 Aug 2024 09:09:06 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=bootlin.com header.i=@bootlin.com header.b="CF/GEgti"; dkim-atps=neutral Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by gabe.freedesktop.org (Postfix) with ESMTPS id F1A9910E43C for ; Wed, 14 Aug 2024 09:09:04 +0000 (UTC) Received: by mail.gandi.net (Postfix) with ESMTPSA id C2A03E000D; Wed, 14 Aug 2024 09:09:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1723626543; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=z6UosKDJXaP2EMV5da8/JOJnKc0RgpxXz1LZ5S03/EA=; b=CF/GEgtiHdVa3/6r7GN6aa7bbKHLPe4+goDsESjKBidiZyTECGlqXNGU064jmas59GcNLy Gt5DW7mgBqZflsb7G81/RaKFp+Nr8CzD3TY1DAcE41KEWj0yl16MX6aGB3Vhg9xEbL551B 9erkJKs2ZhErTPNOgHvrGtiXwKiAz3R4eWYE//426mfDSGen9knsrFHJpGkg8Rm/Z840OQ bDS+3Sfnys8TlXOMZBhn9RcgHvM8xImvGuKANYNNcnQ/jDxzTBu3BrxYhEX5T2BpQrL05y fhHkmXbdGdMJkFGz+ROxkWq0gEdworMbqLr13G+7CDvLQi3SCuQqwwXutoPatA== From: Louis Chauvet Date: Wed, 14 Aug 2024 11:08:58 +0200 Subject: [PATCH RFC 5/6] drm/vkms: Extract vkms_crtc header MIME-Version: 1.0 Message-Id: <20240814-google-split-headers-v1-5-51712f088f5d@bootlin.com> References: <20240814-google-split-headers-v1-0-51712f088f5d@bootlin.com> In-Reply-To: <20240814-google-split-headers-v1-0-51712f088f5d@bootlin.com> To: Rodrigo Siqueira , Melissa Wen , =?utf-8?q?Ma=C3=ADra_Canal?= , Haneen Mohammed , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie Cc: dri-devel@lists.freedesktop.org, arthurgrillo@riseup.net, linux-kernel@vger.kernel.org, jeremie.dautheribes@bootlin.com, miquel.raynal@bootlin.com, thomas.petazzoni@bootlin.com, seanpaul@google.com, marcheu@google.com, nicolejadeyee@google.com, Louis Chauvet X-Mailer: b4 0.15-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=8322; i=louis.chauvet@bootlin.com; h=from:subject:message-id; bh=DotzqndqSi4xIk8sQLLF1Io23DHzhqRU7pNYcFDY3zc=; b=owEBbQKS/ZANAwAIASCtLsZbECziAcsmYgBmvHQost2W+mHIl0xBpYr9QzgPU/59rN3GTLDdr hn8RZ8gIC+JAjMEAAEIAB0WIQRPj7g/vng8MQxQWQQgrS7GWxAs4gUCZrx0KAAKCRAgrS7GWxAs 4lTJD/0S9G9rCxmrGy7rO5dztOVxJZmO0X4ztRVcpfB30RMl+1fQpjBuay5Vd5JAgEmLAChP5OC 5BUCfkAkVSYU22LHjCJrlOY5uuQciW3dpdLBV1v4iZuhv9OnEa81RNavE4VAgplSrdVqi7F1MSi BvTFB/q/iNaLcj/PZJsvsa34NQYdU+wm+B8YJlbe3LItSXDtmQmV9oa3racFvhtDYvyKnyEx495 goGHieqqG2Xqt+iWKFrx+75yfRi3OjbMj3e1KV/CGMlOBt2wZTl6HCBgmCy0tf+cIfVwIdH0Ub3 jlWe5b+WKOln++lZ4Wo0bBhdFzlyEU+smFruhMEnuENNx2GSq0Dug6/2wNAMlGjkWZqgOefd7YC wr6HUZxSVHMSWpY9zRuvADUJIHy3YXnV/Z14lLn83iz/vPOh+IKXOAK5jb34xDKXitEbl5UrOR2 hDPstzsBJvmAmvIag7ujMk0E68lp0RpoNn2a4i2aIfjHhXb1fBUbxXh8uH85SCPu7uLaSynSLOB rLQnLM+717gI58NyG/1yBMlgVDd+5xDfzLF1SDBPDEovbkAVLS+dQzLdmehHWJHNaKwFCDAuVqe dYmM3X1gmm7q6JAroH3eLa1pZ7HhwWJwOPBCUQOok5NQVHlASF6SPIAuuVk7kh67jifCf1mWlxl xPyTRJhyH0j5htQ== X-Developer-Key: i=louis.chauvet@bootlin.com; a=openpgp; fpr=8B7104AE9A272D6693F527F2EC1883F55E0B40A5 X-GND-Sasl: louis.chauvet@bootlin.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The vkms crtc functions are defined in a different .c, so make the same thing for the function declaration in the headers and create vkms_crtc.h. Signed-off-by: Louis Chauvet Reviewed-by: José Expósito --- drivers/gpu/drm/vkms/vkms_composer.c | 2 +- drivers/gpu/drm/vkms/vkms_crtc.c | 2 +- drivers/gpu/drm/vkms/vkms_crtc.h | 87 +++++++++++++++++++++++++++++++++++ drivers/gpu/drm/vkms/vkms_drv.c | 1 + drivers/gpu/drm/vkms/vkms_drv.h | 45 ------------------ drivers/gpu/drm/vkms/vkms_output.c | 1 + drivers/gpu/drm/vkms/vkms_plane.h | 1 - drivers/gpu/drm/vkms/vkms_writeback.c | 1 + 8 files changed, 92 insertions(+), 48 deletions(-) diff --git a/drivers/gpu/drm/vkms/vkms_composer.c b/drivers/gpu/drm/vkms/vkms_composer.c index 825011f696ee..139d249454c4 100644 --- a/drivers/gpu/drm/vkms/vkms_composer.c +++ b/drivers/gpu/drm/vkms/vkms_composer.c @@ -11,7 +11,7 @@ #include #include -#include "vkms_drv.h" +#include "vkms_crtc.h" #include "vkms_writeback.h" static u16 pre_mul_blend_channel(u16 src, u16 dst, u16 alpha) diff --git a/drivers/gpu/drm/vkms/vkms_crtc.c b/drivers/gpu/drm/vkms/vkms_crtc.c index 08e5db07aca6..cb6e49a86745 100644 --- a/drivers/gpu/drm/vkms/vkms_crtc.c +++ b/drivers/gpu/drm/vkms/vkms_crtc.c @@ -8,7 +8,7 @@ #include #include -#include "vkms_drv.h" +#include "vkms_crtc.h" #include "vkms_plane.h" static enum hrtimer_restart vkms_vblank_simulate(struct hrtimer *timer) diff --git a/drivers/gpu/drm/vkms/vkms_crtc.h b/drivers/gpu/drm/vkms/vkms_crtc.h new file mode 100644 index 000000000000..9f5ce21f3425 --- /dev/null +++ b/drivers/gpu/drm/vkms/vkms_crtc.h @@ -0,0 +1,87 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ + +#ifndef _VKMS_CRTC_H +#define _VKMS_CRTC_H + +#include +#include +#include + +#include "vkms_writeback.h" +#include "vkms_plane.h" + +/** + * 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. + * @wb_pending: Protected by @vkms_output.composer_lock. + * @frame_start: Protected by @vkms_output.composer_lock. + * @frame_end: Protected by @vkms_output.composer_lock. + */ +struct vkms_crtc_state { + struct drm_crtc_state base; + struct work_struct composer_work; + + int num_active_planes; + struct vkms_plane_state **active_planes; + struct vkms_writeback_job *active_writeback; + struct vkms_color_lut gamma_lut; + + bool crc_pending; + bool wb_pending; + u64 frame_start; + u64 frame_end; +}; + +/** + * struct vkms_crtc - crtc internal representation + * + * @crtc: Base crtc in drm + * @wb_connecter: DRM writeback connector used for this output + * @vblank_hrtimer: + * @period_ns: + * @event: + * @composer_workq: Ordered workqueue for composer_work + * @lock: Lock used to project concurrent acces to the composer + * @composer_enabled: Protected by @lock. + * @composer_lock: Lock used internally to protect @composer_state members + * @composer_state: Protected by @lock. + */ +struct vkms_crtc { + struct drm_crtc base; + + struct drm_writeback_connector wb_connector; + struct hrtimer vblank_hrtimer; + ktime_t period_ns; + struct drm_pending_vblank_event *event; + struct workqueue_struct *composer_workq; + spinlock_t lock; + + bool composer_enabled; + struct vkms_crtc_state *composer_state; + + spinlock_t composer_lock; +}; + +#define to_vkms_crtc_state(target)\ + container_of(target, struct vkms_crtc_state, base) + +/** + * 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 + */ +int vkms_crtc_init(struct drm_device *dev, struct drm_crtc *crtc, + struct drm_plane *primary, struct drm_plane *cursor); + +#endif //_VKMS_CRTC_H diff --git a/drivers/gpu/drm/vkms/vkms_drv.c b/drivers/gpu/drm/vkms/vkms_drv.c index 5aeb43592960..5907877bdfa0 100644 --- a/drivers/gpu/drm/vkms/vkms_drv.c +++ b/drivers/gpu/drm/vkms/vkms_drv.c @@ -27,6 +27,7 @@ #include #include "vkms_drv.h" +#include "vkms_crtc.h" #include #include diff --git a/drivers/gpu/drm/vkms/vkms_drv.h b/drivers/gpu/drm/vkms/vkms_drv.h index ea73f01fcc74..943ad55e0172 100644 --- a/drivers/gpu/drm/vkms/vkms_drv.h +++ b/drivers/gpu/drm/vkms/vkms_drv.h @@ -12,8 +12,6 @@ #include #include -#include "vkms_formats.h" - #define XRES_MIN 10 #define YRES_MIN 10 @@ -27,37 +25,6 @@ #define VKMS_LUT_SIZE 256 -/** - * 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. - * @wb_pending: Protected by @vkms_output.composer_lock. - * @frame_start: Protected by @vkms_output.composer_lock. - * @frame_end: Protected by @vkms_output.composer_lock. - */ -struct vkms_crtc_state { - struct drm_crtc_state base; - struct work_struct composer_work; - - int num_active_planes; - struct vkms_plane_state **active_planes; - struct vkms_writeback_job *active_writeback; - struct vkms_color_lut gamma_lut; - - bool crc_pending; - bool wb_pending; - u64 frame_start; - u64 frame_end; -}; - /** * struct vkms_output - Internal representation of all output components in vkms * @@ -129,18 +96,6 @@ struct vkms_device { #define drm_device_to_vkms_device(target) \ container_of(target, struct vkms_device, drm) -#define to_vkms_crtc_state(target)\ - container_of(target, struct vkms_crtc_state, base) - -/** - * 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 - */ -int vkms_crtc_init(struct drm_device *dev, struct drm_crtc *crtc, - struct drm_plane *primary, struct drm_plane *cursor); /** * vkms_output_init() - Initialize all sub-components needed for a vkms device. * diff --git a/drivers/gpu/drm/vkms/vkms_output.c b/drivers/gpu/drm/vkms/vkms_output.c index 09fcf242ecf7..20073a00b200 100644 --- a/drivers/gpu/drm/vkms/vkms_output.c +++ b/drivers/gpu/drm/vkms/vkms_output.c @@ -6,6 +6,7 @@ #include "vkms_writeback.h" #include "vkms_plane.h" +#include "vkms_crtc.h" static const struct drm_connector_funcs vkms_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, diff --git a/drivers/gpu/drm/vkms/vkms_plane.h b/drivers/gpu/drm/vkms/vkms_plane.h index 68170a75e9c9..90554c9fe250 100644 --- a/drivers/gpu/drm/vkms/vkms_plane.h +++ b/drivers/gpu/drm/vkms/vkms_plane.h @@ -8,7 +8,6 @@ #include #include -#include "vkms_drv.h" #include "vkms_formats.h" struct vkms_plane { diff --git a/drivers/gpu/drm/vkms/vkms_writeback.c b/drivers/gpu/drm/vkms/vkms_writeback.c index 740d9e2f3d71..48f3f7f2e2a4 100644 --- a/drivers/gpu/drm/vkms/vkms_writeback.c +++ b/drivers/gpu/drm/vkms/vkms_writeback.c @@ -13,6 +13,7 @@ #include #include "vkms_writeback.h" +#include "vkms_crtc.h" #include "vkms_formats.h" static const u32 vkms_wb_formats[] = { From patchwork Wed Aug 14 09:08:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Louis Chauvet X-Patchwork-Id: 13763135 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 03530C52D7F for ; Wed, 14 Aug 2024 09:09:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D2C8510E444; Wed, 14 Aug 2024 09:09:06 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=bootlin.com header.i=@bootlin.com header.b="bVYNJZgJ"; dkim-atps=neutral Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by gabe.freedesktop.org (Postfix) with ESMTPS id D070A10E442 for ; Wed, 14 Aug 2024 09:09:05 +0000 (UTC) Received: by mail.gandi.net (Postfix) with ESMTPSA id B4ABFE000F; Wed, 14 Aug 2024 09:09:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1723626544; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ED+HOeGmnmUkq6frZqCsTOUYHpHML93Xa2aQzTI/HIc=; b=bVYNJZgJIA5TT4IFdWcnD+Mj1HiEl1W6mFFrkVaC7AylwWoMguJg9uqT0Fww4XBU3KQdjC PriVFsvkt50A4VHXzMSpTIPO8G4u184OpfCYb31bas5Wf3oBIupe39oDljJQkhkxYwykse ZRMXJsqbRNf4NYyAYhAgZX+DwmHu1Pv5huMuXZTUggo2EKEQ/jUnRcdwG2+kFg/g5or2RX ME1XD/ok/DqAMfAgqpM13bBihoeEtZX9jTGb4M0yTxbvq/8/FjRW08lR6o9W/D+mz/uMau BnqxartjqCQXkCMSuXlSjOytsij692CISyA76+YWuwZHVrFOSzVCwy0rOsK4zQ== From: Louis Chauvet Date: Wed, 14 Aug 2024 11:08:59 +0200 Subject: [PATCH RFC 6/6] drm/vkms: Extract vkms_composer header MIME-Version: 1.0 Message-Id: <20240814-google-split-headers-v1-6-51712f088f5d@bootlin.com> References: <20240814-google-split-headers-v1-0-51712f088f5d@bootlin.com> In-Reply-To: <20240814-google-split-headers-v1-0-51712f088f5d@bootlin.com> To: Rodrigo Siqueira , Melissa Wen , =?utf-8?q?Ma=C3=ADra_Canal?= , Haneen Mohammed , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie Cc: dri-devel@lists.freedesktop.org, arthurgrillo@riseup.net, linux-kernel@vger.kernel.org, jeremie.dautheribes@bootlin.com, miquel.raynal@bootlin.com, thomas.petazzoni@bootlin.com, seanpaul@google.com, marcheu@google.com, nicolejadeyee@google.com, Louis Chauvet X-Mailer: b4 0.15-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=3448; i=louis.chauvet@bootlin.com; h=from:subject:message-id; bh=EtMwyYObUMMt6YZytBOJHS/AQ/ejyKw1fpw/ux2RB2A=; b=owEBbQKS/ZANAwAIASCtLsZbECziAcsmYgBmvHQoS4mVVH+Y4GF0oDaeXFl+TGNQYB9N1GoWg qMODdsmgF+JAjMEAAEIAB0WIQRPj7g/vng8MQxQWQQgrS7GWxAs4gUCZrx0KAAKCRAgrS7GWxAs 4tnKEACIPsado9TgqNkuND6BhB0kJj9Q9QPUjU1v1KmUcCPCp42peWtI5jDISuaIltcZTiQYvmN 6S/RNJPseVpToo/C6NAwoIX1XSNaOx7VW8jrA6CmxHHG1KfY5Jfchsk+alunSh/bMjLGVaumdoB kOh9BvxkyZzAldsQjcEzQyQYE4aP4JTW91aanEcnq4orFsyFopQModvVO50hg2UcRMz83ooIxH+ WZACswhy9zb7FxKWLzTv+HYAo4ws7NPgopjU9eb9dz/ZzTbLfdWVdz0phCo+QsNbBi+0yKJugw5 8qwlOuadeDRNuKtR3xFx+uC18zQ1h/AAqAyzvXV3LmrdxD/KPQ/21CONjN200Ct5JTYs5Eytg2Z 3SFLY4QcHb5xt4nHEM81DQaE+Q8enUREwhrxkrH+Ea8B6lLphmMttPFPzWrTMYaP8AiIR2pn5d7 4YV8Dirp09L/5WwbwEEv4R6Xg7vHPZpe5t3Yh5lM78CNOHtvGacV+ZjSHPm+OACohgSNzMIZ4ao EnvsgZospmZC4gqpeTHvN4sf2RL2iCXFmi3XmCwMDXSdutrt2jjuxjUCCOPZNVOo0lKIXkfGy8O P+O0USZliKxzjCXnAWS+ty4CQX3PSeTbxqmLm7b2iF8d2xeVT/rhO7hCgkxtXTjy0hh3qnM8B6q 8EncGhDKXzukx/A== X-Developer-Key: i=louis.chauvet@bootlin.com; a=openpgp; fpr=8B7104AE9A272D6693F527F2EC1883F55E0B40A5 X-GND-Sasl: louis.chauvet@bootlin.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The vkms composer functions are defined in a different .c, so make the same thing for the function declaration in the headers and create vkms_composer.h. Signed-off-by: Louis Chauvet Reviewed-by: José Expósito --- drivers/gpu/drm/vkms/vkms_composer.c | 2 ++ drivers/gpu/drm/vkms/vkms_composer.h | 18 ++++++++++++++++++ drivers/gpu/drm/vkms/vkms_crtc.c | 1 + drivers/gpu/drm/vkms/vkms_drv.h | 11 ----------- drivers/gpu/drm/vkms/vkms_writeback.c | 1 + 5 files changed, 22 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/vkms/vkms_composer.c b/drivers/gpu/drm/vkms/vkms_composer.c index 139d249454c4..15ef07ed304e 100644 --- a/drivers/gpu/drm/vkms/vkms_composer.c +++ b/drivers/gpu/drm/vkms/vkms_composer.c @@ -10,7 +10,9 @@ #include #include #include +#include +#include "vkms_composer.h" #include "vkms_crtc.h" #include "vkms_writeback.h" diff --git a/drivers/gpu/drm/vkms/vkms_composer.h b/drivers/gpu/drm/vkms/vkms_composer.h new file mode 100644 index 000000000000..91b33af1e013 --- /dev/null +++ b/drivers/gpu/drm/vkms/vkms_composer.h @@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ + +#ifndef _VKMS_COMPOSER_H +#define _VKMS_COMPOSER_H + +#include "vkms_drv.h" +#include "vkms_crtc.h" + +void vkms_composer_worker(struct work_struct *work); +void vkms_set_composer(struct vkms_output *out, bool enabled); + +/* CRC Support */ +const char *const *vkms_get_crc_sources(struct drm_crtc *crtc, size_t *count); +int vkms_set_crc_source(struct drm_crtc *crtc, const char *src_name); +int vkms_verify_crc_source(struct drm_crtc *crtc, const char *source_name, + size_t *values_cnt); + +#endif //_VKMS_COMPOSER_H diff --git a/drivers/gpu/drm/vkms/vkms_crtc.c b/drivers/gpu/drm/vkms/vkms_crtc.c index cb6e49a86745..6fae43932b60 100644 --- a/drivers/gpu/drm/vkms/vkms_crtc.c +++ b/drivers/gpu/drm/vkms/vkms_crtc.c @@ -9,6 +9,7 @@ #include #include "vkms_crtc.h" +#include "vkms_composer.h" #include "vkms_plane.h" static enum hrtimer_restart vkms_vblank_simulate(struct hrtimer *timer) diff --git a/drivers/gpu/drm/vkms/vkms_drv.h b/drivers/gpu/drm/vkms/vkms_drv.h index 943ad55e0172..f74a5c2045f9 100644 --- a/drivers/gpu/drm/vkms/vkms_drv.h +++ b/drivers/gpu/drm/vkms/vkms_drv.h @@ -106,15 +106,4 @@ struct vkms_device { int vkms_output_init(struct vkms_device *vkmsdev, int possible_crtc_index); -/* CRC Support */ -const char *const *vkms_get_crc_sources(struct drm_crtc *crtc, - size_t *count); -int vkms_set_crc_source(struct drm_crtc *crtc, const char *src_name); -int vkms_verify_crc_source(struct drm_crtc *crtc, const char *source_name, - size_t *values_cnt); - -/* Composer Support */ -void vkms_composer_worker(struct work_struct *work); -void vkms_set_composer(struct vkms_output *out, bool enabled); - #endif /* _VKMS_DRV_H_ */ diff --git a/drivers/gpu/drm/vkms/vkms_writeback.c b/drivers/gpu/drm/vkms/vkms_writeback.c index 48f3f7f2e2a4..5e75880a5845 100644 --- a/drivers/gpu/drm/vkms/vkms_writeback.c +++ b/drivers/gpu/drm/vkms/vkms_writeback.c @@ -15,6 +15,7 @@ #include "vkms_writeback.h" #include "vkms_crtc.h" #include "vkms_formats.h" +#include "vkms_composer.h" static const u32 vkms_wb_formats[] = { DRM_FORMAT_ARGB8888,