diff mbox series

[13/17] drm/i915/dp: Modify compressed bpp limitations for ultrajoiner

Message ID 20240927083831.3913645-14-ankit.k.nautiyal@intel.com (mailing list archive)
State New, archived
Headers show
Series Ultrajoiner basic functionality series | expand

Commit Message

Nautiyal, Ankit K Sept. 27, 2024, 8:38 a.m. UTC
Add compressed bpp limitations for ultrajoiner.

v2: Fix the case for 1 pipe. (Ankit)
v3: Refactor existing helper separately and add only ultrajoiner
limitation. (Ville)

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
---
 drivers/gpu/drm/i915/display/intel_dp.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Nautiyal, Ankit K Sept. 27, 2024, 10:39 a.m. UTC | #1
On 9/27/2024 2:08 PM, Ankit Nautiyal wrote:
> Add compressed bpp limitations for ultrajoiner.
>
> v2: Fix the case for 1 pipe. (Ankit)
> v3: Refactor existing helper separately and add only ultrajoiner
> limitation. (Ville)
>
> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> ---
>   drivers/gpu/drm/i915/display/intel_dp.c | 8 ++++++++
>   1 file changed, 8 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index e7fe100ef8db..3d4d8e58380a 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -896,6 +896,11 @@ static u32 small_joiner_ram_max_bpp(struct intel_display *display, u32 mode_hdis
>   	return max_bpp;
>   }
>   
> +static u32 ultrajoiner_ram_max_bpp(struct intel_display *display, u32 mode_hdisplay)
> +{
> +	return (4 * 72 * 512) / mode_hdisplay;
> +}
> +

Just realized, we dont need display in the function.

Also missed to add separate function for ultrajoiner_ram_bits as:

static int ultrajoiner_ram_bits(void)
{
         return 4 * 72 * 512;
}

static u32 ultrajoiner_ram_max_bpp(u32 mode_hdisplay)
{
         return ultrajoiner_ram_bits / mode_hdisplay;
}


Regards,

Ankit

>   static
>   u32 get_max_compressed_bpp_with_joiner(struct drm_i915_private *i915,
>   				       u32 mode_clock, u32 mode_hdisplay,
> @@ -907,6 +912,9 @@ u32 get_max_compressed_bpp_with_joiner(struct drm_i915_private *i915,
>   	max_bpp = small_joiner_ram_max_bpp(display, mode_hdisplay, num_joined_pipes);
>   	max_bpp = min(max_bpp, bigjoiner_bw_max_bpp(display, mode_clock, num_joined_pipes));
>   
> +	if (num_joined_pipes == 4)
> +		max_bpp = min(max_bpp, ultrajoiner_ram_max_bpp(display, mode_hdisplay));
> +
>   	return max_bpp;
>   }
>
Ville Syrjälä Sept. 27, 2024, 12:41 p.m. UTC | #2
On Fri, Sep 27, 2024 at 02:08:27PM +0530, Ankit Nautiyal wrote:
> Add compressed bpp limitations for ultrajoiner.
> 
> v2: Fix the case for 1 pipe. (Ankit)
> v3: Refactor existing helper separately and add only ultrajoiner
> limitation. (Ville)
> 
> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_dp.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index e7fe100ef8db..3d4d8e58380a 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -896,6 +896,11 @@ static u32 small_joiner_ram_max_bpp(struct intel_display *display, u32 mode_hdis
>  	return max_bpp;
>  }
>  
> +static u32 ultrajoiner_ram_max_bpp(struct intel_display *display, u32 mode_hdisplay)
> +{
> +	return (4 * 72 * 512) / mode_hdisplay;
> +}
> +
>  static
>  u32 get_max_compressed_bpp_with_joiner(struct drm_i915_private *i915,
>  				       u32 mode_clock, u32 mode_hdisplay,
> @@ -907,6 +912,9 @@ u32 get_max_compressed_bpp_with_joiner(struct drm_i915_private *i915,
>  	max_bpp = small_joiner_ram_max_bpp(display, mode_hdisplay, num_joined_pipes);
>  	max_bpp = min(max_bpp, bigjoiner_bw_max_bpp(display, mode_clock, num_joined_pipes));
>  
> +	if (num_joined_pipes == 4)
> +		max_bpp = min(max_bpp, ultrajoiner_ram_max_bpp(display, mode_hdisplay));

So here you handle the "is this ultrajoiner" check outside.
If you want to  stick to that then please use the same approach 
to deal with the bigjoiner_bw_max_bpp()+num_joined_pipes==1
issue I pointed out the other patch.

Or if you want to handle the num_joined_pipes==1 case inside 
bigjoiner_bw_max_bpp() then please adjust this to do a similar
thing.

> +
>  	return max_bpp;
>  }
>  
> -- 
> 2.45.2
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index e7fe100ef8db..3d4d8e58380a 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -896,6 +896,11 @@  static u32 small_joiner_ram_max_bpp(struct intel_display *display, u32 mode_hdis
 	return max_bpp;
 }
 
+static u32 ultrajoiner_ram_max_bpp(struct intel_display *display, u32 mode_hdisplay)
+{
+	return (4 * 72 * 512) / mode_hdisplay;
+}
+
 static
 u32 get_max_compressed_bpp_with_joiner(struct drm_i915_private *i915,
 				       u32 mode_clock, u32 mode_hdisplay,
@@ -907,6 +912,9 @@  u32 get_max_compressed_bpp_with_joiner(struct drm_i915_private *i915,
 	max_bpp = small_joiner_ram_max_bpp(display, mode_hdisplay, num_joined_pipes);
 	max_bpp = min(max_bpp, bigjoiner_bw_max_bpp(display, mode_clock, num_joined_pipes));
 
+	if (num_joined_pipes == 4)
+		max_bpp = min(max_bpp, ultrajoiner_ram_max_bpp(display, mode_hdisplay));
+
 	return max_bpp;
 }