diff mbox series

[v11,1/9] drm/display/dsc: Add flatness and initial scale value calculations

Message ID 20230329-rfc-msm-dsc-helper-v11-1-30270e1eeac3@quicinc.com (mailing list archive)
State New, archived
Headers show
Series Introduce MSM-specific DSC helpers | expand

Commit Message

Jessica Zhang May 17, 2023, 6:51 p.m. UTC
Add helpers to calculate det_thresh_flatness and initial_scale_value as
these calculations are defined within the DSC spec.

Signed-off-by: Jessica Zhang <quic_jesszhan@quicinc.com>
---
 include/drm/display/drm_dsc_helper.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Marijn Suijten May 17, 2023, 9:13 p.m. UTC | #1
On 2023-05-17 11:51:10, Jessica Zhang wrote:
> Add helpers to calculate det_thresh_flatness and initial_scale_value as
> these calculations are defined within the DSC spec.
> 
> Signed-off-by: Jessica Zhang <quic_jesszhan@quicinc.com>

Was this r-b dropped because of changing the return types in v10->v11?

Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org>

> ---
>  include/drm/display/drm_dsc_helper.h | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/include/drm/display/drm_dsc_helper.h b/include/drm/display/drm_dsc_helper.h
> index 0bb0c3afd740..528dfb5e25fc 100644
> --- a/include/drm/display/drm_dsc_helper.h
> +++ b/include/drm/display/drm_dsc_helper.h
> @@ -25,5 +25,15 @@ void drm_dsc_set_rc_buf_thresh(struct drm_dsc_config *vdsc_cfg);
>  int drm_dsc_setup_rc_params(struct drm_dsc_config *vdsc_cfg, enum drm_dsc_params_kind kind);
>  int drm_dsc_compute_rc_parameters(struct drm_dsc_config *vdsc_cfg);
>  
> +static inline u8 drm_dsc_initial_scale_value(const struct drm_dsc_config *dsc)
> +{
> +	return 8 * dsc->rc_model_size / (dsc->rc_model_size - dsc->initial_offset);
> +}
> +
> +static inline u32 drm_dsc_flatness_det_thresh(const struct drm_dsc_config *dsc)
> +{
> +	return 2 << (dsc->bits_per_component - 8);
> +}
> +
>  #endif /* _DRM_DSC_HELPER_H_ */
>  
> 
> -- 
> 2.40.1
>
Jessica Zhang May 17, 2023, 9:32 p.m. UTC | #2
On 5/17/2023 2:13 PM, Marijn Suijten wrote:
> On 2023-05-17 11:51:10, Jessica Zhang wrote:
>> Add helpers to calculate det_thresh_flatness and initial_scale_value as
>> these calculations are defined within the DSC spec.
>>
>> Signed-off-by: Jessica Zhang <quic_jesszhan@quicinc.com>
> 
> Was this r-b dropped because of changing the return types in v10->v11?

Hi Marijn,

Yea. I'm not sure what the protocol is for keeping/dropping r-b tags, so 
dropped the r-b because I wasn't sure if the change counted as significant.

Thanks,

Jessica Zhang

> 
> Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org>
> 
>> ---
>>   include/drm/display/drm_dsc_helper.h | 10 ++++++++++
>>   1 file changed, 10 insertions(+)
>>
>> diff --git a/include/drm/display/drm_dsc_helper.h b/include/drm/display/drm_dsc_helper.h
>> index 0bb0c3afd740..528dfb5e25fc 100644
>> --- a/include/drm/display/drm_dsc_helper.h
>> +++ b/include/drm/display/drm_dsc_helper.h
>> @@ -25,5 +25,15 @@ void drm_dsc_set_rc_buf_thresh(struct drm_dsc_config *vdsc_cfg);
>>   int drm_dsc_setup_rc_params(struct drm_dsc_config *vdsc_cfg, enum drm_dsc_params_kind kind);
>>   int drm_dsc_compute_rc_parameters(struct drm_dsc_config *vdsc_cfg);
>>   
>> +static inline u8 drm_dsc_initial_scale_value(const struct drm_dsc_config *dsc)
>> +{
>> +	return 8 * dsc->rc_model_size / (dsc->rc_model_size - dsc->initial_offset);
>> +}
>> +
>> +static inline u32 drm_dsc_flatness_det_thresh(const struct drm_dsc_config *dsc)
>> +{
>> +	return 2 << (dsc->bits_per_component - 8);
>> +}
>> +
>>   #endif /* _DRM_DSC_HELPER_H_ */
>>   
>>
>> -- 
>> 2.40.1
>>
Marijn Suijten May 17, 2023, 10:58 p.m. UTC | #3
On 2023-05-17 14:32:42, Jessica Zhang wrote:
> 
> 
> On 5/17/2023 2:13 PM, Marijn Suijten wrote:
> > On 2023-05-17 11:51:10, Jessica Zhang wrote:
> >> Add helpers to calculate det_thresh_flatness and initial_scale_value as
> >> these calculations are defined within the DSC spec.
> >>
> >> Signed-off-by: Jessica Zhang <quic_jesszhan@quicinc.com>
> > 
> > Was this r-b dropped because of changing the return types in v10->v11?
> 
> Hi Marijn,
> 
> Yea. I'm not sure what the protocol is for keeping/dropping r-b tags, so 
> dropped the r-b because I wasn't sure if the change counted as significant.

