From: Ander Conselvan de Oliveira <conselvan2@gmail.com>
To: Daniel Vetter <daniel@ffwll.ch>,
Ander Conselvan de Oliveira
<ander.conselvan.de.oliveira@intel.com>
Cc: intel-gfx@lists.freedesktop.org, shuang.he@linux.intel.com
Subject: Re: [RFC][PATCH 6/8] drm/i915: Remove intel_crtc->new_config pointer
Date: Wed, 10 Dec 2014 15:48:47 +0200 [thread overview]
Message-ID: <54884F3F.3000105@gmail.com> (raw)
In-Reply-To: <20141208163610.GC27182@phenom.ffwll.local>
On 12/08/2014 06:36 PM, Daniel Vetter wrote:
> On Mon, Dec 08, 2014 at 05:21:07PM +0200, Ander Conselvan de Oliveira wrote:
>> There are no more users of that pointer since the new config is now
>> passed down the call chain during mode set. Also, when the switch to
>> atomic happens, the right config (state) should be derived from an
>> atomic state structure.
>
> Ah, doesn't seem much work actually to remove our usage of ->new_config.
> Which is nice since it'll align us more with how the helpers work.
Except for the ugliness in patch 5, it was pretty straight forward. But
that can be fixed once we have a global state object.
> So overall I think this patch series is good to go (but I've done only a
> rather cursory high-level reading).
For some reason PRTS ignored this one (maybe because it is an RFC?), so
I submitted a task manually. If that succeeds, I'll resend without the
RFC status.
Cheers,
Ander
>
> Thanks, Daniel
>
>> ---
>> drivers/gpu/drm/i915/intel_display.c | 46 ++++++++----------------------------
>> drivers/gpu/drm/i915/intel_drv.h | 1 -
>> 2 files changed, 10 insertions(+), 37 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
>> index a9f3034..a032a1d 100644
>> --- a/drivers/gpu/drm/i915/intel_display.c
>> +++ b/drivers/gpu/drm/i915/intel_display.c
>> @@ -8583,7 +8583,6 @@ retry:
>>
>> intel_crtc = to_intel_crtc(crtc);
>> intel_crtc->new_enabled = true;
>> - intel_crtc->new_config = &intel_crtc->config;
>> old->dpms_mode = connector->dpms;
>> old->load_detect_temp = true;
>> old->release_fb = NULL;
>> @@ -8623,10 +8622,6 @@ retry:
>>
>> fail:
>> intel_crtc->new_enabled = crtc->enabled;
>> - if (intel_crtc->new_enabled)
>> - intel_crtc->new_config = &intel_crtc->config;
>> - else
>> - intel_crtc->new_config = NULL;
>> fail_unlock:
>> if (ret == -EDEADLK) {
>> drm_modeset_backoff(ctx);
>> @@ -8653,7 +8648,6 @@ void intel_release_load_detect_pipe(struct drm_connector *connector,
>> to_intel_connector(connector)->new_encoder = NULL;
>> intel_encoder->new_crtc = NULL;
>> intel_crtc->new_enabled = false;
>> - intel_crtc->new_config = NULL;
>> intel_set_mode(crtc, NULL, 0, 0, NULL);
>>
>> if (old->release_fb) {
>> @@ -9839,14 +9833,8 @@ static void intel_modeset_update_staged_output_state(struct drm_device *dev)
>> to_intel_crtc(encoder->base.crtc);
>> }
>>
>> - for_each_intel_crtc(dev, crtc) {
>> + for_each_intel_crtc(dev, crtc)
>> crtc->new_enabled = crtc->base.enabled;
>> -
>> - if (crtc->new_enabled)
>> - crtc->new_config = &crtc->config;
>> - else
>> - crtc->new_config = NULL;
>> - }
>> }
>>
>> /**
>> @@ -10355,12 +10343,8 @@ intel_modeset_update_state(struct drm_device *dev, unsigned prepare_pipes)
>> intel_modeset_commit_output_state(dev);
>>
>> /* Double check state. */
>> - for_each_intel_crtc(dev, intel_crtc) {
>> + for_each_intel_crtc(dev, intel_crtc)
>> WARN_ON(intel_crtc->base.enabled != intel_crtc_in_use(&intel_crtc->base));
>> - WARN_ON(intel_crtc->new_config &&
>> - intel_crtc->new_config != &intel_crtc->config);
>> - WARN_ON(intel_crtc->base.enabled != !!intel_crtc->new_config);
>> - }
>>
>> list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
>> if (!connector->encoder || !connector->encoder->crtc)
>> @@ -10957,9 +10941,6 @@ static int __intel_set_mode(struct drm_crtc *crtc,
>>
>> *saved_mode = crtc->mode;
>>
>> - if (modeset_pipes)
>> - to_intel_crtc(crtc)->new_config = pipe_config;
>> -
>> /*
>> * See if the config requires any additional preparation, e.g.
>> * to adjust global state with pipes off. We need to do this
>> @@ -10984,7 +10965,13 @@ static int __intel_set_mode(struct drm_crtc *crtc,
>> goto done;
>>
>> for_each_intel_crtc_masked(dev, modeset_pipes, intel_crtc) {
>> - struct intel_crtc_state *state = intel_crtc->new_config;
>> + struct intel_crtc_state *state;
>> +
>> + if (&intel_crtc->base == crtc)
>> + state = pipe_config;
>> + else
>> + state = intel_crtc->config;
>> +
>> ret = dev_priv->display.crtc_compute_clock(intel_crtc,
>> state);
>> if (ret) {
>> @@ -11014,7 +11001,6 @@ static int __intel_set_mode(struct drm_crtc *crtc,
>> /* mode_set/enable/disable functions rely on a correct pipe
>> * config. */
>> to_intel_crtc(crtc)->config = *pipe_config;
>> - to_intel_crtc(crtc)->new_config = &to_intel_crtc(crtc)->config;
>>
>> /*
>> * Calculate and store various constants which
>> @@ -11177,15 +11163,9 @@ static void intel_set_config_restore_state(struct drm_device *dev,
>> int count;
>>
>> count = 0;
>> - for_each_intel_crtc(dev, crtc) {
>> + for_each_intel_crtc(dev, crtc)
>> crtc->new_enabled = config->save_crtc_enabled[count++];
>>
>> - if (crtc->new_enabled)
>> - crtc->new_config = &crtc->config;
>> - else
>> - crtc->new_config = NULL;
>> - }
>> -
>> count = 0;
>> for_each_intel_encoder(dev, encoder) {
>> encoder->new_crtc =
>> @@ -11391,11 +11371,6 @@ intel_modeset_stage_output_state(struct drm_device *dev,
>> crtc->new_enabled ? "en" : "dis");
>> config->mode_changed = true;
>> }
>> -
>> - if (crtc->new_enabled)
>> - crtc->new_config = &crtc->config;
>> - else
>> - crtc->new_config = NULL;
>> }
>>
>> return 0;
>> @@ -11422,7 +11397,6 @@ static void disable_crtc_nofb(struct intel_crtc *crtc)
>> }
>>
>> crtc->new_enabled = false;
>> - crtc->new_config = NULL;
>> }
>>
>> static int intel_crtc_set_config(struct drm_mode_set *set)
>> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
>> index 0a84667..175b853 100644
>> --- a/drivers/gpu/drm/i915/intel_drv.h
>> +++ b/drivers/gpu/drm/i915/intel_drv.h
>> @@ -440,7 +440,6 @@ struct intel_crtc {
>>
>> struct intel_plane_config plane_config;
>> struct intel_crtc_state config;
>> - struct intel_crtc_state *new_config;
>> bool new_enabled;
>>
>> /* reset counter value when the last flip was submitted */
>> --
>> 1.9.1
>>
>> _______________________________________________
>> Intel-gfx mailing list
>> Intel-gfx@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2014-12-10 13:48 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-08 15:21 [RFC][PATCH 0/8] drm/i915: Keep drm_crtc->state in sync Ander Conselvan de Oliveira
2014-12-08 15:21 ` [RFC][PATCH 1/8] drm/i915: Rename struct intel_crtc_config to intel_crtc_state Ander Conselvan de Oliveira
2014-12-08 15:21 ` [RFC][PATCH 2/8] drm/i915: Embedded struct drm_crtc_state in intel_crtc_state Ander Conselvan de Oliveira
2014-12-08 15:21 ` [RFC][PATCH 3/8] drm/i915: Pass new_config down do crtc_compute_clock Ander Conselvan de Oliveira
2014-12-08 16:32 ` Daniel Vetter
2014-12-08 15:21 ` [RFC][PATCH 4/8] drm/i915: Use local pipe_config varariable when available Ander Conselvan de Oliveira
2014-12-08 15:21 ` [RFC][PATCH 5/8] drm/i915: Don't access to crtc->new_config from intel_mode_max_pixclk() Ander Conselvan de Oliveira
2014-12-08 15:21 ` [RFC][PATCH 6/8] drm/i915: Remove intel_crtc->new_config pointer Ander Conselvan de Oliveira
2014-12-08 16:36 ` Daniel Vetter
2014-12-10 13:48 ` Ander Conselvan de Oliveira [this message]
2014-12-08 15:21 ` [RFC][PATCH 7/8] drm/i915: Make intel_crtc->config a pointer Ander Conselvan de Oliveira
2014-12-08 15:21 ` [RFC][PATCH 8/8] drm/i915: Keep drm_crtc->state in sync with intel_crtc->config Ander Conselvan de Oliveira
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=54884F3F.3000105@gmail.com \
--to=conselvan2@gmail.com \
--cc=ander.conselvan.de.oliveira@intel.com \
--cc=daniel@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
--cc=shuang.he@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