All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Nautiyal, Ankit K" <ankit.k.nautiyal@intel.com>
To: "Kandpal, Suraj" <suraj.kandpal@intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>
Cc: "Nikula, Jani" <jani.nikula@intel.com>
Subject: Re: [Intel-gfx] [PATCH 4/4] drm/i915/dp: Ignore max_requested_bpc if its too low for DSC
Date: Wed, 15 Nov 2023 14:31:08 +0530	[thread overview]
Message-ID: <ac8e85ff-a154-36aa-e95a-b9b0e4c60049@intel.com> (raw)
In-Reply-To: <SN7PR11MB6750D4F10D0098B25ECF223AE3AFA@SN7PR11MB6750.namprd11.prod.outlook.com>


On 11/9/2023 12:19 PM, Kandpal, Suraj wrote:
>
>> -----Original Message-----
>> From: Intel-gfx <intel-gfx-bounces@lists.freedesktop.org> On Behalf Of Ankit
>> Nautiyal
>> Sent: Tuesday, November 7, 2023 9:48 AM
>> To: intel-gfx@lists.freedesktop.org
>> Cc: Nikula, Jani <jani.nikula@intel.com>
>> Subject: [Intel-gfx] [PATCH 4/4] drm/i915/dp: Ignore max_requested_bpc if its
>> too low for DSC
>>
>> At the moment, while choosing the input bpc for DSC, we take into account the
>> max_requested_bpc property. This creates a problem, if the
>> max_requested_bpc is lower than the minimum bpc required by source with
>> DSC.
>>
>> So consider max_requested_bpc if its within the limits that we can support with
>> DSC.
>>
>> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
>> ---
>>   drivers/gpu/drm/i915/display/intel_dp.c | 22 ++++++++++++++++++----
>>   1 file changed, 18 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c
>> b/drivers/gpu/drm/i915/display/intel_dp.c
>> index abc718f1a878..ea4c42a5705e 100644
>> --- a/drivers/gpu/drm/i915/display/intel_dp.c
>> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
>> @@ -1578,6 +1578,16 @@ u8 intel_dp_dsc_max_src_input_bpc(struct
>> drm_i915_private *i915)
>>   	return 12;
>>   }
>>
>> +static int
>> +intel_dp_dsc_limit_max_bpc(int max_requested_bpc, int src_dsc_max_bpc,
>> +int src_dsc_min_bpc) {
>> +	/* Consider max_requested_bpc only if src can support it with DSC */
>> +	if (max_requested_bpc >= src_dsc_min_bpc)
>> +		return min(src_dsc_max_bpc, max_requested_bpc);
>> +
>> +	return src_dsc_max_bpc;
>> +}
>> +
>>   int intel_dp_dsc_compute_max_bpp(const struct intel_connector *connector,
>>   				 u8 max_req_bpc)
>>   {
>> @@ -1591,7 +1601,8 @@ int intel_dp_dsc_compute_max_bpp(const struct
>> intel_connector *connector,
>>   	if (!dsc_max_bpc)
>>   		return dsc_max_bpc;
>>
>> -	dsc_max_bpc = min_t(u8, dsc_max_bpc, max_req_bpc);
>> +	dsc_max_bpc = intel_dp_dsc_limit_max_bpc(max_req_bpc,
>> dsc_max_bpc,
>> +
>> intel_dp_dsc_min_src_input_bpc(i915));
>>
>>   	num_bpc = drm_dp_dsc_sink_supported_input_bpcs(connector-
>>> dp.dsc_dpcd,
>>   						       dsc_bpc);
>> @@ -1959,8 +1970,11 @@ bool is_dsc_pipe_bpp_sufficient(struct
>> drm_i915_private *i915,  {
>>   	u8 dsc_max_bpc, dsc_min_bpc, dsc_max_pipe_bpp,
>> dsc_min_pipe_bpp;
>>
>> -	dsc_max_bpc = min(intel_dp_dsc_max_src_input_bpc(i915),
>> conn_state->max_requested_bpc);
>>   	dsc_min_bpc = intel_dp_dsc_min_src_input_bpc(i915);
>> +	dsc_max_bpc = intel_dp_dsc_max_src_input_bpc(i915);
> Seems like this change could have been a part of the previous patch.

Hi Suraj,

Previous patch was only using helpers to get src_min_max dsc bpc for dp 
mst case.

Regards,

Ankit


>
> Regards,
> Suraj Kandpal
>> +
>> +	dsc_max_bpc = intel_dp_dsc_limit_max_bpc(conn_state-
>>> max_requested_bpc,
>> +						 dsc_max_bpc, dsc_min_bpc);
>>
>>   	dsc_max_pipe_bpp = min(dsc_max_bpc * 3, limits->pipe.max_bpp);
>>   	dsc_min_pipe_bpp = max(dsc_min_bpc * 3, limits->pipe.min_bpp);
>> @@ -2020,14 +2034,14 @@ static int intel_dp_dsc_compute_pipe_bpp(struct
>> intel_dp *intel_dp,
>>   		}
>>   	}
>>
>> +	dsc_min_bpc = intel_dp_dsc_min_src_input_bpc(i915);
>>   	dsc_max_bpc = intel_dp_dsc_max_src_input_bpc(i915);
>>   	if (!dsc_max_bpc)
>>   		return -EINVAL;
>>
>> -	dsc_max_bpc = min_t(u8, dsc_max_bpc, max_req_bpc);
>> +	dsc_max_bpc = intel_dp_dsc_limit_max_bpc(max_req_bpc,
>> dsc_max_bpc,
>> +dsc_min_bpc);
>>   	dsc_max_bpp = min(dsc_max_bpc * 3, limits->pipe.max_bpp);
>>
>> -	dsc_min_bpc = intel_dp_dsc_min_src_input_bpc(i915);
>>   	dsc_min_bpp = max(dsc_min_bpc * 3, limits->pipe.min_bpp);
>>
>>   	/*
>> --
>> 2.40.1

  reply	other threads:[~2023-11-15  9:01 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-07  4:17 [Intel-gfx] [PATCH 0/4] DP DSC min/max src bpc fixes Ankit Nautiyal
2023-11-07  4:17 ` [Intel-gfx] [PATCH 1/4] drm/i915/dp: Simplify checks for helper intel_dp_dsc_max_src_input_bpc Ankit Nautiyal
2023-11-07  9:58   ` Jani Nikula
2023-11-08  4:02     ` Nautiyal, Ankit K
2023-11-16 14:54   ` Ankit Nautiyal
2023-11-07  4:17 ` [Intel-gfx] [PATCH 2/4] drm/i915/dp: Fix the max DSC bpc supported by source Ankit Nautiyal
2023-11-07  4:17 ` [Intel-gfx] [PATCH 3/4] drm/i915/dp_mst: Use helpers to get dsc min/max input bpc Ankit Nautiyal
2023-11-09  6:36   ` Kandpal, Suraj
2023-11-07  4:17 ` [Intel-gfx] [PATCH 4/4] drm/i915/dp: Ignore max_requested_bpc if its too low for DSC Ankit Nautiyal
2023-11-09  6:49   ` Kandpal, Suraj
2023-11-15  9:01     ` Nautiyal, Ankit K [this message]
2023-11-07  5:01 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for DP DSC min/max src bpc fixes (rev2) Patchwork
2023-11-07  5:08 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-11-07 14:09 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2023-11-16 20:08 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for DP DSC min/max src bpc fixes (rev4) Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2023-11-23  4:27 [Intel-gfx] [PATCH 0/4] DP DSC min/max src bpc fixes Ankit Nautiyal
2023-11-23  4:27 ` [Intel-gfx] [PATCH 4/4] drm/i915/dp: Ignore max_requested_bpc if its too low for DSC 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=ac8e85ff-a154-36aa-e95a-b9b0e4c60049@intel.com \
    --to=ankit.k.nautiyal@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=suraj.kandpal@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.