From: Jani Nikula <jani.nikula@intel.com>
To: Vandita Kulkarni <vandita.kulkarni@intel.com>,
intel-gfx@lists.freedesktop.org
Subject: Re: [RFC 5/7] drm/i915/dsi: Configure TE interrupt for cmd mode
Date: Thu, 24 Oct 2019 14:34:41 +0300 [thread overview]
Message-ID: <87k18ucr72.fsf@intel.com> (raw)
In-Reply-To: <20191014110122.31923-6-vandita.kulkarni@intel.com>
On Mon, 14 Oct 2019, Vandita Kulkarni <vandita.kulkarni@intel.com> wrote:
> We need to configure TE interrupt in two places.
> Port interrupt and DSI interrupt mask registers.
>
> Signed-off-by: Vandita Kulkarni <vandita.kulkarni@intel.com>
> ---
> drivers/gpu/drm/i915/i915_irq.c | 49 ++++++++++++++++++++++++++++++++-
> 1 file changed, 48 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index 3af7f7914c40..bfb2a63504fb 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -41,6 +41,7 @@
> #include "display/intel_hotplug.h"
> #include "display/intel_lpe_audio.h"
> #include "display/intel_psr.h"
> +#include "display/intel_dsi.h"
>
> #include "gt/intel_gt.h"
> #include "gt/intel_gt_irq.h"
> @@ -2960,12 +2961,44 @@ int ilk_enable_vblank(struct drm_crtc *crtc)
> return 0;
> }
>
> +static void gen11_dsi_configure_te(struct drm_crtc *crtc, bool enable)
> +{
> + struct drm_i915_private *dev_priv = to_i915(crtc->dev);
> + struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
> + struct intel_encoder *encoder = NULL;
> + struct intel_dsi *intel_dsi;
> + enum port port;
> + u32 tmp;
> +
> + encoder = gen11_dsi_find_cmd_mode_encoder(intel_crtc);
Ville's idea for checking for command mode on crtc is to use hwmode
private_flags. See e.g. __intel_get_crtc_scanline. It's not pretty
either though.
> + if (!encoder)
> + return;
> +
> + intel_dsi = enc_to_intel_dsi(&encoder->base);
> + /* Assuming single link would always be enabled on PORT_A */
I don't think that's an assumption you can make.
> + port = (intel_dsi->ports & BIT(PORT_B) & BIT(PORT_A)) ? PORT_B : PORT_A;
BIT(PORT_B) & BIT(PORT_A) is always 0.
> + tmp = I915_READ(ICL_DSI_INTR_MASK_REG(port));
> + if (enable)
> + tmp &= ~ICL_TE_EVENT;
> + else
> + tmp |= ICL_TE_EVENT;
> +
> + I915_WRITE(ICL_DSI_INTR_MASK_REG(port), tmp);
> +}
> +
> int bdw_enable_vblank(struct drm_crtc *crtc)
> {
> struct drm_i915_private *dev_priv = to_i915(crtc->dev);
> + struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
> enum pipe pipe = to_intel_crtc(crtc)->pipe;
> unsigned long irqflags;
>
> + if (INTEL_GEN(dev_priv) >= 11 &&
> + (intel_crtc_has_type(intel_crtc->config, INTEL_OUTPUT_DSI))) {
> + gen11_dsi_configure_te(crtc, true);
> + return 0;
> + }
> +
> spin_lock_irqsave(&dev_priv->irq_lock, irqflags);
> bdw_enable_pipe_irq(dev_priv, pipe, GEN8_PIPE_VBLANK);
> spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags);
> @@ -3031,9 +3064,16 @@ void ilk_disable_vblank(struct drm_crtc *crtc)
> void bdw_disable_vblank(struct drm_crtc *crtc)
> {
> struct drm_i915_private *dev_priv = to_i915(crtc->dev);
> - enum pipe pipe = to_intel_crtc(crtc)->pipe;
> + struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
> + enum pipe pipe = intel_crtc->pipe;
> unsigned long irqflags;
>
> + if (INTEL_GEN(dev_priv) >= 11 &&
> + (intel_crtc_has_type(intel_crtc->config, INTEL_OUTPUT_DSI))) {
> + gen11_dsi_configure_te(crtc, false);
> + return;
> + }
> +
> spin_lock_irqsave(&dev_priv->irq_lock, irqflags);
> bdw_disable_pipe_irq(dev_priv, pipe, GEN8_PIPE_VBLANK);
> spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags);
> @@ -3726,6 +3766,13 @@ static void gen8_de_irq_postinstall(struct drm_i915_private *dev_priv)
> gen3_assert_iir_is_zero(uncore, EDP_PSR_IIR);
> }
>
> + if (INTEL_GEN(dev_priv) >= 11) {
> + enum port port;
> +
> + if (intel_bios_is_dsi_present(dev_priv, &port))
> + de_port_masked |= ICL_DSI_0 | ICL_DSI_1;
> + }
> +
> for_each_pipe(dev_priv, pipe) {
> dev_priv->de_irq_mask[pipe] = ~de_pipe_masked;
--
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
WARNING: multiple messages have this Message-ID (diff)
From: Jani Nikula <jani.nikula@intel.com>
To: Vandita Kulkarni <vandita.kulkarni@intel.com>,
intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [RFC 5/7] drm/i915/dsi: Configure TE interrupt for cmd mode
Date: Thu, 24 Oct 2019 14:34:41 +0300 [thread overview]
Message-ID: <87k18ucr72.fsf@intel.com> (raw)
Message-ID: <20191024113441._MvRIXJI-jRojMDGuaSHepZXmO9EMiZvZtzVIDrdZec@z> (raw)
In-Reply-To: <20191014110122.31923-6-vandita.kulkarni@intel.com>
On Mon, 14 Oct 2019, Vandita Kulkarni <vandita.kulkarni@intel.com> wrote:
> We need to configure TE interrupt in two places.
> Port interrupt and DSI interrupt mask registers.
>
> Signed-off-by: Vandita Kulkarni <vandita.kulkarni@intel.com>
> ---
> drivers/gpu/drm/i915/i915_irq.c | 49 ++++++++++++++++++++++++++++++++-
> 1 file changed, 48 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index 3af7f7914c40..bfb2a63504fb 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -41,6 +41,7 @@
> #include "display/intel_hotplug.h"
> #include "display/intel_lpe_audio.h"
> #include "display/intel_psr.h"
> +#include "display/intel_dsi.h"
>
> #include "gt/intel_gt.h"
> #include "gt/intel_gt_irq.h"
> @@ -2960,12 +2961,44 @@ int ilk_enable_vblank(struct drm_crtc *crtc)
> return 0;
> }
>
> +static void gen11_dsi_configure_te(struct drm_crtc *crtc, bool enable)
> +{
> + struct drm_i915_private *dev_priv = to_i915(crtc->dev);
> + struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
> + struct intel_encoder *encoder = NULL;
> + struct intel_dsi *intel_dsi;
> + enum port port;
> + u32 tmp;
> +
> + encoder = gen11_dsi_find_cmd_mode_encoder(intel_crtc);
Ville's idea for checking for command mode on crtc is to use hwmode
private_flags. See e.g. __intel_get_crtc_scanline. It's not pretty
either though.
> + if (!encoder)
> + return;
> +
> + intel_dsi = enc_to_intel_dsi(&encoder->base);
> + /* Assuming single link would always be enabled on PORT_A */
I don't think that's an assumption you can make.
> + port = (intel_dsi->ports & BIT(PORT_B) & BIT(PORT_A)) ? PORT_B : PORT_A;
BIT(PORT_B) & BIT(PORT_A) is always 0.
> + tmp = I915_READ(ICL_DSI_INTR_MASK_REG(port));
> + if (enable)
> + tmp &= ~ICL_TE_EVENT;
> + else
> + tmp |= ICL_TE_EVENT;
> +
> + I915_WRITE(ICL_DSI_INTR_MASK_REG(port), tmp);
> +}
> +
> int bdw_enable_vblank(struct drm_crtc *crtc)
> {
> struct drm_i915_private *dev_priv = to_i915(crtc->dev);
> + struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
> enum pipe pipe = to_intel_crtc(crtc)->pipe;
> unsigned long irqflags;
>
> + if (INTEL_GEN(dev_priv) >= 11 &&
> + (intel_crtc_has_type(intel_crtc->config, INTEL_OUTPUT_DSI))) {
> + gen11_dsi_configure_te(crtc, true);
> + return 0;
> + }
> +
> spin_lock_irqsave(&dev_priv->irq_lock, irqflags);
> bdw_enable_pipe_irq(dev_priv, pipe, GEN8_PIPE_VBLANK);
> spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags);
> @@ -3031,9 +3064,16 @@ void ilk_disable_vblank(struct drm_crtc *crtc)
> void bdw_disable_vblank(struct drm_crtc *crtc)
> {
> struct drm_i915_private *dev_priv = to_i915(crtc->dev);
> - enum pipe pipe = to_intel_crtc(crtc)->pipe;
> + struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
> + enum pipe pipe = intel_crtc->pipe;
> unsigned long irqflags;
>
> + if (INTEL_GEN(dev_priv) >= 11 &&
> + (intel_crtc_has_type(intel_crtc->config, INTEL_OUTPUT_DSI))) {
> + gen11_dsi_configure_te(crtc, false);
> + return;
> + }
> +
> spin_lock_irqsave(&dev_priv->irq_lock, irqflags);
> bdw_disable_pipe_irq(dev_priv, pipe, GEN8_PIPE_VBLANK);
> spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags);
> @@ -3726,6 +3766,13 @@ static void gen8_de_irq_postinstall(struct drm_i915_private *dev_priv)
> gen3_assert_iir_is_zero(uncore, EDP_PSR_IIR);
> }
>
> + if (INTEL_GEN(dev_priv) >= 11) {
> + enum port port;
> +
> + if (intel_bios_is_dsi_present(dev_priv, &port))
> + de_port_masked |= ICL_DSI_0 | ICL_DSI_1;
> + }
> +
> for_each_pipe(dev_priv, pipe) {
> dev_priv->de_irq_mask[pipe] = ~de_pipe_masked;
--
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2019-10-24 11:34 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-14 11:01 [RFC 0/7] Add mipi dsi command mode support Vandita Kulkarni
2019-10-14 11:01 ` [RFC 1/7] drm/i915/dsi: Define command mode registers Vandita Kulkarni
2019-10-14 16:18 ` Ramalingam C
2019-10-15 7:52 ` Kulkarni, Vandita
2019-10-15 7:07 ` Jani Nikula
2019-10-15 7:50 ` Kulkarni, Vandita
2019-10-14 11:01 ` [RFC 2/7] drm/i915/dsi: Configure transcoder operation for command mode Vandita Kulkarni
2019-10-15 18:35 ` Jani Nikula
2019-10-24 11:37 ` Jani Nikula
2019-10-24 11:37 ` [Intel-gfx] " Jani Nikula
2019-10-24 11:52 ` Kulkarni, Vandita
2019-10-24 11:52 ` [Intel-gfx] " Kulkarni, Vandita
2019-10-14 11:01 ` [RFC 3/7] drm/i915/dsi: Add vblank calculation " Vandita Kulkarni
2019-10-15 18:45 ` Jani Nikula
2019-10-14 11:01 ` [RFC 4/7] drm/i915/dsi: Helper to find dsi encoder in cmd mode Vandita Kulkarni
2019-10-15 19:20 ` Jani Nikula
2019-10-16 13:27 ` Kulkarni, Vandita
2019-10-24 9:07 ` Jani Nikula
2019-10-24 9:07 ` [Intel-gfx] " Jani Nikula
2019-10-24 9:11 ` Jani Nikula
2019-10-24 9:11 ` [Intel-gfx] " Jani Nikula
2019-10-14 11:01 ` [RFC 5/7] drm/i915/dsi: Configure TE interrupt for " Vandita Kulkarni
2019-10-16 9:56 ` Ramalingam C
2019-10-24 11:34 ` Jani Nikula [this message]
2019-10-24 11:34 ` [Intel-gfx] " Jani Nikula
2019-10-14 11:01 ` [RFC 6/7] drm/i915/dsi: Add TE handler for dsi " Vandita Kulkarni
2019-10-15 8:28 ` Kulkarni, Vandita
2019-10-16 10:24 ` Ramalingam C
2019-10-16 12:46 ` Kulkarni, Vandita
2019-10-14 11:01 ` [RFC 7/7] drm/i915/dsi: Initiate frame request in " Vandita Kulkarni
2019-10-16 10:14 ` Ramalingam C
2019-10-16 12:37 ` Kulkarni, Vandita
2019-10-14 16:21 ` ✗ Fi.CI.CHECKPATCH: warning for Add mipi dsi command mode support Patchwork
2019-10-14 16:24 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-10-14 17:07 ` ✓ Fi.CI.BAT: success " Patchwork
2019-10-15 0:42 ` ✓ Fi.CI.IGT: " Patchwork
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=87k18ucr72.fsf@intel.com \
--to=jani.nikula@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=vandita.kulkarni@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.