dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>,
	"Javier Martinez Canillas" <javierm@redhat.com>
Cc: jfalempe@redhat.com, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v4 2/2] drm/atomic-helper: Replace drm_atomic_helper_check_crtc_state()
Date: Fri, 7 Oct 2022 10:06:26 +0200	[thread overview]
Message-ID: <cd7f1488-2e9b-11fb-a33f-bef861d31a2a@suse.de> (raw)
In-Reply-To: <Yz/VZqQN33gvk1Ab@intel.com>


[-- Attachment #1.1: Type: text/plain, Size: 1810 bytes --]

Hi

Am 07.10.22 um 09:29 schrieb Ville Syrjälä:
> On Fri, Oct 07, 2022 at 09:17:50AM +0200, Javier Martinez Canillas wrote:
>> On 10/7/22 09:07, Ville Syrjälä wrote:
>>> On Thu, Oct 06, 2022 at 10:28:12PM +0200, Javier Martinez Canillas wrote:
>>>> On 10/5/22 13:40, Thomas Zimmermann wrote:
>>>>> Rename the atomic helper function drm_atomic_helper_check_crtc_state()
>>>>> to drm_atomic_helper_check_crtc_primary_plane() and only check for an
>>>>> attached primary plane. Adapt callers.
>>>>>
>>>>> Instead of having one big function to check for various CRTC state
>>>>> conditions, we rather want smaller functions that drivers can pick
>>>>> individually.
>>>>>
>>>>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
>>>>> ---
>>>>
>>>> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
>>>>
>>>> [...]
>>>>
>>>>> +	drm_for_each_plane_mask(plane, dev, crtc_state->plane_mask) {
>>>>> +		if (plane->type == DRM_PLANE_TYPE_PRIMARY)
>>>>> +			return 0;
>>>>>   	}
>>>>
>>>> I believe the code convention is to drop the curly braces when you
>>>> have a single statement inside the a loop ?
>>>
>>> This has two.
>>>
>>
>> No, it has only one that is the if statement. So according to the Linux
>> kernel coding style AFAIU it should be written as:
>>
>> 	drm_for_each_plane_mask(plane, dev, crtc_state->plane_mask)
>> 		if (plane->type == DRM_PLANE_TYPE_PRIMARY)
>> 			return 0;
> 
> That is exactly what it says not to do.

Hey, no need to be so upfront about it. Without the outer braces, I'd 
find it hard to parse anyway.

Best regard
Thomas

> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

      parent reply	other threads:[~2022-10-07  8:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-05 11:40 [PATCH v4 0/2] drm/atomic-helpers: Fix CRTC primary-plane test Thomas Zimmermann
2022-10-05 11:40 ` [PATCH v4 1/2] drm/atomic-helper: Don't allocated plane state in CRTC check Thomas Zimmermann
2022-10-06 20:18   ` Javier Martinez Canillas
2022-10-07  6:55     ` Thomas Zimmermann
2022-10-05 11:40 ` [PATCH v4 2/2] drm/atomic-helper: Replace drm_atomic_helper_check_crtc_state() Thomas Zimmermann
2022-10-06 20:28   ` Javier Martinez Canillas
2022-10-07  7:07     ` Ville Syrjälä
2022-10-07  7:17       ` Javier Martinez Canillas
2022-10-07  7:29         ` Ville Syrjälä
2022-10-07  7:41           ` Javier Martinez Canillas
2022-10-07  8:06           ` Thomas Zimmermann [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=cd7f1488-2e9b-11fb-a33f-bef861d31a2a@suse.de \
    --to=tzimmermann@suse.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=javierm@redhat.com \
    --cc=jfalempe@redhat.com \
    --cc=ville.syrjala@linux.intel.com \
    /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