Re: [PATCH 1/3] drm/i915/psr: LunarLake IO and Fast Wake time line count maximums are 63

2024-05-19 Thread Hogander, Jouni
On Fri, 2024-05-17 at 08:14 +, Shankar, Uma wrote:
> 
> 
> > -Original Message-
> > From: Hogander, Jouni 
> > Sent: Friday, May 17, 2024 1:02 PM
> > To: Shankar, Uma ;
> > intel-gfx@lists.freedesktop.org
> > Subject: Re: [PATCH 1/3] drm/i915/psr: LunarLake IO and Fast Wake
> > time line
> > count maximums are 63
> > 
> > On Fri, 2024-05-17 at 06:28 +, Shankar, Uma wrote:
> > > 
> > > 
> > > > -Original Message-
> > > > From: Intel-gfx  On
> > > > Behalf
> > > > Of Jouni Högander
> > > > Sent: Friday, May 3, 2024 11:36 AM
> > > > To: intel-gfx@lists.freedesktop.org
> > > > Cc: Hogander, Jouni 
> > > > Subject: [PATCH 1/3] drm/i915/psr: LunarLake IO and Fast Wake
> > > > time
> > > > line count maximums are 63
> > > > 
> > > > On LunarLake maximum for IO and Fast Wake times are 63. Take
> > > > this
> > > > into account in calculation and when writing the IO Wake lines.
> > > > 
> > > > Bspec: 69885, 70294
> > > > 
> > > > Signed-off-by: Jouni Högander 
> > > > ---
> > > >  drivers/gpu/drm/i915/display/intel_psr.c | 5 +++--
> > > >  1 file changed, 3 insertions(+), 2 deletions(-)
> > > > 
> > > > diff --git a/drivers/gpu/drm/i915/display/intel_psr.c
> > > > b/drivers/gpu/drm/i915/display/intel_psr.c
> > > > index f5b5a9ae..678987bbe168 100644
> > > > --- a/drivers/gpu/drm/i915/display/intel_psr.c
> > > > +++ b/drivers/gpu/drm/i915/display/intel_psr.c
> > > > @@ -1364,8 +1364,9 @@ static bool _compute_alpm_params(struct
> > > > intel_dp *intel_dp,
> > > > fast_wake_time = precharge + preamble + phy_wake +
> > > > tfw_exit_latency;
> > > > 
> > > > -   if (DISPLAY_VER(i915) >= 12)
> > > > -   /* TODO: Check how we can use ALPM_CTL fast
> > > > wake
> > > > extended field */
> > > > +   if (DISPLAY_VER(i915) >= 20)
> > > > +   max_wake_lines = 63;
> > > 
> > > As per spec, hardware will add 5 extra lines to the programmed
> > > value.
> > > For prior platforms it was set to 12 as 7 (3bits) + 5. I guess we
> > > should make this consistent.
> > 
> > Thank you Uma for pointing this out. I have fixed this and the typo
> > you mentioned
> > on patch 3. Please recheck.
> 
> Hi Jouni, 
> Looks good, RB'ed now. You can go ahead for merge (seems some
> unrelated CI failures are there).
> 

Thank you Uma for your review. These are now pushed to drm-intel-next.

BR,

Jouni Högander

> Regards,
> Uma Shankar
> 
> > BR,
> > 
> > Jouni Högander
> > > 
> > > Regards,
> > > Uma Shankar
> > > 
> > > > +   else if (DISPLAY_VER(i915) >= 12)
> > > > max_wake_lines = 12;
> > > > else
> > > > max_wake_lines = 8;
> > > > --
> > > > 2.34.1
> > > 
> 



[PATCH 2/2] drm/i915/hdcp: Check mst_port to determine connector type

2024-05-19 Thread Suraj Kandpal
Check mst_port field in intel_connector to check connector type
rather than rely on encoder as it may not be attached to connector
at times.

--v2
-Add closes tag [Imre]

Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/10898
Signed-off-by: Suraj Kandpal 
---
 drivers/gpu/drm/i915/display/intel_dp_hdcp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c 
