From: Ander Conselvan De Oliveira <conselvan2@gmail.com>
To: Durgadoss R <durgadoss.r@intel.com>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCHv2 2/4] drm/i915: Make finding unused crtc as a generic function
Date: Fri, 12 Feb 2016 18:53:06 +0200 [thread overview]
Message-ID: <1455295986.2720.57.camel@gmail.com> (raw)
In-Reply-To: <1454335073-20405-3-git-send-email-durgadoss.r@intel.com>
On Mon, 2016-02-01 at 19:27 +0530, Durgadoss R wrote:
> Looping over the crtc list and finding an unused crtc
> has users other than load_detect().
Which other users? If there are other users they should be converted in this
patch. If the use will only come in a future patch, please make that clear in
the commit message.
> Hence move it to
> a common function so that we can re-use the logic.
>
> Signed-off-by: Durgadoss R <durgadoss.r@intel.com>
> ---
> drivers/gpu/drm/i915/intel_display.c | 37 ++++++++++++++++++++++-------------
> -
> drivers/gpu/drm/i915/intel_drv.h | 1 +
> 2 files changed, 24 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c
> b/drivers/gpu/drm/i915/intel_display.c
> index 92cd5c6..af50e61 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -10417,6 +10417,27 @@ static int intel_modeset_setup_plane_state(struct
> drm_atomic_state *state,
> return 0;
> }
>
> +struct drm_crtc *intel_get_unused_crtc(struct drm_encoder *encoder)
> +{
This function is exported, so it needs some kernel doc.
> + struct drm_crtc *possible_crtc;
> + struct drm_crtc *crtc = NULL;
> + struct drm_device *dev = encoder->dev;
> + int i = -1;
> +
> + for_each_crtc(dev, possible_crtc) {
> + i++;
> + if (!(encoder->possible_crtcs & (1 << i)))
> + continue;
> + if (possible_crtc->state->enable)
> + continue;
> +
> + crtc = possible_crtc;
> + break;
> + }
> +
> + return crtc;
> +}
> +
> bool intel_get_load_detect_pipe(struct drm_connector *connector,
> struct drm_display_mode *mode,
> struct intel_load_detect_pipe *old,
> @@ -10425,7 +10446,6 @@ bool intel_get_load_detect_pipe(struct drm_connector
> *connector,
> struct intel_crtc *intel_crtc;
> struct intel_encoder *intel_encoder =
> intel_attached_encoder(connector);
> - struct drm_crtc *possible_crtc;
> struct drm_encoder *encoder = &intel_encoder->base;
> struct drm_crtc *crtc = NULL;
> struct drm_device *dev = encoder->dev;
> @@ -10434,7 +10454,7 @@ bool intel_get_load_detect_pipe(struct drm_connector
> *connector,
> struct drm_atomic_state *state = NULL;
> struct drm_connector_state *connector_state;
> struct intel_crtc_state *crtc_state;
> - int ret, i = -1;
> + int ret;
>
> DRM_DEBUG_KMS("[CONNECTOR:%d:%s], [ENCODER:%d:%s]\n",
> connector->base.id, connector->name,
> @@ -10476,21 +10496,10 @@ retry:
> return true;
> }
>
> - /* Find an unused one (if possible) */
> - for_each_crtc(dev, possible_crtc) {
> - i++;
> - if (!(encoder->possible_crtcs & (1 << i)))
> - continue;
> - if (possible_crtc->state->enable)
> - continue;
> -
> - crtc = possible_crtc;
> - break;
> - }
> -
> /*
> * If we didn't find an unused CRTC, don't use any.
> */
> + crtc = intel_get_unused_crtc(encoder);
The comment above looks out of place now. It is pretty obvious anyway, so maybe
just delete it.
With those fixed, this is
Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com>
if (!crtc) {
> DRM_DEBUG_KMS("no pipe available for load-detect\n");
> goto fail;
> diff --git a/drivers/gpu/drm/i915/intel_drv.h
> b/drivers/gpu/drm/i915/intel_drv.h
> index c7a6e32..9fe7c4b 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -1106,6 +1106,7 @@ bool intel_get_load_detect_pipe(struct drm_connector
> *connector,
> void intel_release_load_detect_pipe(struct drm_connector *connector,
> struct intel_load_detect_pipe *old,
> struct drm_modeset_acquire_ctx *ctx);
> +struct drm_crtc *intel_get_unused_crtc(struct drm_encoder *encoder);
> int intel_pin_and_fence_fb_obj(struct drm_plane *plane,
> struct drm_framebuffer *fb,
> const struct drm_plane_state *plane_state);
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-02-12 16:53 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-01 13:57 [PATCHv2 0/4] Add USB typeC based DP support for BXT platform Durgadoss R
2016-02-01 13:57 ` [PATCHv2 1/4] drm/i915/dp: Export enable/disable_shared_dpll methods Durgadoss R
2016-02-01 13:57 ` [PATCHv2 2/4] drm/i915: Make finding unused crtc as a generic function Durgadoss R
2016-02-12 16:53 ` Ander Conselvan De Oliveira [this message]
2016-02-15 6:42 ` R, Durgadoss
2016-02-01 13:57 ` [PATCHv2 3/4] drm/i915/dp: Use legacy get_crtc_encoder in non-atomic paths Durgadoss R
2016-02-01 13:57 ` [PATCHv2 4/4] drm/i915/dp: Enable Upfront link training for typeC DP support on BXT Durgadoss R
2016-02-12 16:43 ` Ander Conselvan De Oliveira
2016-02-12 16:44 ` [PATCH] drm/i915: Split bxt_ddi_pll_select() Ander Conselvan de Oliveira
2016-02-15 6:41 ` [PATCHv2 4/4] drm/i915/dp: Enable Upfront link training for typeC DP support on BXT R, Durgadoss
2016-02-12 17:12 ` Ville Syrjälä
2016-02-15 6:55 ` R, Durgadoss
2016-02-15 13:25 ` Ville Syrjälä
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=1455295986.2720.57.camel@gmail.com \
--to=conselvan2@gmail.com \
--cc=durgadoss.r@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