Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: "Kandpal, Suraj" <suraj.kandpal@intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [PATCH 1/8] drm/i915/dsc: improve clarify of the pps reg read/write helpers
Date: Mon, 11 Sep 2023 18:45:00 +0300	[thread overview]
Message-ID: <87jzswemtf.fsf@intel.com> (raw)
In-Reply-To: <SN7PR11MB6750AC31322962CAF2C836ACE3EEA@SN7PR11MB6750.namprd11.prod.outlook.com>

On Thu, 07 Sep 2023, "Kandpal, Suraj" <suraj.kandpal@intel.com> wrote:
>> Subject: [PATCH 1/8] drm/i915/dsc: improve clarify of the pps reg read/write
>> helpers
>
> Should be clarity here in the commit header

Thanks, fixed.

>
> With that fixed
> Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>

Thanks for the reviews, pushed the lot to drm-intel-next.

BR,
Jani.


>>
>> Make it clear what's the number of vdsc per pipe, and what's the number of
>> registers to grab. Have intel_dsc_get_pps_reg() return the registers it knows
>> even if the requested amount is bigger.
>>
>> Cc: Suraj Kandpal <suraj.kandpal@intel.com>
>> Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>> ---
>>  drivers/gpu/drm/i915/display/intel_vdsc.c | 40 ++++++++++++-----------
>>  1 file changed, 21 insertions(+), 19 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/display/intel_vdsc.c
>> b/drivers/gpu/drm/i915/display/intel_vdsc.c
>> index b24601d0b2c5..14317bb6d3df 100644
>> --- a/drivers/gpu/drm/i915/display/intel_vdsc.c
>> +++ b/drivers/gpu/drm/i915/display/intel_vdsc.c
>> @@ -372,7 +372,7 @@ int intel_dsc_get_num_vdsc_instances(const struct
>> intel_crtc_state *crtc_state)  }
>>
>>  static void intel_dsc_get_pps_reg(const struct intel_crtc_state *crtc_state, int
>> pps,
>> -                               i915_reg_t *dsc_reg, int vdsc_per_pipe)
>> +                               i915_reg_t *dsc_reg, int dsc_reg_num)
>>  {
>>       struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
>>       enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; @@ -
>> 381,16 +381,12 @@ static void intel_dsc_get_pps_reg(const struct
>> intel_crtc_state *crtc_state, int
>>
>>       pipe_dsc = is_pipe_dsc(crtc, cpu_transcoder);
>>
>> -     switch (vdsc_per_pipe) {
>> -     case 2:
>> +     if (dsc_reg_num >= 3)
>> +             MISSING_CASE(dsc_reg_num);
>> +     if (dsc_reg_num >= 2)
>>               dsc_reg[1] = pipe_dsc ? ICL_DSC1_PPS(pipe, pps) :
>> DSCC_PPS(pps);
>> -             fallthrough;
>> -     case 1:
>> +     if (dsc_reg_num >= 1)
>>               dsc_reg[0] = pipe_dsc ? ICL_DSC0_PPS(pipe, pps) :
>> DSCA_PPS(pps);
>> -             break;
>> -     default:
>> -             MISSING_CASE(vdsc_per_pipe);
>> -     }
>>  }
>>
>>  static void intel_dsc_write_pps_reg(const struct intel_crtc_state *crtc_state,
>> @@ -399,13 +395,16 @@ static void intel_dsc_write_pps_reg(const struct
>> intel_crtc_state *crtc_state,
>>       struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
>>       struct drm_i915_private *i915 = to_i915(crtc->base.dev);
>>       i915_reg_t dsc_reg[2];
>> -     int i, vdsc_per_pipe = intel_dsc_get_vdsc_per_pipe(crtc_state);
>> +     int i, vdsc_per_pipe, dsc_reg_num;
>> +
>> +     vdsc_per_pipe = intel_dsc_get_vdsc_per_pipe(crtc_state);
>> +     dsc_reg_num = min_t(int, ARRAY_SIZE(dsc_reg), vdsc_per_pipe);
>>
>> -     drm_WARN_ON_ONCE(&i915->drm, ARRAY_SIZE(dsc_reg) <
>> vdsc_per_pipe);
>> +     drm_WARN_ON_ONCE(&i915->drm, dsc_reg_num < vdsc_per_pipe);
>>
>> -     intel_dsc_get_pps_reg(crtc_state, pps, dsc_reg, vdsc_per_pipe);
>> +     intel_dsc_get_pps_reg(crtc_state, pps, dsc_reg, dsc_reg_num);
>>
>> -     for (i = 0; i < min_t(int, ARRAY_SIZE(dsc_reg), vdsc_per_pipe); i++)
>> +     for (i = 0; i < dsc_reg_num; i++)
>>               intel_de_write(i915, dsc_reg[i], pps_val);  }
>>
>> @@ -815,16 +814,19 @@ static bool intel_dsc_read_pps_reg(struct
>> intel_crtc_state *crtc_state,  {
>>       struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
>>       struct drm_i915_private *i915 = to_i915(crtc->base.dev);
>> -     const int vdsc_per_pipe = intel_dsc_get_vdsc_per_pipe(crtc_state);
>>       i915_reg_t dsc_reg[2];
>> -     int i;
>> +     int i, vdsc_per_pipe, dsc_reg_num;
>>
>> -     *pps_val = 0;
>> -     drm_WARN_ON_ONCE(&i915->drm, ARRAY_SIZE(dsc_reg) <
>> vdsc_per_pipe);
>> +     vdsc_per_pipe = intel_dsc_get_vdsc_per_pipe(crtc_state);
>> +     dsc_reg_num = min_t(int, ARRAY_SIZE(dsc_reg), vdsc_per_pipe);
>>
>> -     intel_dsc_get_pps_reg(crtc_state, pps, dsc_reg, vdsc_per_pipe);
>> +     drm_WARN_ON_ONCE(&i915->drm, dsc_reg_num < vdsc_per_pipe);
>> +
>> +     intel_dsc_get_pps_reg(crtc_state, pps, dsc_reg, dsc_reg_num);
>> +
>> +     *pps_val = 0;
>>
>> -     for (i = 0; i < min_t(int, ARRAY_SIZE(dsc_reg), vdsc_per_pipe); i++) {
>> +     for (i = 0; i < dsc_reg_num; i++) {
>>               u32 pps_temp;
>>
>>               pps_temp = intel_de_read(i915, dsc_reg[i]);
>> --
>> 2.39.2
>

-- 
Jani Nikula, Intel Open Source Graphics Center

  reply	other threads:[~2023-09-11 15:46 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-05 17:11 [Intel-gfx] [PATCH 0/8] drm/i915/dsc: cleanups Jani Nikula
2023-09-05 17:11 ` [Intel-gfx] [PATCH 1/8] drm/i915/dsc: improve clarify of the pps reg read/write helpers Jani Nikula
2023-09-07  4:46   ` Kandpal, Suraj
2023-09-11 15:45     ` Jani Nikula [this message]
2023-09-05 17:11 ` [Intel-gfx] [PATCH 2/8] drm/i915/dsc: have intel_dsc_pps_read_and_verify() return the value Jani Nikula
2023-09-07  4:57   ` Kandpal, Suraj
2023-09-05 17:11 ` [Intel-gfx] [PATCH 3/8] drm/i915/dsc: have intel_dsc_pps_read() " Jani Nikula
2023-09-07  5:05   ` Kandpal, Suraj
2023-09-05 17:11 ` [Intel-gfx] [PATCH 4/8] drm/i915/dsc: rename pps write to intel_dsc_pps_write() Jani Nikula
2023-09-07  5:07   ` Kandpal, Suraj
2023-09-05 17:11 ` [Intel-gfx] [PATCH 5/8] drm/i915/dsc: drop redundant = 0 assignments Jani Nikula
2023-09-08  4:32   ` Kandpal, Suraj
2023-09-05 17:11 ` [Intel-gfx] [PATCH 6/8] drm/i915/dsc: clean up pps comments Jani Nikula
2023-09-07  5:10   ` Kandpal, Suraj
2023-09-05 17:11 ` [Intel-gfx] [PATCH 7/8] drm/i915/dsc: add the PPS number to the register content macros Jani Nikula
2023-09-07  5:42   ` Kandpal, Suraj
2023-09-07  5:51   ` Kandpal, Suraj
2023-09-05 17:11 ` [Intel-gfx] [PATCH 8/8] drm/i915/dsc: use REG_BIT, REG_GENMASK, and friends for PPS0 and PPS1 Jani Nikula
2023-09-07  5:51   ` Kandpal, Suraj
2023-09-06  0:42 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/dsc: cleanups Patchwork
2023-09-06  0:54 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-09-06  2:18 ` [Intel-gfx] ✓ 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=87jzswemtf.fsf@intel.com \
    --to=jani.nikula@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox