From: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Cc: jani.nikula@linux.intel.com, suraj.kandpal@intel.com,
ville.syrjala@linux.intel.com
Subject: [PATCH 11/19] drm/i915/display: Move dss stuff in intel_dss files
Date: Thu, 29 Aug 2024 18:48:19 +0530 [thread overview]
Message-ID: <20240829131828.2350930-12-ankit.k.nautiyal@intel.com> (raw)
In-Reply-To: <20240829131828.2350930-1-ankit.k.nautiyal@intel.com>
Move helper to retrieve the compressed and uncompressed joiner pipes from
dss ctl to intel_dss files.
v2: Derive intel_display from crtc. (Jani)
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
---
drivers/gpu/drm/i915/display/intel_display.c | 34 +++-----------
drivers/gpu/drm/i915/display/intel_dss.c | 48 ++++++++++++++++++++
drivers/gpu/drm/i915/display/intel_dss.h | 7 +++
3 files changed, 61 insertions(+), 28 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 05ffd28cc16a..3d7990f8f20f 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -3545,35 +3545,13 @@ static void enabled_joiner_pipes(struct drm_i915_private *dev_priv,
for_each_intel_crtc_in_pipe_mask(&dev_priv->drm, crtc,
joiner_pipes(dev_priv)) {
- enum intel_display_power_domain power_domain;
- enum pipe pipe = crtc->pipe;
- intel_wakeref_t wakeref;
-
- power_domain = intel_dsc_power_domain(crtc, (enum transcoder) pipe);
- with_intel_display_power_if_enabled(dev_priv, power_domain, wakeref) {
- u32 tmp = intel_de_read(dev_priv, ICL_PIPE_DSS_CTL1(pipe));
+ intel_dss_get_compressed_joiner_pipes(crtc,
+ primary_pipes,
+ secondary_pipes);
- if (!(tmp & BIG_JOINER_ENABLE))
- continue;
-
- if (tmp & PRIMARY_BIG_JOINER_ENABLE)
- *primary_pipes |= BIT(pipe);
- else
- *secondary_pipes |= BIT(pipe);
- }
-
- if (DISPLAY_VER(dev_priv) < 13)
- continue;
-
- power_domain = POWER_DOMAIN_PIPE(pipe);
- with_intel_display_power_if_enabled(dev_priv, power_domain, wakeref) {
- u32 tmp = intel_de_read(dev_priv, ICL_PIPE_DSS_CTL1(pipe));
-
- if (tmp & UNCOMPRESSED_JOINER_PRIMARY)
- *primary_pipes |= BIT(pipe);
- if (tmp & UNCOMPRESSED_JOINER_SECONDARY)
- *secondary_pipes |= BIT(pipe);
- }
+ intel_dss_get_uncompressed_joiner_pipes(crtc,
+ primary_pipes,
+ secondary_pipes);
}
/* Joiner pipes should always be consecutive primary and secondary */
diff --git a/drivers/gpu/drm/i915/display/intel_dss.c b/drivers/gpu/drm/i915/display/intel_dss.c
index fe55f4b1a9bf..01303feadcef 100644
--- a/drivers/gpu/drm/i915/display/intel_dss.c
+++ b/drivers/gpu/drm/i915/display/intel_dss.c
@@ -217,3 +217,51 @@ void intel_dss_dsc_get_config(struct intel_crtc_state *crtc_state)
crtc_state->dsc.dsc_split = (dss_ctl2 & RIGHT_BRANCH_VDSC_ENABLE) &&
(dss_ctl1 & JOINER_ENABLE);
}
+
+void intel_dss_get_compressed_joiner_pipes(struct intel_crtc *crtc,
+ u8 *primary_pipes,
+ u8 *secondary_pipes)
+{
+ struct intel_display *display = to_intel_display(crtc);
+ struct drm_i915_private *i915 = to_i915(display->drm);
+ enum intel_display_power_domain power_domain;
+ enum pipe pipe = crtc->pipe;
+ intel_wakeref_t wakeref;
+
+ power_domain = intel_dsc_power_domain(crtc, (enum transcoder) pipe);
+ with_intel_display_power_if_enabled(i915, power_domain, wakeref) {
+ u32 tmp = intel_de_read(display, ICL_PIPE_DSS_CTL1(pipe));
+
+ if (!(tmp & BIG_JOINER_ENABLE))
+ continue;
+
+ if (tmp & PRIMARY_BIG_JOINER_ENABLE)
+ *primary_pipes |= BIT(pipe);
+ else
+ *secondary_pipes |= BIT(pipe);
+ }
+}
+
+void intel_dss_get_uncompressed_joiner_pipes(struct intel_crtc *crtc,
+ u8 *primary_pipes,
+ u8 *secondary_pipes)
+{
+ struct intel_display *display = to_intel_display(crtc);
+ struct drm_i915_private *i915 = to_i915(display->drm);
+ enum intel_display_power_domain power_domain;
+ enum pipe pipe = crtc->pipe;
+ intel_wakeref_t wakeref;
+
+ if (DISPLAY_VER(display) < 13)
+ return;
+
+ power_domain = POWER_DOMAIN_PIPE(pipe);
+ with_intel_display_power_if_enabled(i915, power_domain, wakeref) {
+ u32 tmp = intel_de_read(display, ICL_PIPE_DSS_CTL1(pipe));
+
+ if (tmp & UNCOMPRESSED_JOINER_PRIMARY)
+ *primary_pipes |= BIT(pipe);
+ if (tmp & UNCOMPRESSED_JOINER_SECONDARY)
+ *secondary_pipes |= BIT(pipe);
+ }
+}
diff --git a/drivers/gpu/drm/i915/display/intel_dss.h b/drivers/gpu/drm/i915/display/intel_dss.h
index cb204db56153..6a74404bd76d 100644
--- a/drivers/gpu/drm/i915/display/intel_dss.h
+++ b/drivers/gpu/drm/i915/display/intel_dss.h
@@ -11,6 +11,7 @@
struct intel_crtc_state;
struct intel_display;
struct intel_encoder;
+struct intel_crtc;
u8 intel_dss_mso_pipe_mask(struct intel_display *display);
void intel_dss_mso_get_config(struct intel_encoder *encoder,
@@ -24,6 +25,12 @@ void intel_dss_enable_uncompressed_joiner(const struct intel_crtc_state *crtc_st
void intel_dss_enable_compressed_joiner(const struct intel_crtc_state *crtc_state,
int vdsc_instances_per_pipe);
void intel_dss_dsc_get_config(struct intel_crtc_state *crtc_state);
+void intel_dss_get_compressed_joiner_pipes(struct intel_crtc *crtc,
+ u8 *primary_pipes,
+ u8 *secondary_pipes);
+void intel_dss_get_uncompressed_joiner_pipes(struct intel_crtc *crtc,
+ u8 *primary_pipes,
+ u8 *secondary_pipes);
#endif /* __INTEL_DSS_H__ */
--
2.45.2
next prev parent reply other threads:[~2024-08-29 13:17 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-29 13:18 [PATCH 00/19] Consolidation of DSS Control in Separate Files Ankit Nautiyal
2024-08-29 13:18 ` [PATCH 01/19] drm/i915/display: Move all DSS control registers to a new file Ankit Nautiyal
2024-08-29 13:18 ` [PATCH 02/19] drm/i915/dss_regs: Use REG_* macros for the DSS ctl bits Ankit Nautiyal
2024-08-29 13:18 ` [PATCH 03/19] drm/i915/ddi: Move all mso related helpers to a new file Ankit Nautiyal
2024-08-29 13:18 ` [PATCH 04/19] drm/i915/dss: Move to struct intel_display Ankit Nautiyal
2024-08-29 13:18 ` [PATCH 05/19] drm/i915/icl_dsi: Avoid using intel_dsi in configure_dual_link_mode Ankit Nautiyal
2024-08-29 13:18 ` [PATCH 06/19] drm/i915/icl_dsi: Use intel_display " Ankit Nautiyal
2024-08-29 13:18 ` [PATCH 07/19] drm/i915/icl_dsi: Move helpers to configure dsi dual link to intel_dss Ankit Nautiyal
2024-08-29 13:18 ` [PATCH 08/19] drm/i915/vdsc: Rename helper to check if the pipe supports dsc Ankit Nautiyal
2024-08-29 13:18 ` [PATCH 09/19] drm/i915/vdsc: Move all dss stuff in dss files Ankit Nautiyal
2024-08-29 13:18 ` [PATCH 10/19] drm/i915/dss: Use struct intel_display in dss dsc helpers Ankit Nautiyal
2024-08-29 13:18 ` Ankit Nautiyal [this message]
2024-08-29 13:18 ` [PATCH 12/19] drm/i915/display: Rename static functions that use joiner Ankit Nautiyal
2024-08-29 13:18 ` [PATCH 13/19] drm/i915/display: Separate out joiner stuff in a new file Ankit Nautiyal
2024-08-29 13:18 ` [PATCH 14/19] drm/i915/display: Move intel_crtc_joined_pipe_mask to intel_joiner Ankit Nautiyal
2024-08-29 13:18 ` [PATCH 15/19] drm/i915/display: Move helpers for primary joiner " Ankit Nautiyal
2024-08-29 13:18 ` [PATCH 16/19] drm/i915/display: Move intel_crtc_is_joiner_secondary " Ankit Nautiyal
2024-08-29 13:18 ` [PATCH 17/19] drm/i915/display: Move intel_crtc_joiner_secondary_pipes " Ankit Nautiyal
2024-08-29 13:18 ` [PATCH 18/19] drm/i915/joiner: Use struct intel_display in intel_joiner_enabled_pipes Ankit Nautiyal
2024-08-29 13:18 ` [PATCH 19/19] drm/i915/joiner: Use struct intel_display in intel_joiner_supported_pipes Ankit Nautiyal
2024-08-29 13:38 ` ✗ CI.Patch_applied: failure for Consolidation of DSS Control in Separate Files (rev2) Patchwork
-- strict thread matches above, loose matches on Subject: below --
2024-08-30 5:09 [PATCH 00/19] Consolidation of DSS Control in Separate Files Ankit Nautiyal
2024-08-30 5:09 ` [PATCH 11/19] drm/i915/display: Move dss stuff in intel_dss files Ankit Nautiyal
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=20240829131828.2350930-12-ankit.k.nautiyal@intel.com \
--to=ankit.k.nautiyal@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=suraj.kandpal@intel.com \
--cc=ville.syrjala@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