public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "José Expósito" <jose.exposito89@gmail.com>
To: louis.chauvet@bootlin.com
Cc: airlied@gmail.com, arthurgrillo@riseup.net, daniel@ffwll.ch,
	dri-devel@lists.freedesktop.org, hamohammed.sa@gmail.com,
	jeremie.dautheribes@bootlin.com, linux-kernel@vger.kernel.org,
	maarten.lankhorst@linux.intel.com, mairacanal@riseup.net,
	melissa.srw@gmail.com, miquel.raynal@bootlin.com,
	mripard@kernel.org, nicolejadeyee@google.com,
	rodrigosiqueiramelo@gmail.com, seanpaul@google.com,
	thomas.petazzoni@bootlin.com, tzimmermann@suse.de
Subject: [PATCH RFC 02/15] drm/vkms: remove possible crtc from parameters
Date: Thu,  5 Sep 2024 14:33:27 +0200	[thread overview]
Message-ID: <20240905123327.3049-1-jose.exposito89@gmail.com> (raw)
In-Reply-To: <20240814-google-remove-crtc-index-from-parameter-v1-2-6e179abf9fd4@bootlin.com>

> As the crtc mask is dynamic, avoid hardcoding it. It is already computed
> once all the planes are created, so it should be a no-op
> 
> Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
> ---
>  drivers/gpu/drm/vkms/vkms_drv.c   | 10 +++++-----
>  drivers/gpu/drm/vkms/vkms_plane.c |  5 +++--
>  drivers/gpu/drm/vkms/vkms_plane.h |  4 +---
>  3 files changed, 9 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/vkms/vkms_drv.c b/drivers/gpu/drm/vkms/vkms_drv.c
> index 7ac3ab7e16e5..e71b45fcb9b8 100644
> --- a/drivers/gpu/drm/vkms/vkms_drv.c
> +++ b/drivers/gpu/drm/vkms/vkms_drv.c
> @@ -166,7 +166,7 @@ static const struct drm_connector_helper_funcs vkms_conn_helper_funcs = {
>  	.get_modes = vkms_conn_get_modes,
>  };
>  
> -static int vkms_output_init(struct vkms_device *vkmsdev, int possible_crtc)
> +static int vkms_output_init(struct vkms_device *vkmsdev)
>  {
>  	struct drm_device *dev = &vkmsdev->drm;
>  	struct drm_connector *connector;
> @@ -184,20 +184,20 @@ static int vkms_output_init(struct vkms_device *vkmsdev, int possible_crtc)
>  	 * The overlay and cursor planes are not mandatory, but can be used to perform complex
>  	 * composition.
>  	 */
> -	primary = vkms_plane_init(vkmsdev, DRM_PLANE_TYPE_PRIMARY, possible_crtc);
> +	primary = vkms_plane_init(vkmsdev, DRM_PLANE_TYPE_PRIMARY);
>  	if (IS_ERR(primary))
>  		return PTR_ERR(primary);
>  
>  	if (vkmsdev->config->overlay) {
>  		for (n = 0; n < NUM_OVERLAY_PLANES; n++) {
> -			overlay = vkms_plane_init(vkmsdev, DRM_PLANE_TYPE_OVERLAY, possible_crtc);
> +			overlay = vkms_plane_init(vkmsdev, DRM_PLANE_TYPE_OVERLAY);
>  			if (IS_ERR(overlay))
>  				return PTR_ERR(overlay);
>  		}
>  	}
>  
>  	if (vkmsdev->config->cursor) {
> -		cursor = vkms_plane_init(vkmsdev, DRM_PLANE_TYPE_CURSOR, possible_crtc);
> +		cursor = vkms_plane_init(vkmsdev, DRM_PLANE_TYPE_CURSOR);
>  		if (IS_ERR(cursor))
>  			return PTR_ERR(cursor);
>  	}
> @@ -284,7 +284,7 @@ static int vkms_modeset_init(struct vkms_device *vkmsdev)
>  	dev->mode_config.preferred_depth = 0;
>  	dev->mode_config.helper_private = &vkms_mode_config_helpers;
>  
> -	return vkms_output_init(vkmsdev, 0);
> +	return vkms_output_init(vkmsdev);
>  }
>  
>  static int vkms_create(struct vkms_config *config)
> diff --git a/drivers/gpu/drm/vkms/vkms_plane.c b/drivers/gpu/drm/vkms/vkms_plane.c
> index e549c9523a34..b5740c27180b 100644
> --- a/drivers/gpu/drm/vkms/vkms_plane.c
> +++ b/drivers/gpu/drm/vkms/vkms_plane.c
> @@ -5,6 +5,7 @@
>  #include <drm/drm_atomic.h>
>  #include <drm/drm_atomic_helper.h>
>  #include <drm/drm_blend.h>
> +#include <drm/drm_plane.h>
>  #include <drm/drm_fourcc.h>
>  #include <drm/drm_gem_atomic_helper.h>
>  #include <drm/drm_gem_framebuffer_helper.h>
> @@ -222,12 +223,12 @@ static const struct drm_plane_helper_funcs vkms_plane_helper_funcs = {
>  };
>  
>  struct vkms_plane *vkms_plane_init(struct vkms_device *vkmsdev,
> -				   enum drm_plane_type type, int possible_crtc_index)
> +				   enum drm_plane_type type)
>  {
>  	struct drm_device *dev = &vkmsdev->drm;
>  	struct vkms_plane *plane;
>  
> -	plane = drmm_universal_plane_alloc(dev, struct vkms_plane, base, 1 << possible_crtc_index,
> +	plane = drmm_universal_plane_alloc(dev, struct vkms_plane, base, 0,

Shouldn't the index be BIT(0)? I see in the commit message that
possible_crtcs is computed once all planes are added, but I
couldn't find where. It'd be nice if you could point to the
function that sets the correct CRTC mask in the commit message.

>  					   &vkms_plane_funcs,
>  					   vkms_formats, ARRAY_SIZE(vkms_formats),
>  					   NULL, type, NULL);
> diff --git a/drivers/gpu/drm/vkms/vkms_plane.h b/drivers/gpu/drm/vkms/vkms_plane.h
> index 90554c9fe250..95b2428331b8 100644
> --- a/drivers/gpu/drm/vkms/vkms_plane.h
> +++ b/drivers/gpu/drm/vkms/vkms_plane.h
> @@ -52,11 +52,9 @@ struct vkms_frame_info {
>   *
>   * @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);
> +				   enum drm_plane_type type);
>  
>  #define drm_plane_state_to_vkms_plane_state(target) \
>  	container_of(target, struct vkms_plane_state, base.base)
> 

  reply	other threads:[~2024-09-05 12:33 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-14 14:36 [PATCH RFC 00/15] drm/vkms: Introduce detailed configuration Louis Chauvet
2024-08-14 14:36 ` [PATCH RFC 01/15] drm/vkms: Remove useles devres group Louis Chauvet
2024-08-19 14:23   ` Daniel Vetter
2024-08-14 14:36 ` [PATCH RFC 02/15] drm/vkms: remove possible crtc from parameters Louis Chauvet
2024-09-05 12:33   ` José Expósito [this message]
2024-08-14 14:36 ` [PATCH RFC 03/15] drm/vkms: Extract vkms_config header Louis Chauvet
2024-09-05 12:33   ` José Expósito
2024-08-14 14:36 ` [PATCH RFC 04/15] drm/vkms: Add a validation function for vkms configuration Louis Chauvet
2024-09-05 12:33   ` José Expósito
2024-08-14 14:36 ` [PATCH RFC 05/15] drm/vkms: Move default_config creation to its own function Louis Chauvet
2024-08-14 14:36 ` [PATCH RFC 06/15] drm/vkms: Introduce plane configuration Louis Chauvet
2024-09-05 12:33   ` José Expósito
2024-08-14 14:36 ` [PATCH RFC 07/15] drm/vkms: Introduce plane name configuration Louis Chauvet
2024-09-05 12:34   ` José Expósito
2024-08-14 14:36 ` [PATCH RFC 08/15] drm/vkms: Introduce plane rotation configuration Louis Chauvet
2024-08-14 14:36 ` [PATCH RFC 09/15] drm/vkms: Introduce configuration for plane color encoding Louis Chauvet
2024-08-14 14:36 ` [PATCH RFC 10/15] drm/vkms: Introduce configuration for plane color range Louis Chauvet
2024-08-14 14:36 ` [PATCH RFC 11/15] drm: writeback: Add drm_writeback_connector cleanup Louis Chauvet
2024-08-27 14:33   ` Maxime Ripard
2024-08-27 15:42     ` Louis Chauvet
2024-08-28  8:35       ` Jani Nikula
2024-08-28  9:07         ` Louis Chauvet
2024-08-28 15:17           ` Maxime Ripard
2024-08-14 14:36 ` [PATCH RFC 12/15] drm/vkms: Add configuration for CRTCs and encoders Louis Chauvet
2024-09-05 12:34   ` José Expósito
2024-08-14 14:36 ` [PATCH RFC 13/15] drm/vkms: Add name configuration for encoders Louis Chauvet
2024-08-14 14:36 ` [PATCH RFC 14/15] drm/vkms: Add name configuration for CRTCs Louis Chauvet
2024-08-14 14:36 ` [PATCH RFC 15/15] drm/vkms: Add test for config structure Louis Chauvet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240905123327.3049-1-jose.exposito89@gmail.com \
    --to=jose.exposito89@gmail.com \
    --cc=airlied@gmail.com \
    --cc=arthurgrillo@riseup.net \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hamohammed.sa@gmail.com \
    --cc=jeremie.dautheribes@bootlin.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=louis.chauvet@bootlin.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mairacanal@riseup.net \
    --cc=melissa.srw@gmail.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=mripard@kernel.org \
    --cc=nicolejadeyee@google.com \
    --cc=rodrigosiqueiramelo@gmail.com \
    --cc=seanpaul@google.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox