All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Nicolas <ndevos-dev@pm.me>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Cc: Nicolas <ndevos-dev@pm.me>
Subject: Re: [PATCH] gpu/drm: Fix several checkpatch warnings
Date: Mon, 26 Feb 2024 13:07:58 +0200	[thread overview]
Message-ID: <87msrno54h.fsf@intel.com> (raw)
In-Reply-To: <20240222204450.7943-1-ndevos-dev@pm.me>

On Thu, 22 Feb 2024, Nicolas <ndevos-dev@pm.me> wrote:
> This commit includes several checkpatch for drm_connector.c:
> - SPDX license
> - Spaces before tabs
> - Unnecessary brackets
> - unsigned int is preferred over unsigned

One change per patch, please.

Signed-off-by missing.

> ---
>  drivers/gpu/drm/drm_connector.c | 142 ++++++++++++++++----------------
>  1 file changed, 71 insertions(+), 71 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> index b0516505f7ae..4e6c910e339b 100644
> --- a/drivers/gpu/drm/drm_connector.c
> +++ b/drivers/gpu/drm/drm_connector.c
> @@ -1,3 +1,4 @@
> +// SPDX-License-Identifier: GPL-2.0 or MIT
>  /*
>   * Copyright (c) 2016 Intel Corporation
>   *
> @@ -313,9 +314,8 @@ static int __drm_connector_init(struct drm_device *dev,
>  				   config->tile_property,
>  				   0);
>  
> -	if (drm_core_check_feature(dev, DRIVER_ATOMIC)) {
> +	if (drm_core_check_feature(dev, DRIVER_ATOMIC))
>  		drm_object_attach_property(&connector->base, config->prop_crtc_id, 0);
> -	}
>  
>  	connector->debugfs_entry = NULL;
>  out_put_type_id:
> @@ -1150,70 +1150,70 @@ static const u32 dp_colorspaces =
>   * DRM connectors have a few standardized properties:
>   *

In the comments below, please switch to spaces instead of tabs.

BR,
Jani.

>   * EDID:
> - * 	Blob property which contains the current EDID read from the sink. This
> - * 	is useful to parse sink identification information like vendor, model
> - * 	and serial. Drivers should update this property by calling
> - * 	drm_connector_update_edid_property(), usually after having parsed
> - * 	the EDID using drm_add_edid_modes(). Userspace cannot change this
> - * 	property.
> - *
> - * 	User-space should not parse the EDID to obtain information exposed via
> - * 	other KMS properties (because the kernel might apply limits, quirks or
> - * 	fixups to the EDID). For instance, user-space should not try to parse
> - * 	mode lists from the EDID.
> + *	Blob property which contains the current EDID read from the sink. This
> + *	is useful to parse sink identification information like vendor, model
> + *	and serial. Drivers should update this property by calling
> + *	drm_connector_update_edid_property(), usually after having parsed
> + *	the EDID using drm_add_edid_modes(). Userspace cannot change this
> + *	property.
> + *
> + *	User-space should not parse the EDID to obtain information exposed via
> + *	other KMS properties (because the kernel might apply limits, quirks or
> + *	fixups to the EDID). For instance, user-space should not try to parse
> + *	mode lists from the EDID.
>   * DPMS:
> - * 	Legacy property for setting the power state of the connector. For atomic
> - * 	drivers this is only provided for backwards compatibility with existing
> - * 	drivers, it remaps to controlling the "ACTIVE" property on the CRTC the
> - * 	connector is linked to. Drivers should never set this property directly,
> - * 	it is handled by the DRM core by calling the &drm_connector_funcs.dpms
> - * 	callback. For atomic drivers the remapping to the "ACTIVE" property is
> - * 	implemented in the DRM core.
> - *
> - * 	Note that this property cannot be set through the MODE_ATOMIC ioctl,
> - * 	userspace must use "ACTIVE" on the CRTC instead.
> - *
> - * 	WARNING:
> - *
> - * 	For userspace also running on legacy drivers the "DPMS" semantics are a
> - * 	lot more complicated. First, userspace cannot rely on the "DPMS" value
> - * 	returned by the GETCONNECTOR actually reflecting reality, because many
> - * 	drivers fail to update it. For atomic drivers this is taken care of in
> - * 	drm_atomic_helper_update_legacy_modeset_state().
> - *
> - * 	The second issue is that the DPMS state is only well-defined when the
> - * 	connector is connected to a CRTC. In atomic the DRM core enforces that
> - * 	"ACTIVE" is off in such a case, no such checks exists for "DPMS".
> - *
> - * 	Finally, when enabling an output using the legacy SETCONFIG ioctl then
> - * 	"DPMS" is forced to ON. But see above, that might not be reflected in
> - * 	the software value on legacy drivers.
> - *
> - * 	Summarizing: Only set "DPMS" when the connector is known to be enabled,
> - * 	assume that a successful SETCONFIG call also sets "DPMS" to on, and
> - * 	never read back the value of "DPMS" because it can be incorrect.
> + *	Legacy property for setting the power state of the connector. For atomic
> + *	drivers this is only provided for backwards compatibility with existing
> + *	drivers, it remaps to controlling the "ACTIVE" property on the CRTC the
> + *	connector is linked to. Drivers should never set this property directly,
> + *	it is handled by the DRM core by calling the &drm_connector_funcs.dpms
> + *	callback. For atomic drivers the remapping to the "ACTIVE" property is
> + *	implemented in the DRM core.
> + *
> + *	Note that this property cannot be set through the MODE_ATOMIC ioctl,
> + *	userspace must use "ACTIVE" on the CRTC instead.
> + *
> + *	WARNING:
> + *
> + *	For userspace also running on legacy drivers the "DPMS" semantics are a
> + *	lot more complicated. First, userspace cannot rely on the "DPMS" value
> + *	returned by the GETCONNECTOR actually reflecting reality, because many
> + *	drivers fail to update it. For atomic drivers this is taken care of in
> + *	drm_atomic_helper_update_legacy_modeset_state().
> + *
> + *	The second issue is that the DPMS state is only well-defined when the
> + *	connector is connected to a CRTC. In atomic the DRM core enforces that
> + *	"ACTIVE" is off in such a case, no such checks exists for "DPMS".
> + *
> + *	Finally, when enabling an output using the legacy SETCONFIG ioctl then
> + *	"DPMS" is forced to ON. But see above, that might not be reflected in
> + *	the software value on legacy drivers.
> + *
> + *	Summarizing: Only set "DPMS" when the connector is known to be enabled,
> + *	assume that a successful SETCONFIG call also sets "DPMS" to on, and
> + *	never read back the value of "DPMS" because it can be incorrect.
>   * PATH:
> - * 	Connector path property to identify how this sink is physically
> - * 	connected. Used by DP MST. This should be set by calling
> - * 	drm_connector_set_path_property(), in the case of DP MST with the
> - * 	path property the MST manager created. Userspace cannot change this
> - * 	property.
> - *
> - * 	In the case of DP MST, the property has the format
> - * 	``mst:<parent>-<ports>`` where ``<parent>`` is the KMS object ID of the
> - * 	parent connector and ``<ports>`` is a hyphen-separated list of DP MST
> - * 	port numbers. Note, KMS object IDs are not guaranteed to be stable
> - * 	across reboots.
> + *	Connector path property to identify how this sink is physically
> + *	connected. Used by DP MST. This should be set by calling
> + *	drm_connector_set_path_property(), in the case of DP MST with the
> + *	path property the MST manager created. Userspace cannot change this
> + *	property.
> + *
> + *	In the case of DP MST, the property has the format
> + *	``mst:<parent>-<ports>`` where ``<parent>`` is the KMS object ID of the
> + *	parent connector and ``<ports>`` is a hyphen-separated list of DP MST
> + *	port numbers. Note, KMS object IDs are not guaranteed to be stable
> + *	across reboots.
>   * TILE:
> - * 	Connector tile group property to indicate how a set of DRM connector
> - * 	compose together into one logical screen. This is used by both high-res
> - * 	external screens (often only using a single cable, but exposing multiple
> - * 	DP MST sinks), or high-res integrated panels (like dual-link DSI) which
> - * 	are not gen-locked. Note that for tiled panels which are genlocked, like
> - * 	dual-link LVDS or dual-link DSI, the driver should try to not expose the
> - * 	tiling and virtualise both &drm_crtc and &drm_plane if needed. Drivers
> - * 	should update this value using drm_connector_set_tile_property().
> - * 	Userspace cannot change this property.
> + *	Connector tile group property to indicate how a set of DRM connector
> + *	compose together into one logical screen. This is used by both high-res
> + *	external screens (often only using a single cable, but exposing multiple
> + *	DP MST sinks), or high-res integrated panels (like dual-link DSI) which
> + *	are not gen-locked. Note that for tiled panels which are genlocked, like
> + *	dual-link LVDS or dual-link DSI, the driver should try to not expose the
> + *	tiling and virtualise both &drm_crtc and &drm_plane if needed. Drivers
> + *	should update this value using drm_connector_set_tile_property().
> + *	Userspace cannot change this property.
>   * link-status:
>   *      Connector link-status property to indicate the status of link. The
>   *      default value of link-status is "GOOD". If something fails during or
> @@ -1247,9 +1247,9 @@ static const u32 dp_colorspaces =
>   *      to how it might fail if a different screen has been connected in the
>   *      interim.
>   * non_desktop:
> - * 	Indicates the output should be ignored for purposes of displaying a
> - * 	standard desktop environment or console. This is most likely because
> - * 	the output device is not rectilinear.
> + *	Indicates the output should be ignored for purposes of displaying a
> + *	standard desktop environment or console. This is most likely because
> + *	the output device is not rectilinear.
>   * Content Protection:
>   *	This property is used by userspace to request the kernel protect future
>   *	content communicated over the link. When requested, kernel will apply
> @@ -1399,7 +1399,7 @@ static const u32 dp_colorspaces =
>   * Connectors also have one standardized atomic property:
>   *
>   * CRTC_ID:
> - * 	Mode object ID of the &drm_crtc this connector should be connected to.
> + *	Mode object ID of the &drm_crtc this connector should be connected to.
>   *
>   * Connectors for LCD panels may also have one standardized property:
>   *
> @@ -1721,7 +1721,7 @@ EXPORT_SYMBOL(drm_connector_attach_content_type_property);
>  
>  /**
>   * drm_connector_attach_tv_margin_properties - attach TV connector margin
> - * 	properties
> + *	properties
>   * @connector: DRM connector
>   *
>   * Called by a driver when it needs to attach TV margin props to a connector.
> @@ -2076,7 +2076,7 @@ int drm_connector_attach_scaling_mode_property(struct drm_connector *connector,
>  	struct drm_device *dev = connector->dev;
>  	struct drm_property *scaling_mode_property;
>  	int i;
> -	const unsigned valid_scaling_mode_mask =
> +	const unsigned int valid_scaling_mode_mask =
>  		(1U << ARRAY_SIZE(drm_scaling_mode_enum_list)) - 1;
>  
>  	if (WARN_ON(hweight32(scaling_mode_mask) < 2 ||
> @@ -2817,9 +2817,9 @@ int drm_connector_set_obj_prop(struct drm_mode_object *obj,
>  	struct drm_connector *connector = obj_to_connector(obj);
>  
>  	/* Do DPMS ourselves */
> -	if (property == connector->dev->mode_config.dpms_property) {
> +	if (property == connector->dev->mode_config.dpms_property)
>  		ret = (*connector->funcs->dpms)(connector, (int)value);
> -	} else if (connector->funcs->set_property)
> +	else if (connector->funcs->set_property)
>  		ret = connector->funcs->set_property(connector, property, value);
>  
>  	if (!ret)

-- 
Jani Nikula, Intel

      reply	other threads:[~2024-02-26 11:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-22 20:46 [PATCH] gpu/drm: Fix several checkpatch warnings Nicolas
2024-02-26 11:07 ` Jani Nikula [this message]

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=87msrno54h.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=airlied@gmail.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=ndevos-dev@pm.me \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.