From patchwork Thu Feb 22 20:46:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas X-Patchwork-Id: 205058 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp211445dyb; Thu, 22 Feb 2024 13:09:33 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCULHeo3j4501SJhNNJIS54ISyB+gBqURoY53iDtaqufvi/qOkg9BbYjCCZR9FpHCzFS94MleEFHo1A+jLA4CBvqWIiH/w== X-Google-Smtp-Source: AGHT+IFWKeO3V85rb6XHEVSYfZCBgQ5Busdmw2LacZt+loT4aFTzyl3SpPWw/fdi1LgUZbtY04nA X-Received: by 2002:a17:902:e84d:b0:1db:eec6:5b9e with SMTP id t13-20020a170902e84d00b001dbeec65b9emr1910plg.65.1708636173818; Thu, 22 Feb 2024 13:09:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708636173; cv=pass; d=google.com; s=arc-20160816; b=imcu8j3gu+/ZK/uunZv6aayh6zqyUAFwpqGdnZBkWanaJj/Dn2aY6CSmTYVxYvIVF+ zfCyQSd6DN460VDtQiTDYTKRGGO3dELhgmPY3wXslsjk/BVynRVxQ1Hu/9Miqv6fHIrZ sSrDS2t+QBsZrzbg0eMkVKpbaJY14+9ZHNMuq3PyIeDxIsoON19nQgAs8JM7cobuEiaB UMafzqlEnmZWeuXPXedmWZYuMGGKWAnOncg9QTN+dIOYKcPmsr0tALNB24GIWZChc/IK dH/qBBARDNHYqXD/Uii7tBAravMOoqN7NzAFx4336amD+Y8hUAJ5BqIzaI2aJeI+Qvkx uuEA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:feedback-id:message-id:subject:cc :from:to:date:dkim-signature; bh=37hKk11wdEdosUk5Mox6IYZzpVB1nuBp0yHYCiPBiCA=; fh=IXn9DA0oWb/WYed7umHBXmr5IB6Tj08fEnvfeY1o2Bo=; b=ASFPG3cWyyYP8XKYaqnkq4c8Xcm5ZufJTJmTnlWNdGzSueskD/IMpGpfWZTezJot4i eps7B6Vv/OC0Tzn2kqZDzdjOWcXCcHMejBnRG9qW1vFFpq2tir4QttFJpTDI3C9G7scn vMcIAkNmM1nmIDEd261donM49BwToboIjzycajZCvJEJp+tZD40scb9TqWUjv+rBunt4 WRCncp/pMxfqYDDEK12fAU0rZpJqeb5uXXOIj5UZBwflLHXQzRLNMb/OJRX5XkthSWTf VkN6cacBj6Li6RzezEkej6Dv3fQm2kmXgm6T2xkNpEThHqpDKyll71sCIRcWGIJNGRwm GLvQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail3 header.b=pxu8i3m+; arc=pass (i=1 spf=pass spfdomain=pm.me dkim=pass dkdomain=pm.me dmarc=pass fromdomain=pm.me); spf=pass (google.com: domain of linux-kernel+bounces-77333-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77333-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id l16-20020a170903245000b001d8f3acc516si9333688pls.457.2024.02.22.13.09.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 13:09:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77333-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail3 header.b=pxu8i3m+; arc=pass (i=1 spf=pass spfdomain=pm.me dkim=pass dkdomain=pm.me dmarc=pass fromdomain=pm.me); spf=pass (google.com: domain of linux-kernel+bounces-77333-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77333-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id D2F87B239A3 for ; Thu, 22 Feb 2024 20:46:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0AE2B71746; Thu, 22 Feb 2024 20:46:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pm.me header.i=@pm.me header.b="pxu8i3m+" Received: from mail-40134.protonmail.ch (mail-40134.protonmail.ch [185.70.40.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8104E6E602 for ; Thu, 22 Feb 2024 20:46:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.70.40.134 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708634788; cv=none; b=f5BXVOmYXsET1Fq00bFGHNk3CAiUaTqAG5BNCxHwU46GNJX1o/o23Kn5NYCrEDUHV6aKQ0qT4UmJwtYhm9O+XCDfRtbeMl7r73oxYOJ4SN3PDOYvpap2DKwDqhpD9n5hwjT8YlvVBjGmQ7Ey0tFKprrSD0TxTkMHb0jLjAqV/58= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708634788; c=relaxed/simple; bh=RZbTtGnSQoVrZKTPUBxfk2oeZEahvNpFCY4Du7Xyerk=; h=Date:To:From:Cc:Subject:Message-ID:MIME-Version:Content-Type; b=EXl/PiqMuq7ARA324N5oe7Rkv7tr6K84a9UqLyQx5Y5RUNEw9OvgsQFVbxcJBsgaPPnaolswICueEZtxzdS2L2wficR63KYotLEwKn4Qsxhcy6iVCxiUy29LZPKwG9suZeGItEPdPsfXRlFF/2rvDmAd8O3cTMEFp60liJlzH5Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=pm.me; spf=pass smtp.mailfrom=pm.me; dkim=pass (2048-bit key) header.d=pm.me header.i=@pm.me header.b=pxu8i3m+; arc=none smtp.client-ip=185.70.40.134 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=pm.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pm.me DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail3; t=1708634778; x=1708893978; bh=37hKk11wdEdosUk5Mox6IYZzpVB1nuBp0yHYCiPBiCA=; h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=pxu8i3m+Mw5DqxTZQTJj3lDuH4cgmbiJq2hfROBMQ0i7fGOyf9eUx3oOvJndtz16l 3CUcjVzf86CogNH5P8xztDkYeooEDdqTONXoifVk19Hpax+4UBXMCJGmgttN9Il53Z jbQgkbac1twDweKW5DgflduMUPJNeIOCZqE5nqshnngluYViQZjgH8PLwjeI/y48hR hWH5FxJLG4ppl0tixrE+TOdrlajcPhDIIrxcTKEuiWsNnhlRiJpqHXIC23LX0WoUnt 1dppLRm6tqcf8Wi9V6QKwUUl7li4t76IeV37czrb8qUkEVWDxL8JjJpThBKVKpt2oK rNEvck5V5xzJA== Date: Thu, 22 Feb 2024 20:46:09 +0000 To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org From: Nicolas Cc: Nicolas Subject: [PATCH] gpu/drm: Fix several checkpatch warnings Message-ID: <20240222204450.7943-1-ndevos-dev@pm.me> Feedback-ID: 76711691:user:proton Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791634884406343158 X-GMAIL-MSGID: 1791634884406343158 This commit includes several checkpatch for drm_connector.c: - SPDX license - Spaces before tabs - Unnecessary brackets - unsigned int is preferred over unsigned --- 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: * * 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:-`` where ```` is the KMS object ID of the - * parent connector and ```` 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:-`` where ```` is the KMS object ID of the + * parent connector and ```` 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)