b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c
index 551c862ed7a6..2edffe62f360 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c
@@ -693,7 +693,7 @@ int intel_dp_hdcp_get_remote_capability(struct 
intel_connector *connector,
 
*hdcp_capable = false;
*hdcp2_capable = false;
-   if (!intel_encoder_is_mst(connector->encoder))
+   if (!connector->mst_port)
return -EINVAL;
 
aux = >port->aux;
-- 
2.43.2



RE: [PATCH 2/2] drm/i915/hdcp: Check mst_port to determine connector type

2024-05-19 Thread Kandpal, Suraj



> -Original Message-
> From: Deak, Imre 
> Sent: Friday, May 17, 2024 6:19 PM
> To: Kandpal, Suraj 
> Cc: intel-gfx@lists.freedesktop.org; Borah, Chaitanya Kumar
> ; Shankar, Uma
> ; Nautiyal, Ankit K 
> Subject: Re: [PATCH 2/2] drm/i915/hdcp: Check mst_port to determine
> connector type
> 
> On Tue, May 07, 2024 at 09:20:37AM +0530, Suraj Kandpal wrote:
> > Check mst_port field in intel_connector to check connector type rather
> > than rely on encoder as it may not be attached to connector at times.
> >
> > Signed-off-by: Suraj Kandpal 
> > ---
> >  drivers/gpu/drm/i915/display/intel_dp_hdcp.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c
> > b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c
> > index 551c862ed7a6..2edffe62f360 100644
> > --- a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c
> > +++ b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c
> > @@ -693,7 +693,7 @@ int intel_dp_hdcp_get_remote_capability(struct
> > intel_connector *connector,
> >
> > *hdcp_capable = false;
> > *hdcp2_capable = false;
> > -   if (!intel_encoder_is_mst(connector->encoder))
> > +   if (!connector->mst_port)
> 
> I suppose this fixes
> https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/10898
> 
> Could you add the Closes: line for it?
> 

Sure Imre will add that.

> Can this function be called for anything else than an MST connector?
> 
> Afaics it's only called from
> 
> intel_connector_info() ->
>   intel_hdcp_info(..., remote_req = true)
> 
> only for MST connectors, which makes sense since only MST connectors would
> have remote caps. In that case it would be enough to simply remove the
> encoder check which leads to the NULL deref in case the output is disabled.
> 

Right this function is not invoked from anywhere but hdcp_info() since this was 
Created just to have a sense of the actual HDCP capability of remote monitor 
rather than
having to display the first monitor's HDCP capability and repeating it for the 
second monitor
specially when in daisy chain setup.

Regards,
Suraj Kandpal

> > return -EINVAL;
> >
> > aux = >port->aux;
> > --
> > 2.43.2
> >


Re: [linux-next:master] [mm/slab] 7bd230a266: WARNING:at_mm/util.c:#kvmalloc_node_noprof

2024-05-19 Thread Kees Cook
On Sun, May 19, 2024 at 07:06:45PM -0400, Kent Overstreet wrote:
> this looks like an i915 bug

Yeah, agreed.

> On Wed, May 15, 2024 at 10:41:19AM +0800, kernel test robot wrote:
[...]
> > [test failed on linux-next/master 6ba6c795dc73c22ce2c86006f17c4aa802db2a60]
[...]
> > 
> > If you fix the issue in a separate patch/commit (i.e. not just a new 
> > version of
> > the same patch/commit), kindly add following tags
> > | Reported-by: kernel test robot 
> > | Closes: 
> > https://lore.kernel.org/oe-lkp/202405151008.6ddd1aaf-oliver.s...@intel.com
> > 
> > 
> > [  940.101700][ T5353] [ cut here ]
> > [ 940.107107][ T5353] WARNING: CPU: 1 PID: 5353 at mm/util.c:649 
> > kvmalloc_node_noprof (mm/util.c:649 (discriminator 1)) 

This is:

/* Don't even allow crazy sizes */
if (unlikely(size > INT_MAX)) {
WARN_ON_ONCE(!(flags & __GFP_NOWARN));


> > [  940.307791][ T5353] Call Trace:
[...]
> > [ 940.351795][ T5353] eb_copy_relocations 
> > (drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:1685) i915

And this is:

const unsigned int nreloc = eb->exec[i].relocation_count;
...
size = nreloc * sizeof(*relocs);

relocs = kvmalloc_array(1, size, GFP_KERNEL);

So something isn't checking the "relocation_count" size that I assume is
coming in from the ioctl?

-Kees

-- 
Kees Cook


RE: [PATCH v8 4/7] Add refresh rate divider to struct representing AS SDP

2024-05-19 Thread Murthy, Arun R


> -Original Message-
> From: Intel-gfx  On Behalf Of Mitul
> Golani
> Sent: Thursday, May 9, 2024 1:29 PM
> To: intel-gfx@lists.freedesktop.org
> Cc: Shankar, Uma ; Nikula, Jani
> 
> Subject: [PATCH v8 4/7] Add refresh rate divider to struct representing AS SDP
> 
> Add target_rr_divider to structure representing AS SDP.
> It is valid only in FAVT mode, sink device ignores the bit in AVT mode.
> 
> Signed-off-by: Mitul Golani 
> ---
Reviewed-by: Arun R Murthy 

Thanks and Regards,
Arun R Murthy


>  include/drm/display/drm_dp_helper.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/include/drm/display/drm_dp_helper.h
> b/include/drm/display/drm_dp_helper.h
> index 8bed890eec2c..393dbf8cf6ab 100644
> --- a/include/drm/display/drm_dp_helper.h
> +++ b/include/drm/display/drm_dp_helper.h
> @@ -122,6 +122,7 @@ struct drm_dp_as_sdp {
>   int target_rr;
>   int duration_incr_ms;
>   int duration_decr_ms;
> + bool target_rr_divider;
>   enum operation_mode mode;
>  };
> 
> --
> 2.25.1