Yeah, seems to be standard practice on nontrivial changes but in this
case I left a review on a patch that already has my r-b, and you changed
exactly what I requested.  Probably fine either way.

- Marijn

> 
> Thanks,
> 
> Jessica Zhang
> 
> > 
> > Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org>
> > 
> >> ---
> >>   include/drm/display/drm_dsc_helper.h | 10 ++++++++++
> >>   1 file changed, 10 insertions(+)
> >>
> >> diff --git a/include/drm/display/drm_dsc_helper.h b/include/drm/display/drm_dsc_helper.h
> >> index 0bb0c3afd740..528dfb5e25fc 100644
> >> --- a/include/drm/display/drm_dsc_helper.h
> >> +++ b/include/drm/display/drm_dsc_helper.h
> >> @@ -25,5 +25,15 @@ void drm_dsc_set_rc_buf_thresh(struct drm_dsc_config *vdsc_cfg);
> >>   int drm_dsc_setup_rc_params(struct drm_dsc_config *vdsc_cfg, enum drm_dsc_params_kind kind);
> >>   int drm_dsc_compute_rc_parameters(struct drm_dsc_config *vdsc_cfg);
> >>   
> >> +static inline u8 drm_dsc_initial_scale_value(const struct drm_dsc_config *dsc)
> >> +{
> >> +	return 8 * dsc->rc_model_size / (dsc->rc_model_size - dsc->initial_offset);
> >> +}
> >> +
> >> +static inline u32 drm_dsc_flatness_det_thresh(const struct drm_dsc_config *dsc)
> >> +{
> >> +	return 2 << (dsc->bits_per_component - 8);
> >> +}
> >> +
> >>   #endif /* _DRM_DSC_HELPER_H_ */
> >>   
> >>
> >> -- 
> >> 2.40.1
> >>
Dmitry Baryshkov May 18, 2023, 12:43 a.m. UTC | #4
On 18/05/2023 01:58, Marijn Suijten wrote:
> On 2023-05-17 14:32:42, Jessica Zhang wrote:
>>
>>
>> On 5/17/2023 2:13 PM, Marijn Suijten wrote:
>>> On 2023-05-17 11:51:10, Jessica Zhang wrote:
>>>> Add helpers to calculate det_thresh_flatness and initial_scale_value as
>>>> these calculations are defined within the DSC spec.
>>>>
>>>> Signed-off-by: Jessica Zhang <quic_jesszhan@quicinc.com>
>>>
>>> Was this r-b dropped because of changing the return types in v10->v11?
>>
>> Hi Marijn,
>>
>> Yea. I'm not sure what the protocol is for keeping/dropping r-b tags, so
>> dropped the r-b because I wasn't sure if the change counted as significant.
> 
> Yeah, seems to be standard practice on nontrivial changes but in this
> case I left a review on a patch that already has my r-b, and you changed
> exactly what I requested.  Probably fine either way.

Yes. Usually for trivial changes (e.g. whitespaces, renames, commit 
message changes) one can keep the RB/AB/TB tags.
diff mbox series

Patch

diff --git a/include/drm/display/drm_dsc_helper.h b/include/drm/display/drm_dsc_helper.h
index 0bb0c3afd740..528dfb5e25fc 100644
--- a/include/drm/display/drm_dsc_helper.h
+++ b/include/drm/display/drm_dsc_helper.h
@@ -25,5 +25,15 @@  void drm_dsc_set_rc_buf_thresh(struct drm_dsc_config *vdsc_cfg);
 int drm_dsc_setup_rc_params(struct drm_dsc_config *vdsc_cfg, enum drm_dsc_params_kind kind);
 int drm_dsc_compute_rc_parameters(struct drm_dsc_config *vdsc_cfg);
 
+static inline u8 drm_dsc_initial_scale_value(const struct drm_dsc_config *dsc)
+{
+	return 8 * dsc->rc_model_size / (dsc->rc_model_size - dsc->initial_offset);
+}
+
+static inline u32 drm_dsc_flatness_det_thresh(const struct drm_dsc_config *dsc)
+{
+	return 2 << (dsc->bits_per_component - 8);
+}
+
 #endif /* _DRM_DSC_HELPER_H_ */