Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp595548rdb; Thu, 22 Feb 2024 13:09:24 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUYl6B0uk4+hstnbpNm5+mA+Jfzv5WhX8mMvPD9V01UjlP3OKbWVf9gxBnfOfyw9JWw694Nukzp0L+5ybIF5lzvgSjsmDOafEJSr3qB8g== X-Google-Smtp-Source: AGHT+IHJlIPsTYc5aF1Z7H9C784IPVcxB27Z4/5R/ZOcyt7MywcGCIlvVWW099fOwiZDvWp4e1qf X-Received: by 2002:a05:6358:88e:b0:17b:786a:6cef with SMTP id m14-20020a056358088e00b0017b786a6cefmr2086214rwj.13.1708636164437; Thu, 22 Feb 2024 13:09:24 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708636164; cv=pass; d=google.com; s=arc-20160816; b=NTO78oLTRJV/8MDTdW406p6FM6NgPU9urzfuxe025Y+K3OKDXhj59yzSF74kkhXUEW vuBimZsA3QjIAbiN/p5KLtqrGDWEgikO+IWD2bn9hWxFL7oLSL/5K2qHsU+3Wf9pg2Dw fGY/2orl8/8l34paeqFcXdFFTsDJTtQv2/0V0PvKSZmH4BHYdHf+YNq4o6Msw/71ANqi YS8hWDK1mptk8YpCX2Q6kavwnHjbJHHYxsawSXRSuAwgWpQx7D+GHfwvgQ0rKdZ5PUTP T7c3rxvmMbs6c4wsy8+QPRLpH/g1ZpBxd1aBaMRp1eeyCd9TBuEQ1aZZNdwbnzLs2Jrv qNbg== 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-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77333-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id u21-20020a63b555000000b005b91536981csi11072791pgo.11.2024.02.22.13.09.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 13:09:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77333-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77333-linux.lists.archive=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 6A761B23425 for ; Thu, 22 Feb 2024 20:46:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2454771729; Thu, 22 Feb 2024 20:46:30 +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 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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_connecto= r.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, =09=09=09=09 config->tile_property, =09=09=09=09 0); =20 -=09if (drm_core_check_feature(dev, DRIVER_ATOMIC)) { +=09if (drm_core_check_feature(dev, DRIVER_ATOMIC)) =09=09drm_object_attach_property(&connector->base, config->prop_crtc_id, 0= ); -=09} =20 =09connector->debugfs_entry =3D NULL; out_put_type_id: @@ -1150,70 +1150,70 @@ static const u32 dp_colorspaces =3D * DRM connectors have a few standardized properties: * * EDID: - * =09Blob property which contains the current EDID read from the sink. Th= is - * =09is useful to parse sink identification information like vendor, mode= l - * =09and serial. Drivers should update this property by calling - * =09drm_connector_update_edid_property(), usually after having parsed - * =09the EDID using drm_add_edid_modes(). Userspace cannot change this - * =09property. - * - * =09User-space should not parse the EDID to obtain information exposed v= ia - * =09other KMS properties (because the kernel might apply limits, quirks = or - * =09fixups to the EDID). For instance, user-space should not try to pars= e - * =09mode lists from the EDID. + *=09Blob property which contains the current EDID read from the sink. Thi= s + *=09is useful to parse sink identification information like vendor, model + *=09and serial. Drivers should update this property by calling + *=09drm_connector_update_edid_property(), usually after having parsed + *=09the EDID using drm_add_edid_modes(). Userspace cannot change this + *=09property. + * + *=09User-space should not parse the EDID to obtain information exposed vi= a + *=09other KMS properties (because the kernel might apply limits, quirks o= r + *=09fixups to the EDID). For instance, user-space should not try to parse + *=09mode lists from the EDID. * DPMS: - * =09Legacy property for setting the power state of the connector. For at= omic - * =09drivers this is only provided for backwards compatibility with exist= ing - * =09drivers, it remaps to controlling the "ACTIVE" property on the CRTC = the - * =09connector is linked to. Drivers should never set this property direc= tly, - * =09it is handled by the DRM core by calling the &drm_connector_funcs.dp= ms - * =09callback. For atomic drivers the remapping to the "ACTIVE" property = is - * =09implemented in the DRM core. - * - * =09Note that this property cannot be set through the MODE_ATOMIC ioctl, - * =09userspace must use "ACTIVE" on the CRTC instead. - * - * =09WARNING: - * - * =09For userspace also running on legacy drivers the "DPMS" semantics ar= e a - * =09lot more complicated. First, userspace cannot rely on the "DPMS" val= ue - * =09returned by the GETCONNECTOR actually reflecting reality, because ma= ny - * =09drivers fail to update it. For atomic drivers this is taken care of = in - * =09drm_atomic_helper_update_legacy_modeset_state(). - * - * =09The second issue is that the DPMS state is only well-defined when th= e - * =09connector is connected to a CRTC. In atomic the DRM core enforces th= at - * =09"ACTIVE" is off in such a case, no such checks exists for "DPMS". - * - * =09Finally, when enabling an output using the legacy SETCONFIG ioctl th= en - * =09"DPMS" is forced to ON. But see above, that might not be reflected i= n - * =09the software value on legacy drivers. - * - * =09Summarizing: Only set "DPMS" when the connector is known to be enabl= ed, - * =09assume that a successful SETCONFIG call also sets "DPMS" to on, and - * =09never read back the value of "DPMS" because it can be incorrect. + *=09Legacy property for setting the power state of the connector. For ato= mic + *=09drivers this is only provided for backwards compatibility with existi= ng + *=09drivers, it remaps to controlling the "ACTIVE" property on the CRTC t= he + *=09connector is linked to. Drivers should never set this property direct= ly, + *=09it is handled by the DRM core by calling the &drm_connector_funcs.dpm= s + *=09callback. For atomic drivers the remapping to the "ACTIVE" property i= s + *=09implemented in the DRM core. + * + *=09Note that this property cannot be set through the MODE_ATOMIC ioctl, + *=09userspace must use "ACTIVE" on the CRTC instead. + * + *=09WARNING: + * + *=09For userspace also running on legacy drivers the "DPMS" semantics are= a + *=09lot more complicated. First, userspace cannot rely on the "DPMS" valu= e + *=09returned by the GETCONNECTOR actually reflecting reality, because man= y + *=09drivers fail to update it. For atomic drivers this is taken care of i= n + *=09drm_atomic_helper_update_legacy_modeset_state(). + * + *=09The second issue is that the DPMS state is only well-defined when the + *=09connector is connected to a CRTC. In atomic the DRM core enforces tha= t + *=09"ACTIVE" is off in such a case, no such checks exists for "DPMS". + * + *=09Finally, when enabling an output using the legacy SETCONFIG ioctl the= n + *=09"DPMS" is forced to ON. But see above, that might not be reflected in + *=09the software value on legacy drivers. + * + *=09Summarizing: Only set "DPMS" when the connector is known to be enable= d, + *=09assume that a successful SETCONFIG call also sets "DPMS" to on, and + *=09never read back the value of "DPMS" because it can be incorrect. * PATH: - * =09Connector path property to identify how this sink is physically - * =09connected. Used by DP MST. This should be set by calling - * =09drm_connector_set_path_property(), in the case of DP MST with the - * =09path property the MST manager created. Userspace cannot change this - * =09property. - * - * =09In the case of DP MST, the property has the format - * =09``mst:-`` where ```` is the KMS object ID of = the - * =09parent connector and ```` is a hyphen-separated list of DP MS= T - * =09port numbers. Note, KMS object IDs are not guaranteed to be stable - * =09across reboots. + *=09Connector path property to identify how this sink is physically + *=09connected. Used by DP MST. This should be set by calling + *=09drm_connector_set_path_property(), in the case of DP MST with the + *=09path property the MST manager created. Userspace cannot change this + *=09property. + * + *=09In the case of DP MST, the property has the format + *=09``mst:-`` where ```` is the KMS object ID of t= he + *=09parent connector and ```` is a hyphen-separated list of DP MST + *=09port numbers. Note, KMS object IDs are not guaranteed to be stable + *=09across reboots. * TILE: - * =09Connector tile group property to indicate how a set of DRM connector - * =09compose together into one logical screen. This is used by both high-= res - * =09external screens (often only using a single cable, but exposing mult= iple - * =09DP MST sinks), or high-res integrated panels (like dual-link DSI) wh= ich - * =09are not gen-locked. Note that for tiled panels which are genlocked, = like - * =09dual-link LVDS or dual-link DSI, the driver should try to not expose= the - * =09tiling and virtualise both &drm_crtc and &drm_plane if needed. Drive= rs - * =09should update this value using drm_connector_set_tile_property(). - * =09Userspace cannot change this property. + *=09Connector tile group property to indicate how a set of DRM connector + *=09compose together into one logical screen. This is used by both high-r= es + *=09external screens (often only using a single cable, but exposing multi= ple + *=09DP MST sinks), or high-res integrated panels (like dual-link DSI) whi= ch + *=09are not gen-locked. Note that for tiled panels which are genlocked, l= ike + *=09dual-link LVDS or dual-link DSI, the driver should try to not expose = the + *=09tiling and virtualise both &drm_crtc and &drm_plane if needed. Driver= s + *=09should update this value using drm_connector_set_tile_property(). + *=09Userspace 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 =3D * to how it might fail if a different screen has been connected in t= he * interim. * non_desktop: - * =09Indicates the output should be ignored for purposes of displaying a - * =09standard desktop environment or console. This is most likely because - * =09the output device is not rectilinear. + *=09Indicates the output should be ignored for purposes of displaying a + *=09standard desktop environment or console. This is most likely because + *=09the output device is not rectilinear. * Content Protection: *=09This property is used by userspace to request the kernel protect futu= re *=09content communicated over the link. When requested, kernel will apply @@ -1399,7 +1399,7 @@ static const u32 dp_colorspaces =3D * Connectors also have one standardized atomic property: * * CRTC_ID: - * =09Mode object ID of the &drm_crtc this connector should be connected t= o. + *=09Mode 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_prope= rty); =20 /** * drm_connector_attach_tv_margin_properties - attach TV connector margin - * =09properties + *=09properties * @connector: DRM connector * * Called by a driver when it needs to attach TV margin props to a connect= or. @@ -2076,7 +2076,7 @@ int drm_connector_attach_scaling_mode_property(struct= drm_connector *connector, =09struct drm_device *dev =3D connector->dev; =09struct drm_property *scaling_mode_property; =09int i; -=09const unsigned valid_scaling_mode_mask =3D +=09const unsigned int valid_scaling_mode_mask =3D =09=09(1U << ARRAY_SIZE(drm_scaling_mode_enum_list)) - 1; =20 =09if (WARN_ON(hweight32(scaling_mode_mask) < 2 || @@ -2817,9 +2817,9 @@ int drm_connector_set_obj_prop(struct drm_mode_object= *obj, =09struct drm_connector *connector =3D obj_to_connector(obj); =20 =09/* Do DPMS ourselves */ -=09if (property =3D=3D connector->dev->mode_config.dpms_property) { +=09if (property =3D=3D connector->dev->mode_config.dpms_property) =09=09ret =3D (*connector->funcs->dpms)(connector, (int)value); -=09} else if (connector->funcs->set_property) +=09else if (connector->funcs->set_property) =09=09ret =3D connector->funcs->set_property(connector, property, value); =20 =09if (!ret) --=20 2.42.0