lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87bk0c40f1.fsf@intel.com>
Date: Wed, 25 Sep 2024 11:12:18 +0300
From: Jani Nikula <jani.nikula@...ux.intel.com>
To: Jessica Zhang <quic_jesszhan@...cinc.com>, Rob Clark
 <robdclark@...il.com>, Dmitry Baryshkov <dmitry.baryshkov@...aro.org>,
 quic_abhinavk@...cinc.com, Sean Paul <sean@...rly.run>, Marijn Suijten
 <marijn.suijten@...ainline.org>, David
 Airlie <airlied@...il.com>, Daniel Vetter <daniel@...ll.ch>, Maarten
 Lankhorst <maarten.lankhorst@...ux.intel.com>, Maxime Ripard
 <mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>
Cc: quic_ebharadw@...cinc.com, linux-arm-msm@...r.kernel.org,
 dri-devel@...ts.freedesktop.org, freedreno@...ts.freedesktop.org,
 linux-kernel@...r.kernel.org, Rob Clark <robdclark@...omium.org>, Ville
 Syrjälä <ville.syrjala@...ux.intel.com>, Jessica Zhang
 <quic_jesszhan@...cinc.com>
Subject: Re: [PATCH v2 01/22] drm: add clone mode check for CRTC

On Tue, 24 Sep 2024, Jessica Zhang <quic_jesszhan@...cinc.com> wrote:
> Add helper to check if the given CRTC state is in clone mode
>
> Signed-off-by: Jessica Zhang <quic_jesszhan@...cinc.com>
> ---
>  include/drm/drm_crtc.h | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
> index 8b48a1974da3..ecb93e2c4afc 100644
> --- a/include/drm/drm_crtc.h
> +++ b/include/drm/drm_crtc.h
> @@ -1323,5 +1323,12 @@ static inline struct drm_crtc *drm_crtc_find(struct drm_device *dev,
>  
>  int drm_crtc_create_scaling_filter_property(struct drm_crtc *crtc,
>  					    unsigned int supported_filters);
> +static inline bool drm_crtc_in_clone_mode(struct drm_crtc_state *crtc_state)
> +{
> +	if (!crtc_state)
> +		return false;
> +
> +	return hweight32(crtc_state->encoder_mask) > 1;
> +}

What's the benefit of this being static inline?

You're implicitly depending on hweight32() being available, basically
<linux/bitops.h> being included. Maybe it already is, but it's the
accumulation of small and innocent looking things like this that then
explode the header dependencies, and make them harder to reduce.

BR,
Jani.

>  
>  #endif /* __DRM_CRTC_H__ */

-- 
Jani Nikula, Intel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