Message ID | 20240912132931.1320686-1-ankit.k.nautiyal@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | drm/i915/display: Check whether platform supports joiner | expand |
On Thu, Sep 12, 2024 at 06:59:31PM +0530, Ankit Nautiyal wrote: > Add macros to check if platform supports bigjoiner/uncompressed joiner. > Replace the existing DISPLAY_VER checks with these. > Additionally use it before readout for joiner stuff, where its missing. > > Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com> Nice. Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> > --- > drivers/gpu/drm/i915/display/intel_display.c | 9 ++++++--- > drivers/gpu/drm/i915/display/intel_display_debugfs.c | 2 +- > drivers/gpu/drm/i915/display/intel_display_device.h | 2 ++ > drivers/gpu/drm/i915/display/intel_dp.c | 2 +- > 4 files changed, 10 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c > index fdf244a32b24..d4a371edfcdd 100644 > --- a/drivers/gpu/drm/i915/display/intel_display.c > +++ b/drivers/gpu/drm/i915/display/intel_display.c > @@ -1712,7 +1712,7 @@ static void hsw_crtc_enable(struct intel_atomic_state *state, > > intel_dsc_enable(pipe_crtc_state); > > - if (DISPLAY_VER(dev_priv) >= 13) > + if (HAS_UNCOMPRESSED_JOINER(dev_priv)) > intel_uncompressed_joiner_enable(pipe_crtc_state); > > intel_set_pipe_src_size(pipe_crtc_state); > @@ -3546,6 +3546,9 @@ static void enabled_joiner_pipes(struct drm_i915_private *dev_priv, > *primary_pipes = 0; > *secondary_pipes = 0; > > + if (!HAS_BIGJOINER(dev_priv)) > + return; > + > for_each_intel_crtc_in_pipe_mask(&dev_priv->drm, crtc, > joiner_pipes(dev_priv)) { > enum intel_display_power_domain power_domain; > @@ -3565,7 +3568,7 @@ static void enabled_joiner_pipes(struct drm_i915_private *dev_priv, > *secondary_pipes |= BIT(pipe); > } > > - if (DISPLAY_VER(dev_priv) < 13) > + if (!HAS_UNCOMPRESSED_JOINER(dev_priv)) > continue; > > power_domain = POWER_DOMAIN_PIPE(pipe); > @@ -7966,7 +7969,7 @@ static int max_dotclock(struct drm_i915_private *i915) > int max_dotclock = i915->display.cdclk.max_dotclk_freq; > > /* icl+ might use joiner */ > - if (DISPLAY_VER(i915) >= 11) > + if (HAS_BIGJOINER(i915)) > max_dotclock *= 2; > > return max_dotclock; > diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c b/drivers/gpu/drm/i915/display/intel_display_debugfs.c > index b75361e95e97..8caacdd624bd 100644 > --- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c > +++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c > @@ -1550,7 +1550,7 @@ void intel_connector_debugfs_add(struct intel_connector *connector) > connector, &i915_dsc_fractional_bpp_fops); > } > > - if (DISPLAY_VER(i915) >= 11 && > + if (HAS_BIGJOINER(i915) && > (connector_type == DRM_MODE_CONNECTOR_DisplayPort || > connector_type == DRM_MODE_CONNECTOR_eDP)) { > debugfs_create_bool("i915_bigjoiner_force_enable", 0644, root, > diff --git a/drivers/gpu/drm/i915/display/intel_display_device.h b/drivers/gpu/drm/i915/display/intel_display_device.h > index dfb0c8bf5ca2..5306bbd13e59 100644 > --- a/drivers/gpu/drm/i915/display/intel_display_device.h > +++ b/drivers/gpu/drm/i915/display/intel_display_device.h > @@ -118,6 +118,7 @@ enum intel_display_subplatform { > > #define HAS_4TILE(i915) (IS_DG2(i915) || DISPLAY_VER(i915) >= 14) > #define HAS_ASYNC_FLIPS(i915) (DISPLAY_VER(i915) >= 5) > +#define HAS_BIGJOINER(i915) (DISPLAY_VER(i915) >= 11) > #define HAS_CDCLK_CRAWL(i915) (DISPLAY_INFO(i915)->has_cdclk_crawl) > #define HAS_CDCLK_SQUASH(i915) (DISPLAY_INFO(i915)->has_cdclk_squash) > #define HAS_CUR_FBC(i915) (!HAS_GMCH(i915) && IS_DISPLAY_VER(i915, 7, 13)) > @@ -152,6 +153,7 @@ enum intel_display_subplatform { > #define HAS_SAGV(i915) (DISPLAY_VER(i915) >= 9 && !IS_LP(i915)) > #define HAS_TRANSCODER(i915, trans) ((DISPLAY_RUNTIME_INFO(i915)->cpu_transcoder_mask & \ > BIT(trans)) != 0) > +#define HAS_UNCOMPRESSED_JOINER(i915) (DISPLAY_VER(i915) >= 13) > #define HAS_VRR(i915) (DISPLAY_VER(i915) >= 11) > #define HAS_AS_SDP(i915) (DISPLAY_VER(i915) >= 13) > #define HAS_CMRR(i915) (DISPLAY_VER(i915) >= 20) > diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c > index cb0f6db5f8e7..c53eb8e165de 100644 > --- a/drivers/gpu/drm/i915/display/intel_dp.c > +++ b/drivers/gpu/drm/i915/display/intel_dp.c > @@ -2520,7 +2520,7 @@ bool intel_dp_joiner_needs_dsc(struct drm_i915_private *i915, bool use_joiner) > * limitation. DG2 onwards pipe joiner can be enabled without > * compression. > */ > - return DISPLAY_VER(i915) < 13 && use_joiner; > + return !HAS_UNCOMPRESSED_JOINER(i915) && use_joiner; > } > > static int > -- > 2.45.2
On Thu, 12 Sep 2024, Ankit Nautiyal <ankit.k.nautiyal@intel.com> wrote: > Add macros to check if platform supports bigjoiner/uncompressed joiner. > Replace the existing DISPLAY_VER checks with these. > Additionally use it before readout for joiner stuff, where its missing. Please split this to two, adding the macros and then adding the new place. BR, Jani. > > Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com> > --- > drivers/gpu/drm/i915/display/intel_display.c | 9 ++++++--- > drivers/gpu/drm/i915/display/intel_display_debugfs.c | 2 +- > drivers/gpu/drm/i915/display/intel_display_device.h | 2 ++ > drivers/gpu/drm/i915/display/intel_dp.c | 2 +- > 4 files changed, 10 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c > index fdf244a32b24..d4a371edfcdd 100644 > --- a/drivers/gpu/drm/i915/display/intel_display.c > +++ b/drivers/gpu/drm/i915/display/intel_display.c > @@ -1712,7 +1712,7 @@ static void hsw_crtc_enable(struct intel_atomic_state *state, > > intel_dsc_enable(pipe_crtc_state); > > - if (DISPLAY_VER(dev_priv) >= 13) > + if (HAS_UNCOMPRESSED_JOINER(dev_priv)) > intel_uncompressed_joiner_enable(pipe_crtc_state); > > intel_set_pipe_src_size(pipe_crtc_state); > @@ -3546,6 +3546,9 @@ static void enabled_joiner_pipes(struct drm_i915_private *dev_priv, > *primary_pipes = 0; > *secondary_pipes = 0; > > + if (!HAS_BIGJOINER(dev_priv)) > + return; > + > for_each_intel_crtc_in_pipe_mask(&dev_priv->drm, crtc, > joiner_pipes(dev_priv)) { > enum intel_display_power_domain power_domain; > @@ -3565,7 +3568,7 @@ static void enabled_joiner_pipes(struct drm_i915_private *dev_priv, > *secondary_pipes |= BIT(pipe); > } > > - if (DISPLAY_VER(dev_priv) < 13) > + if (!HAS_UNCOMPRESSED_JOINER(dev_priv)) > continue; > > power_domain = POWER_DOMAIN_PIPE(pipe); > @@ -7966,7 +7969,7 @@ static int max_dotclock(struct drm_i915_private *i915) > int max_dotclock = i915->display.cdclk.max_dotclk_freq; > > /* icl+ might use joiner */ > - if (DISPLAY_VER(i915) >= 11) > + if (HAS_BIGJOINER(i915)) > max_dotclock *= 2; > > return max_dotclock; > diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c b/drivers/gpu/drm/i915/display/intel_display_debugfs.c > index b75361e95e97..8caacdd624bd 100644 > --- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c > +++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c > @@ -1550,7 +1550,7 @@ void intel_connector_debugfs_add(struct intel_connector *connector) > connector, &i915_dsc_fractional_bpp_fops); > } > > - if (DISPLAY_VER(i915) >= 11 && > + if (HAS_BIGJOINER(i915) && > (connector_type == DRM_MODE_CONNECTOR_DisplayPort || > connector_type == DRM_MODE_CONNECTOR_eDP)) { > debugfs_create_bool("i915_bigjoiner_force_enable", 0644, root, > diff --git a/drivers/gpu/drm/i915/display/intel_display_device.h b/drivers/gpu/drm/i915/display/intel_display_device.h > index dfb0c8bf5ca2..5306bbd13e59 100644 > --- a/drivers/gpu/drm/i915/display/intel_display_device.h > +++ b/drivers/gpu/drm/i915/display/intel_display_device.h > @@ -118,6 +118,7 @@ enum intel_display_subplatform { > > #define HAS_4TILE(i915) (IS_DG2(i915) || DISPLAY_VER(i915) >= 14) > #define HAS_ASYNC_FLIPS(i915) (DISPLAY_VER(i915) >= 5) > +#define HAS_BIGJOINER(i915) (DISPLAY_VER(i915) >= 11) > #define HAS_CDCLK_CRAWL(i915) (DISPLAY_INFO(i915)->has_cdclk_crawl) > #define HAS_CDCLK_SQUASH(i915) (DISPLAY_INFO(i915)->has_cdclk_squash) > #define HAS_CUR_FBC(i915) (!HAS_GMCH(i915) && IS_DISPLAY_VER(i915, 7, 13)) > @@ -152,6 +153,7 @@ enum intel_display_subplatform { > #define HAS_SAGV(i915) (DISPLAY_VER(i915) >= 9 && !IS_LP(i915)) > #define HAS_TRANSCODER(i915, trans) ((DISPLAY_RUNTIME_INFO(i915)->cpu_transcoder_mask & \ > BIT(trans)) != 0) > +#define HAS_UNCOMPRESSED_JOINER(i915) (DISPLAY_VER(i915) >= 13) > #define HAS_VRR(i915) (DISPLAY_VER(i915) >= 11) > #define HAS_AS_SDP(i915) (DISPLAY_VER(i915) >= 13) > #define HAS_CMRR(i915) (DISPLAY_VER(i915) >= 20) > diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c > index cb0f6db5f8e7..c53eb8e165de 100644 > --- a/drivers/gpu/drm/i915/display/intel_dp.c > +++ b/drivers/gpu/drm/i915/display/intel_dp.c > @@ -2520,7 +2520,7 @@ bool intel_dp_joiner_needs_dsc(struct drm_i915_private *i915, bool use_joiner) > * limitation. DG2 onwards pipe joiner can be enabled without > * compression. > */ > - return DISPLAY_VER(i915) < 13 && use_joiner; > + return !HAS_UNCOMPRESSED_JOINER(i915) && use_joiner; > } > > static int
On Thu, 12 Sep 2024, Jani Nikula <jani.nikula@linux.intel.com> wrote: > On Thu, 12 Sep 2024, Ankit Nautiyal <ankit.k.nautiyal@intel.com> wrote: >> Add macros to check if platform supports bigjoiner/uncompressed joiner. >> Replace the existing DISPLAY_VER checks with these. >> Additionally use it before readout for joiner stuff, where its missing. > > Please split this to two, adding the macros and then adding the new > place. On second thoughts, it's small enough. Just merge after you get CI results. > > BR, > Jani. > >> >> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com> >> --- >> drivers/gpu/drm/i915/display/intel_display.c | 9 ++++++--- >> drivers/gpu/drm/i915/display/intel_display_debugfs.c | 2 +- >> drivers/gpu/drm/i915/display/intel_display_device.h | 2 ++ >> drivers/gpu/drm/i915/display/intel_dp.c | 2 +- >> 4 files changed, 10 insertions(+), 5 deletions(-) >> >> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c >> index fdf244a32b24..d4a371edfcdd 100644 >> --- a/drivers/gpu/drm/i915/display/intel_display.c >> +++ b/drivers/gpu/drm/i915/display/intel_display.c >> @@ -1712,7 +1712,7 @@ static void hsw_crtc_enable(struct intel_atomic_state *state, >> >> intel_dsc_enable(pipe_crtc_state); >> >> - if (DISPLAY_VER(dev_priv) >= 13) >> + if (HAS_UNCOMPRESSED_JOINER(dev_priv)) >> intel_uncompressed_joiner_enable(pipe_crtc_state); >> >> intel_set_pipe_src_size(pipe_crtc_state); >> @@ -3546,6 +3546,9 @@ static void enabled_joiner_pipes(struct drm_i915_private *dev_priv, >> *primary_pipes = 0; >> *secondary_pipes = 0; >> >> + if (!HAS_BIGJOINER(dev_priv)) >> + return; >> + >> for_each_intel_crtc_in_pipe_mask(&dev_priv->drm, crtc, >> joiner_pipes(dev_priv)) { >> enum intel_display_power_domain power_domain; >> @@ -3565,7 +3568,7 @@ static void enabled_joiner_pipes(struct drm_i915_private *dev_priv, >> *secondary_pipes |= BIT(pipe); >> } >> >> - if (DISPLAY_VER(dev_priv) < 13) >> + if (!HAS_UNCOMPRESSED_JOINER(dev_priv)) >> continue; >> >> power_domain = POWER_DOMAIN_PIPE(pipe); >> @@ -7966,7 +7969,7 @@ static int max_dotclock(struct drm_i915_private *i915) >> int max_dotclock = i915->display.cdclk.max_dotclk_freq; >> >> /* icl+ might use joiner */ >> - if (DISPLAY_VER(i915) >= 11) >> + if (HAS_BIGJOINER(i915)) >> max_dotclock *= 2; >> >> return max_dotclock; >> diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c b/drivers/gpu/drm/i915/display/intel_display_debugfs.c >> index b75361e95e97..8caacdd624bd 100644 >> --- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c >> +++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c >> @@ -1550,7 +1550,7 @@ void intel_connector_debugfs_add(struct intel_connector *connector) >> connector, &i915_dsc_fractional_bpp_fops); >> } >> >> - if (DISPLAY_VER(i915) >= 11 && >> + if (HAS_BIGJOINER(i915) && >> (connector_type == DRM_MODE_CONNECTOR_DisplayPort || >> connector_type == DRM_MODE_CONNECTOR_eDP)) { >> debugfs_create_bool("i915_bigjoiner_force_enable", 0644, root, >> diff --git a/drivers/gpu/drm/i915/display/intel_display_device.h b/drivers/gpu/drm/i915/display/intel_display_device.h >> index dfb0c8bf5ca2..5306bbd13e59 100644 >> --- a/drivers/gpu/drm/i915/display/intel_display_device.h >> +++ b/drivers/gpu/drm/i915/display/intel_display_device.h >> @@ -118,6 +118,7 @@ enum intel_display_subplatform { >> >> #define HAS_4TILE(i915) (IS_DG2(i915) || DISPLAY_VER(i915) >= 14) >> #define HAS_ASYNC_FLIPS(i915) (DISPLAY_VER(i915) >= 5) >> +#define HAS_BIGJOINER(i915) (DISPLAY_VER(i915) >= 11) >> #define HAS_CDCLK_CRAWL(i915) (DISPLAY_INFO(i915)->has_cdclk_crawl) >> #define HAS_CDCLK_SQUASH(i915) (DISPLAY_INFO(i915)->has_cdclk_squash) >> #define HAS_CUR_FBC(i915) (!HAS_GMCH(i915) && IS_DISPLAY_VER(i915, 7, 13)) >> @@ -152,6 +153,7 @@ enum intel_display_subplatform { >> #define HAS_SAGV(i915) (DISPLAY_VER(i915) >= 9 && !IS_LP(i915)) >> #define HAS_TRANSCODER(i915, trans) ((DISPLAY_RUNTIME_INFO(i915)->cpu_transcoder_mask & \ >> BIT(trans)) != 0) >> +#define HAS_UNCOMPRESSED_JOINER(i915) (DISPLAY_VER(i915) >= 13) >> #define HAS_VRR(i915) (DISPLAY_VER(i915) >= 11) >> #define HAS_AS_SDP(i915) (DISPLAY_VER(i915) >= 13) >> #define HAS_CMRR(i915) (DISPLAY_VER(i915) >= 20) >> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c >> index cb0f6db5f8e7..c53eb8e165de 100644 >> --- a/drivers/gpu/drm/i915/display/intel_dp.c >> +++ b/drivers/gpu/drm/i915/display/intel_dp.c >> @@ -2520,7 +2520,7 @@ bool intel_dp_joiner_needs_dsc(struct drm_i915_private *i915, bool use_joiner) >> * limitation. DG2 onwards pipe joiner can be enabled without >> * compression. >> */ >> - return DISPLAY_VER(i915) < 13 && use_joiner; >> + return !HAS_UNCOMPRESSED_JOINER(i915) && use_joiner; >> } >> >> static int
On 9/12/2024 9:06 PM, Jani Nikula wrote: > On Thu, 12 Sep 2024, Jani Nikula <jani.nikula@linux.intel.com> wrote: >> On Thu, 12 Sep 2024, Ankit Nautiyal <ankit.k.nautiyal@intel.com> wrote: >>> Add macros to check if platform supports bigjoiner/uncompressed joiner. >>> Replace the existing DISPLAY_VER checks with these. >>> Additionally use it before readout for joiner stuff, where its missing. >> Please split this to two, adding the macros and then adding the new >> place. > On second thoughts, it's small enough. Just merge after you get CI > results. Missed to update this, patch was pushed to drm-intel-next. Thank you all, for the reviews and comments. Regards, Ankit >> BR, >> Jani. >> >>> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com> >>> --- >>> drivers/gpu/drm/i915/display/intel_display.c | 9 ++++++--- >>> drivers/gpu/drm/i915/display/intel_display_debugfs.c | 2 +- >>> drivers/gpu/drm/i915/display/intel_display_device.h | 2 ++ >>> drivers/gpu/drm/i915/display/intel_dp.c | 2 +- >>> 4 files changed, 10 insertions(+), 5 deletions(-) >>> >>> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c >>> index fdf244a32b24..d4a371edfcdd 100644 >>> --- a/drivers/gpu/drm/i915/display/intel_display.c >>> +++ b/drivers/gpu/drm/i915/display/intel_display.c >>> @@ -1712,7 +1712,7 @@ static void hsw_crtc_enable(struct intel_atomic_state *state, >>> >>> intel_dsc_enable(pipe_crtc_state); >>> >>> - if (DISPLAY_VER(dev_priv) >= 13) >>> + if (HAS_UNCOMPRESSED_JOINER(dev_priv)) >>> intel_uncompressed_joiner_enable(pipe_crtc_state); >>> >>> intel_set_pipe_src_size(pipe_crtc_state); >>> @@ -3546,6 +3546,9 @@ static void enabled_joiner_pipes(struct drm_i915_private *dev_priv, >>> *primary_pipes = 0; >>> *secondary_pipes = 0; >>> >>> + if (!HAS_BIGJOINER(dev_priv)) >>> + return; >>> + >>> for_each_intel_crtc_in_pipe_mask(&dev_priv->drm, crtc, >>> joiner_pipes(dev_priv)) { >>> enum intel_display_power_domain power_domain; >>> @@ -3565,7 +3568,7 @@ static void enabled_joiner_pipes(struct drm_i915_private *dev_priv, >>> *secondary_pipes |= BIT(pipe); >>> } >>> >>> - if (DISPLAY_VER(dev_priv) < 13) >>> + if (!HAS_UNCOMPRESSED_JOINER(dev_priv)) >>> continue; >>> >>> power_domain = POWER_DOMAIN_PIPE(pipe); >>> @@ -7966,7 +7969,7 @@ static int max_dotclock(struct drm_i915_private *i915) >>> int max_dotclock = i915->display.cdclk.max_dotclk_freq; >>> >>> /* icl+ might use joiner */ >>> - if (DISPLAY_VER(i915) >= 11) >>> + if (HAS_BIGJOINER(i915)) >>> max_dotclock *= 2; >>> >>> return max_dotclock; >>> diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c b/drivers/gpu/drm/i915/display/intel_display_debugfs.c >>> index b75361e95e97..8caacdd624bd 100644 >>> --- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c >>> +++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c >>> @@ -1550,7 +1550,7 @@ void intel_connector_debugfs_add(struct intel_connector *connector) >>> connector, &i915_dsc_fractional_bpp_fops); >>> } >>> >>> - if (DISPLAY_VER(i915) >= 11 && >>> + if (HAS_BIGJOINER(i915) && >>> (connector_type == DRM_MODE_CONNECTOR_DisplayPort || >>> connector_type == DRM_MODE_CONNECTOR_eDP)) { >>> debugfs_create_bool("i915_bigjoiner_force_enable", 0644, root, >>> diff --git a/drivers/gpu/drm/i915/display/intel_display_device.h b/drivers/gpu/drm/i915/display/intel_display_device.h >>> index dfb0c8bf5ca2..5306bbd13e59 100644 >>> --- a/drivers/gpu/drm/i915/display/intel_display_device.h >>> +++ b/drivers/gpu/drm/i915/display/intel_display_device.h >>> @@ -118,6 +118,7 @@ enum intel_display_subplatform { >>> >>> #define HAS_4TILE(i915) (IS_DG2(i915) || DISPLAY_VER(i915) >= 14) >>> #define HAS_ASYNC_FLIPS(i915) (DISPLAY_VER(i915) >= 5) >>> +#define HAS_BIGJOINER(i915) (DISPLAY_VER(i915) >= 11) >>> #define HAS_CDCLK_CRAWL(i915) (DISPLAY_INFO(i915)->has_cdclk_crawl) >>> #define HAS_CDCLK_SQUASH(i915) (DISPLAY_INFO(i915)->has_cdclk_squash) >>> #define HAS_CUR_FBC(i915) (!HAS_GMCH(i915) && IS_DISPLAY_VER(i915, 7, 13)) >>> @@ -152,6 +153,7 @@ enum intel_display_subplatform { >>> #define HAS_SAGV(i915) (DISPLAY_VER(i915) >= 9 && !IS_LP(i915)) >>> #define HAS_TRANSCODER(i915, trans) ((DISPLAY_RUNTIME_INFO(i915)->cpu_transcoder_mask & \ >>> BIT(trans)) != 0) >>> +#define HAS_UNCOMPRESSED_JOINER(i915) (DISPLAY_VER(i915) >= 13) >>> #define HAS_VRR(i915) (DISPLAY_VER(i915) >= 11) >>> #define HAS_AS_SDP(i915) (DISPLAY_VER(i915) >= 13) >>> #define HAS_CMRR(i915) (DISPLAY_VER(i915) >= 20) >>> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c >>> index cb0f6db5f8e7..c53eb8e165de 100644 >>> --- a/drivers/gpu/drm/i915/display/intel_dp.c >>> +++ b/drivers/gpu/drm/i915/display/intel_dp.c >>> @@ -2520,7 +2520,7 @@ bool intel_dp_joiner_needs_dsc(struct drm_i915_private *i915, bool use_joiner) >>> * limitation. DG2 onwards pipe joiner can be enabled without >>> * compression. >>> */ >>> - return DISPLAY_VER(i915) < 13 && use_joiner; >>> + return !HAS_UNCOMPRESSED_JOINER(i915) && use_joiner; >>> } >>> >>> static int
diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index fdf244a32b24..d4a371edfcdd 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -1712,7 +1712,7 @@ static void hsw_crtc_enable(struct intel_atomic_state *state, intel_dsc_enable(pipe_crtc_state); - if (DISPLAY_VER(dev_priv) >= 13) + if (HAS_UNCOMPRESSED_JOINER(dev_priv)) intel_uncompressed_joiner_enable(pipe_crtc_state); intel_set_pipe_src_size(pipe_crtc_state); @@ -3546,6 +3546,9 @@ static void enabled_joiner_pipes(struct drm_i915_private *dev_priv, *primary_pipes = 0; *secondary_pipes = 0; + if (!HAS_BIGJOINER(dev_priv)) + return; + for_each_intel_crtc_in_pipe_mask(&dev_priv->drm, crtc, joiner_pipes(dev_priv)) { enum intel_display_power_domain power_domain; @@ -3565,7 +3568,7 @@ static void enabled_joiner_pipes(struct drm_i915_private *dev_priv, *secondary_pipes |= BIT(pipe); } - if (DISPLAY_VER(dev_priv) < 13) + if (!HAS_UNCOMPRESSED_JOINER(dev_priv)) continue; power_domain = POWER_DOMAIN_PIPE(pipe); @@ -7966,7 +7969,7 @@ static int max_dotclock(struct drm_i915_private *i915) int max_dotclock = i915->display.cdclk.max_dotclk_freq; /* icl+ might use joiner */ - if (DISPLAY_VER(i915) >= 11) + if (HAS_BIGJOINER(i915)) max_dotclock *= 2; return max_dotclock; diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c b/drivers/gpu/drm/i915/display/intel_display_debugfs.c index b75361e95e97..8caacdd624bd 100644 --- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c +++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c @@ -1550,7 +1550,7 @@ void intel_connector_debugfs_add(struct intel_connector *connector) connector, &i915_dsc_fractional_bpp_fops); } - if (DISPLAY_VER(i915) >= 11 && + if (HAS_BIGJOINER(i915) && (connector_type == DRM_MODE_CONNECTOR_DisplayPort || connector_type == DRM_MODE_CONNECTOR_eDP)) { debugfs_create_bool("i915_bigjoiner_force_enable", 0644, root, diff --git a/drivers/gpu/drm/i915/display/intel_display_device.h b/drivers/gpu/drm/i915/display/intel_display_device.h index dfb0c8bf5ca2..5306bbd13e59 100644 --- a/drivers/gpu/drm/i915/display/intel_display_device.h +++ b/drivers/gpu/drm/i915/display/intel_display_device.h @@ -118,6 +118,7 @@ enum intel_display_subplatform { #define HAS_4TILE(i915) (IS_DG2(i915) || DISPLAY_VER(i915) >= 14) #define HAS_ASYNC_FLIPS(i915) (DISPLAY_VER(i915) >= 5) +#define HAS_BIGJOINER(i915) (DISPLAY_VER(i915) >= 11) #define HAS_CDCLK_CRAWL(i915) (DISPLAY_INFO(i915)->has_cdclk_crawl) #define HAS_CDCLK_SQUASH(i915) (DISPLAY_INFO(i915)->has_cdclk_squash) #define HAS_CUR_FBC(i915) (!HAS_GMCH(i915) && IS_DISPLAY_VER(i915, 7, 13)) @@ -152,6 +153,7 @@ enum intel_display_subplatform { #define HAS_SAGV(i915) (DISPLAY_VER(i915) >= 9 && !IS_LP(i915)) #define HAS_TRANSCODER(i915, trans) ((DISPLAY_RUNTIME_INFO(i915)->cpu_transcoder_mask & \ BIT(trans)) != 0) +#define HAS_UNCOMPRESSED_JOINER(i915) (DISPLAY_VER(i915) >= 13) #define HAS_VRR(i915) (DISPLAY_VER(i915) >= 11) #define HAS_AS_SDP(i915) (DISPLAY_VER(i915) >= 13) #define HAS_CMRR(i915) (DISPLAY_VER(i915) >= 20) diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index cb0f6db5f8e7..c53eb8e165de 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -2520,7 +2520,7 @@ bool intel_dp_joiner_needs_dsc(struct drm_i915_private *i915, bool use_joiner) * limitation. DG2 onwards pipe joiner can be enabled without * compression. */ - return DISPLAY_VER(i915) < 13 && use_joiner; + return !HAS_UNCOMPRESSED_JOINER(i915) && use_joiner; } static int
Add macros to check if platform supports bigjoiner/uncompressed joiner. Replace the existing DISPLAY_VER checks with these. Additionally use it before readout for joiner stuff, where its missing. Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com> --- drivers/gpu/drm/i915/display/intel_display.c | 9 ++++++--- drivers/gpu/drm/i915/display/intel_display_debugfs.c | 2 +- drivers/gpu/drm/i915/display/intel_display_device.h | 2 ++ drivers/gpu/drm/i915/display/intel_dp.c | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-)