From: Ander Conselvan De Oliveira <conselvan2@gmail.com>
To: "Konduru, Chandra" <chandra.konduru@intel.com>
Cc: "intel-gfx@lists.freedesktop.org" <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 07/19] drm/i915: Copy the staged connector config to the legacy atomic state
Date: Thu, 19 Mar 2015 09:52:08 +0200 [thread overview]
Message-ID: <1426751528.2824.43.camel@gmail.com> (raw)
In-Reply-To: <76A9B330A4D78C4D99CB292C4CC06C0E36F7B6F0@fmsmsx101.amr.corp.intel.com>
On Thu, 2015-03-19 at 00:38 +0000, Konduru, Chandra wrote:
>
> > -----Original Message-----
> > From: Conselvan De Oliveira, Ander
> > Sent: Friday, March 13, 2015 2:49 AM
> > To: intel-gfx@lists.freedesktop.org
> > Cc: Konduru, Chandra; Conselvan De Oliveira, Ander
> > Subject: [PATCH 07/19] drm/i915: Copy the staged connector config to the
> > legacy atomic state
> >
> > With this in place, we can start converting pieces of the modeset code to look at
> > the connector atomic state instead of the staged config.
> >
> > v2: Handle the load detect staged config changes too. (Ander)
> > Remove unnecessary blank line. (Daniel)
> >
> > Signed-off-by: Ander Conselvan de Oliveira
> > <ander.conselvan.de.oliveira@intel.com>
> > ---
> > drivers/gpu/drm/i915/intel_display.c | 52
> > +++++++++++++++++++++++++++++++-----
> > 1 file changed, 45 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_display.c
> > b/drivers/gpu/drm/i915/intel_display.c
> > index abdbd0c..6465f6d 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -8805,6 +8805,7 @@ bool intel_get_load_detect_pipe(struct
> > drm_connector *connector,
> > struct drm_framebuffer *fb;
> > struct drm_mode_config *config = &dev->mode_config;
> > struct drm_atomic_state *state = NULL;
> > + struct drm_connector_state *connector_state;
> > int ret, i = -1;
> >
> > DRM_DEBUG_KMS("[CONNECTOR:%d:%s], [ENCODER:%d:%s]\n", @@
> > -8892,6 +8893,15 @@ retry:
> >
> > state->acquire_ctx = ctx;
> >
> > + connector_state = drm_atomic_get_connector_state(state, connector);
> > + if (IS_ERR(connector_state)) {
> > + ret = PTR_ERR(connector_state);
> > + goto fail;
> > + }
> > +
> > + connector_state->crtc = crtc;
> > + connector_state->best_encoder = &intel_encoder->base;
> > +
> > if (!mode)
> > mode = &load_detect_mode;
> >
> > @@ -8957,6 +8967,7 @@ void intel_release_load_detect_pipe(struct
> > drm_connector *connector,
> > struct drm_crtc *crtc = encoder->crtc;
> > struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
> > struct drm_atomic_state *state;
> > + struct drm_connector_state *connector_state;
> >
> > DRM_DEBUG_KMS("[CONNECTOR:%d:%s], [ENCODER:%d:%s]\n",
> > connector->base.id, connector->name, @@ -8964,17
> > +8975,23 @@ void intel_release_load_detect_pipe(struct drm_connector
> > *connector,
> >
> > if (old->load_detect_temp) {
> > state = drm_atomic_state_alloc(dev);
> > - if (!state) {
> > - DRM_DEBUG_KMS("can't release load detect pipe\n");
> > - return;
> > - }
> > + if (!state)
> > + goto fail;
>
> Is the above deletion of lines from code added by another patch in this series or
> from a different series? May be you can squash them into one.
That was added in patch 3, the one that adds the drm_atomic_state
parameter to intel_set_mode(). I chose to do it that way in order to not
complicate that patch unnecessarily. It wasn't possible to convert each
different call to intel_set_mode() separately, since that would create a
state of breakage that prevents bisecting.
So the approach I found most reasonable was to just add the state
parameter in patch number 3, and leave the proper population of the
atomic state to a separate patch. The main idea was to simplify the
review process.
>
> >
> > state->acquire_ctx = ctx;
> >
> > + connector_state = drm_atomic_get_connector_state(state,
> > connector);
> > + if (IS_ERR(connector_state))
> > + goto fail;
> > +
> > to_intel_connector(connector)->new_encoder = NULL;
> > intel_encoder->new_crtc = NULL;
> > intel_crtc->new_enabled = false;
> > intel_crtc->new_config = NULL;
> > +
> > + connector_state->best_encoder = NULL;
> > + connector_state->crtc = NULL;
> > +
> > intel_set_mode(crtc, NULL, 0, 0, NULL, state);
> >
> > drm_atomic_state_free(state);
> > @@ -8990,6 +9007,11 @@ void intel_release_load_detect_pipe(struct
> > drm_connector *connector,
> > /* Switch crtc and encoder back off if necessary */
> > if (old->dpms_mode != DRM_MODE_DPMS_ON)
> > connector->funcs->dpms(connector, old->dpms_mode);
> > +
> > + return;
> > +fail:
> > + DRM_DEBUG_KMS("Couldn't release load detect pipe.\n");
> > + drm_atomic_state_free(state);
> > }
>
> Learning while reviewing connector/encoder side of handling.
> But I think someone also should look at the encoder/connector side or
> atomic handling.
I think Daniel already did a high level review of this. Perhaps he could
do it again for v2 of this patch.
Ander
> >
> > static int i9xx_pll_refclk(struct drm_device *dev, @@ -11646,9 +11668,11 @@
> > intel_set_config_compute_mode_changes(struct drm_mode_set *set, static int
> > intel_modeset_stage_output_state(struct drm_device *dev,
> > struct drm_mode_set *set,
> > - struct intel_set_config *config)
> > + struct intel_set_config *config,
> > + struct drm_atomic_state *state)
> > {
> > struct intel_connector *connector;
> > + struct drm_connector_state *connector_state;
> > struct intel_encoder *encoder;
> > struct intel_crtc *crtc;
> > int ro;
> > @@ -11712,6 +11736,14 @@ intel_modeset_stage_output_state(struct
> > drm_device *dev,
> > }
> > connector->new_encoder->new_crtc = to_intel_crtc(new_crtc);
> >
> > + connector_state =
> > + drm_atomic_get_connector_state(state, &connector-
> > >base);
> > + if (IS_ERR(connector_state))
> > + return PTR_ERR(connector_state);
> > +
> > + connector_state->crtc = new_crtc;
> > + connector_state->best_encoder = &connector->new_encoder-
> > >base;
> > +
> > DRM_DEBUG_KMS("[CONNECTOR:%d:%s] to [CRTC:%d]\n",
> > connector->base.base.id,
> > connector->base.name,
> > @@ -11744,9 +11776,15 @@ intel_modeset_stage_output_state(struct
> > drm_device *dev,
> > }
> > /* Now we've also updated encoder->new_crtc for all encoders. */
> > for_each_intel_connector(dev, connector) {
> > - if (connector->new_encoder)
> > + connector_state =
> > + drm_atomic_get_connector_state(state, &connector-
> > >base);
> > +
> > + if (connector->new_encoder) {
> > if (connector->new_encoder != connector->encoder)
> > connector->encoder = connector-
> > >new_encoder;
> > + } else {
> > + connector_state->crtc = NULL;
> > + }
> > }
> > for_each_intel_crtc(dev, crtc) {
> > crtc->new_enabled = false;
> > @@ -11855,7 +11893,7 @@ static int intel_crtc_set_config(struct
> > drm_mode_set *set)
> >
> > state->acquire_ctx = dev->mode_config.acquire_ctx;
> >
> > - ret = intel_modeset_stage_output_state(dev, set, config);
> > + ret = intel_modeset_stage_output_state(dev, set, config, state);
> > if (ret)
> > goto fail;
> >
> > --
> > 2.1.0
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-03-19 7:52 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-13 9:48 [PATCH v2 00/19] Remove depencies on staged config for atomic transition Ander Conselvan de Oliveira
2015-03-13 9:48 ` [PATCH 01/19] drm/i915: Add intel_atomic_get_crtc_state() helper function Ander Conselvan de Oliveira
2015-03-13 9:48 ` [PATCH 02/19] drm/i915: Pass acquire ctx also to intel_release_load_detect_pipe() Ander Conselvan de Oliveira
2015-03-13 9:48 ` [PATCH 03/19] drm/i915: Allocate a drm_atomic_state for the legacy modeset code Ander Conselvan de Oliveira
2015-03-17 6:46 ` [PATCH v3] " Ander Conselvan de Oliveira
2015-03-18 7:57 ` [PATCH v4] " Ander Conselvan de Oliveira
2015-03-18 23:57 ` Konduru, Chandra
2015-03-19 7:50 ` Ander Conselvan De Oliveira
2015-03-19 21:08 ` [PATCH 03/19] " Konduru, Chandra
2015-03-20 7:00 ` Ander Conselvan De Oliveira
2015-03-22 16:28 ` Konduru, Chandra
2015-03-13 9:48 ` [PATCH 04/19] drm/i915: Allocate a crtc_state also when the crtc is being disabled Ander Conselvan de Oliveira
[not found] ` <76A9B330A4D78C4D99CB292C4CC06C0E36F7B41B@fmsmsx101.amr.corp.intel.com>
2015-03-19 7:52 ` Ander Conselvan De Oliveira
2015-03-19 23:23 ` Konduru, Chandra
2015-03-20 8:40 ` Ander Conselvan De Oliveira
2015-03-20 9:51 ` Daniel Vetter
2015-03-20 10:06 ` Ander Conselvan De Oliveira
2015-03-20 10:39 ` Daniel Vetter
2015-03-22 16:46 ` Konduru, Chandra
2015-03-13 9:48 ` [PATCH 05/19] drm/i915: Update dummy connector atomic state with current config Ander Conselvan de Oliveira
2015-03-19 20:55 ` Konduru, Chandra
2015-03-20 6:41 ` Ander Conselvan De Oliveira
2015-03-13 9:48 ` [PATCH 06/19] drm/i915: Implement connector state duplication Ander Conselvan de Oliveira
2015-03-13 9:48 ` [PATCH 07/19] drm/i915: Copy the staged connector config to the legacy atomic state Ander Conselvan de Oliveira
[not found] ` <76A9B330A4D78C4D99CB292C4CC06C0E36F7B6F0@fmsmsx101.amr.corp.intel.com>
2015-03-19 7:52 ` Ander Conselvan De Oliveira [this message]
2015-03-19 15:15 ` Daniel Vetter
2015-03-13 9:48 ` [PATCH 08/19] drm/i915: Don't use encoder->new_crtc in intel_modeset_pipe_config() Ander Conselvan de Oliveira
2015-03-19 0:44 ` Konduru, Chandra
2015-03-19 7:52 ` Ander Conselvan De Oliveira
2015-03-13 9:48 ` [PATCH 09/19] drm/i915: Don't use encoder->new_crtc in compute_baseline_pipe_bpp() Ander Conselvan de Oliveira
2015-03-13 9:48 ` [PATCH 10/19] drm/i915: Don't depend on encoder->new_crtc in intel_dp_compute_config() Ander Conselvan de Oliveira
2015-03-13 9:48 ` [PATCH 11/19] drm/i915: Don't depend on encoder->new_crtc in intel_hdmi_compute_config Ander Conselvan de Oliveira
2015-03-13 9:48 ` [PATCH 12/19] drm/i915: Use atomic state in intel_ddi_crtc_get_new_encoder() Ander Conselvan de Oliveira
2015-03-13 9:48 ` [PATCH 13/19] drm/i915: Don't use staged config in intel_dp_mst_compute_config() Ander Conselvan de Oliveira
2015-03-13 9:48 ` [PATCH 14/19] drm/i915: Don't use encoder->new_crtc in intel_lvds_compute_config() Ander Conselvan de Oliveira
2015-03-13 9:48 ` [PATCH 15/19] drm/i915: Pass an atomic state to modeset_global_resources() functions Ander Conselvan de Oliveira
2015-03-13 9:48 ` [PATCH 16/19] drm/i915: Check lane sharing between pipes B & C using atomic state Ander Conselvan de Oliveira
2015-03-19 20:58 ` Konduru, Chandra
2015-03-20 6:46 ` Conselvan De Oliveira, Ander
2015-03-22 16:20 ` Konduru, Chandra
2015-03-23 7:33 ` Ander Conselvan De Oliveira
2015-03-23 16:57 ` Konduru, Chandra
2015-03-13 9:49 ` [PATCH 17/19] drm/i915: Convert intel_pipe_will_have_type() to " Ander Conselvan de Oliveira
2015-03-19 19:24 ` Konduru, Chandra
2015-03-20 6:28 ` Ander Conselvan De Oliveira
2015-03-22 16:14 ` Konduru, Chandra
2015-03-13 9:49 ` [PATCH 18/19] drm/i915: Don't look at staged config crtc when changing DRRS state Ander Conselvan de Oliveira
2015-03-13 9:49 ` [PATCH 19/19] drm/i915: Remove usage of encoder->new_crtc from clock computations Ander Conselvan de Oliveira
2015-03-14 0:29 ` shuang.he
2015-03-19 20:39 ` Konduru, Chandra
2015-03-18 23:57 ` [PATCH v2 00/19] Remove depencies on staged config for atomic transition Konduru, Chandra
2015-03-19 15:20 ` 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=1426751528.2824.43.camel@gmail.com \
--to=conselvan2@gmail.com \
--cc=chandra.konduru@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
/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