From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: Thierry Reding <thierry.reding@gmail.com>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 8/9] drm/atomic: Remove drm_atomic_connectors_for_crtc.
Date: Tue, 8 Dec 2015 09:30:56 +0100 [thread overview]
Message-ID: <56669540.40602@linux.intel.com> (raw)
In-Reply-To: <20151207103444.GB13177@ulmo>
Op 07-12-15 om 11:34 schreef Thierry Reding:
> On Tue, Nov 24, 2015 at 10:34:35AM +0100, Maarten Lankhorst wrote:
> [...]
>> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
>> index cee31d43cd1c..fb79c54b2aed 100644
>> --- a/drivers/gpu/drm/drm_atomic_helper.c
>> +++ b/drivers/gpu/drm/drm_atomic_helper.c
>> @@ -420,8 +420,6 @@ drm_atomic_helper_check_modeset(struct drm_device *dev,
>> * crtc only changed its mode but has the same set of connectors.
>> */
>> for_each_crtc_in_state(state, crtc, crtc_state, i) {
>> - int num_connectors;
>> -
>> /*
>> * We must set ->active_changed after walking connectors for
>> * otherwise an update that only changes active would result in
>> @@ -449,10 +447,7 @@ drm_atomic_helper_check_modeset(struct drm_device *dev,
>> if (ret != 0)
>> return ret;
>>
>> - num_connectors = drm_atomic_connectors_for_crtc(state,
>> - crtc);
>> -
>> - if (crtc_state->enable != !!num_connectors) {
>> + if (crtc_state->enable != !!crtc_state->connector_mask) {
> I have difficulty to doubly negate in my head, so something like this
> would be a lot clearer in my opinion:
Maybe if enable == !connector_mask?
> bool enable = crtc_state->connector_mask != 0;
>
> ...
>
> if (crtc_state->enable != enable)
> ...
>
> Or perhaps even:
>
> bool disable = crtc_state->connector_mask == 0;
>
> ...
>
> if (crtc_state->enable == disable)
> ...
>
>> DRM_DEBUG_ATOMIC("[CRTC:%d] enabled/connectors mismatch\n",
>> crtc->base.id);
>>
>> @@ -1668,7 +1663,7 @@ static int update_output_state(struct drm_atomic_state *state,
>> if (crtc == set->crtc)
>> continue;
>>
>> - if (!drm_atomic_connectors_for_crtc(state, crtc)) {
>> + if (!crtc_state->connector_mask) {
> Similarly I think it would be more natural to say:
>
> if (crtc->state->connector_mask == 0)
>
> here.
>
> Anyway, this is mostly about personal taste, and the change looks
> correct to me (after checking twice that I got the double negation
> right), so:
>
> Reviewed-by: Thierry Reding <treding@nvidia.com>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2015-12-08 8:30 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-24 9:34 [PATCH 0/9] drm/atomic: Add encoder_mask and connector_mask to crtc_state Maarten Lankhorst
2015-11-24 9:34 ` [PATCH 1/9] drm/i915: Set connector_state->connector correctly Maarten Lankhorst
2015-11-24 9:34 ` [PATCH 2/9] drm/tegra: Assign conn_state->connector when allocating connector state Maarten Lankhorst
2015-11-24 9:37 ` Thierry Reding
2015-11-24 10:37 ` Daniel Vetter
2015-11-24 10:51 ` Thierry Reding
2015-11-24 11:26 ` Maarten Lankhorst
2015-11-24 13:35 ` [PATCH 1/3] drm/i915: Set connector_state->connector using the helper Maarten Lankhorst
2015-11-24 13:35 ` [PATCH 2/3] drm/atomic: Add __drm_atomic_helper_connector_reset Maarten Lankhorst
2015-12-07 9:58 ` Thierry Reding
2015-12-07 9:58 ` Thierry Reding
2015-11-24 13:35 ` [PATCH 3/3] drm/tegra: Use __drm_atomic_helper_reset_connector for subclassing connector state Maarten Lankhorst
2015-12-07 10:02 ` Thierry Reding
2015-12-08 8:13 ` Maarten Lankhorst
2015-11-24 9:34 ` [PATCH 3/9] drm/core: Add drm_encoder_index Maarten Lankhorst
2015-11-24 9:34 ` [PATCH 4/9] drm/core: Add drm_for_each_encoder_mask Maarten Lankhorst
2015-11-24 18:00 ` [Intel-gfx] " Jani Nikula
2015-11-24 18:07 ` David Herrmann
2015-11-24 9:34 ` [PATCH 5/9] drm/atomic: add connector mask to drm_crtc_state Maarten Lankhorst
2015-12-07 10:24 ` Thierry Reding
2015-11-24 9:34 ` [PATCH 6/9] drm/i915: Update connector_mask during readout Maarten Lankhorst
2015-11-24 10:38 ` Daniel Vetter
2015-11-24 11:30 ` [Intel-gfx] " Maarten Lankhorst
2015-12-07 10:36 ` Thierry Reding
2015-11-24 9:34 ` [PATCH 7/9] drm/atomic: Small documentation fix Maarten Lankhorst
2015-11-24 10:48 ` Daniel Vetter
2015-11-24 9:34 ` [PATCH 8/9] drm/atomic: Remove drm_atomic_connectors_for_crtc Maarten Lankhorst
2015-12-07 10:34 ` Thierry Reding
2015-12-08 8:30 ` Maarten Lankhorst [this message]
2015-11-24 9:34 ` [PATCH 9/9] drm/atomic: Add encoder_mask to crtc_state Maarten Lankhorst
2015-12-03 9:53 ` [Intel-gfx] " Daniel Vetter
2015-12-03 11:01 ` Maarten Lankhorst
2015-12-04 8:12 ` [Intel-gfx] " Daniel Vetter
2015-12-14 12:06 ` Maarten Lankhorst
2015-12-15 9:17 ` Daniel Vetter
2015-12-17 9:06 ` Maarten Lankhorst
2015-12-17 9:52 ` [Intel-gfx] " Daniel Vetter
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=56669540.40602@linux.intel.com \
--to=maarten.lankhorst@linux.intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=thierry.reding@gmail.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