From: Jani Nikula <jani.nikula@intel.com>
To: "Navare, Manasi" <manasi.d.navare@intel.com>,
Swati Sharma <swati2.sharma@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH] drm/i915/dsc: Add is_dsc_supported()
Date: Fri, 04 Nov 2022 12:28:53 +0200 [thread overview]
Message-ID: <874jvfau8q.fsf@intel.com> (raw)
In-Reply-To: <20221103192000.GA2883421@mdnavare-mobl1.jf.intel.com>
On Thu, 03 Nov 2022, "Navare, Manasi" <manasi.d.navare@intel.com> wrote:
> On Thu, Nov 03, 2022 at 11:32:22AM +0530, Swati Sharma wrote:
>> Lets use RUNTIME_INFO->has_dsc since platforms supporting dsc has this
>> flag enabled.
>>
>> This is done based on the review comments received on
>> https://patchwork.freedesktop.org/patch/509393/
I don't think that's necessary. If it were an idea worth crediting, the
usual way is using Suggested-by: tag.
>>
>> Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
>> ---
>> drivers/gpu/drm/i915/display/intel_dp.c | 6 +++---
>> drivers/gpu/drm/i915/display/intel_vdsc.c | 7 ++++++-
>> drivers/gpu/drm/i915/display/intel_vdsc.h | 2 ++
>> 3 files changed, 11 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
>> index 7400d6b4c587..eb908da80f2b 100644
>> --- a/drivers/gpu/drm/i915/display/intel_dp.c
>> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
>> @@ -1012,7 +1012,7 @@ intel_dp_mode_valid(struct drm_connector *_connector,
>> * Output bpp is stored in 6.4 format so right shift by 4 to get the
>> * integer value since we support only integer values of bpp.
>> */
>> - if (DISPLAY_VER(dev_priv) >= 10 &&
>> + if (is_dsc_supported(dev_priv) &&
>> drm_dp_sink_supports_dsc(intel_dp->dsc_dpcd)) {
>> /*
>> * TBD pass the connector BPC,
>> @@ -2906,7 +2906,7 @@ intel_edp_init_dpcd(struct intel_dp *intel_dp)
>> intel_dp_set_max_sink_lane_count(intel_dp);
>>
>> /* Read the eDP DSC DPCD registers */
>> - if (DISPLAY_VER(dev_priv) >= 10)
>> + if (is_dsc_supported(dev_priv))
>> intel_dp_get_dsc_sink_cap(intel_dp);
>>
>> /*
>> @@ -4691,7 +4691,7 @@ intel_dp_detect(struct drm_connector *connector,
>> }
>>
>> /* Read DP Sink DSC Cap DPCD regs for DP v1.4 */
>> - if (DISPLAY_VER(dev_priv) >= 11)
>> + if (is_dsc_supported(dev_priv))
>> intel_dp_get_dsc_sink_cap(intel_dp);
>>
>> intel_dp_configure_mst(intel_dp);
>> diff --git a/drivers/gpu/drm/i915/display/intel_vdsc.c b/drivers/gpu/drm/i915/display/intel_vdsc.c
>> index 269f9792390d..e7c1169538da 100644
>> --- a/drivers/gpu/drm/i915/display/intel_vdsc.c
>> +++ b/drivers/gpu/drm/i915/display/intel_vdsc.c
>> @@ -338,13 +338,18 @@ static const struct rc_parameters *get_rc_params(u16 compressed_bpp,
>> return &rc_parameters[row_index][column_index];
>> }
>>
>> +bool is_dsc_supported(struct drm_i915_private *dev_priv)
>> +{
>> + return RUNTIME_INFO(dev_priv)->has_dsc;
>> +}
>> +
All of the wrappers to runtime/device info members are of the form:
#define HAS_DSC(__i915) (RUNTIME_INFO(__i915)->has_dsc)
in i915_drv.h.
>> bool intel_dsc_source_support(const struct intel_crtc_state *crtc_state)
>> {
>> const struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
>> struct drm_i915_private *i915 = to_i915(crtc->base.dev);
>> enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;
>>
>> - if (!RUNTIME_INFO(i915)->has_dsc)
>> + if (!is_dsc_supported(i915))
>> return false;
>>
>> if (DISPLAY_VER(i915) >= 12)
>
> In Runtime info, Gen 12 should have Gen 11 runtime has dsc set, so makes
> this check here redundant.
As it is, it's not redundant. It's tied to the transcoder check.
But this could be simplified as:
if (!HAS_DSC(i915))
return false;
if (DISPLAY_VER(i915) == 11 && cpu_transcoder == TRANSCODER_A)
return false;
return true;
It could be condenced even further, but at the const of losing clarity.
BR,
Jani.
>
> Manasi
>
>> diff --git a/drivers/gpu/drm/i915/display/intel_vdsc.h b/drivers/gpu/drm/i915/display/intel_vdsc.h
>> index 8763f00fa7e2..049e8b95fdde 100644
>> --- a/drivers/gpu/drm/i915/display/intel_vdsc.h
>> +++ b/drivers/gpu/drm/i915/display/intel_vdsc.h
>> @@ -12,7 +12,9 @@ enum transcoder;
>> struct intel_crtc;
>> struct intel_crtc_state;
>> struct intel_encoder;
>> +struct drm_i915_private;
>>
>> +bool is_dsc_supported(struct drm_i915_private *dev_priv);
>> bool intel_dsc_source_support(const struct intel_crtc_state *crtc_state);
>> void intel_uncompressed_joiner_enable(const struct intel_crtc_state *crtc_state);
>> void intel_dsc_enable(const struct intel_crtc_state *crtc_state);
>> --
>> 2.25.1
>>
--
Jani Nikula, Intel Open Source Graphics Center
next prev parent reply other threads:[~2022-11-04 10:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-03 6:02 [Intel-gfx] [PATCH] drm/i915/dsc: Add is_dsc_supported() Swati Sharma
2022-11-03 8:07 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2022-11-03 19:20 ` [Intel-gfx] [PATCH] " Navare, Manasi
2022-11-04 10:28 ` Jani Nikula [this message]
2022-11-10 9:32 ` Swati Sharma
2022-11-03 19:26 ` [Intel-gfx] ✗ Fi.CI.IGT: failure for " 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=874jvfau8q.fsf@intel.com \
--to=jani.nikula@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=manasi.d.navare@intel.com \
--cc=swati2.sharma@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.