Re: [PATCH v3 3/3] drm/i915: Use device wedged event

2024-09-03 Thread Raag Jadav
On Mon, Sep 02, 2024 at 02:22:21PM +0530, Aravind Iddamsetty wrote:
> 
> On 02/09/24 13:18, Raag Jadav wrote:
> > Now that we have device wedged event supported by DRM core, make use
> > of it. With this in place, userspace will be notified of wedged device
> > on gt reset failure.
> >
> > Signed-off-by: Raag Jadav 
> > ---
> >  drivers/gpu/drm/i915/gt/intel_reset.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/i915/gt/intel_reset.c 
> > b/drivers/gpu/drm/i915/gt/intel_reset.c
> > index 735cd23a43c6..60d09ec536c4 100644
> > --- a/drivers/gpu/drm/i915/gt/intel_reset.c
> > +++ b/drivers/gpu/drm/i915/gt/intel_reset.c
> > @@ -1409,6 +1409,8 @@ static void intel_gt_reset_global(struct intel_gt *gt,
> >  
> > if (!test_bit(I915_WEDGED, >->reset.flags))
> > kobject_uevent_env(kobj, KOBJ_CHANGE, reset_done_event);
> > +   else
> > +   drm_dev_wedged(>->i915->drm);
> >  }
> rather than intel_gt_reset_global, __intel_get_set_wedged looks to be
> an appropriate place where actually the device is declared wedged and
> that would cover all call sites too.

Which is why it may be the appropriate place IMHO.
We'd want to make sure the device is _really_ unrecoverable when we
choose to send the event.

Raag


[PATCH] drm/i915: convert comma to semicolon

2024-09-03 Thread Chen Ni
Replace a comma between expression statements by a semicolon.

Signed-off-by: Chen Ni 
---
 drivers/gpu/drm/i915/display/intel_hdmi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c 
b/drivers/gpu/drm/i915/display/intel_hdmi.c
index 19498ee455fa..00e98a5ede09 100644
--- a/drivers/gpu/drm/i915/display/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
@@ -1313,8 +1313,8 @@ static int intel_hdmi_hdcp_write(struct 
intel_digital_port *dig_port,
memcpy(&write_buf[1], buffer, size);
 
msg.addr = DRM_HDCP_DDC_ADDR;
-   msg.flags = 0,
-   msg.len = size + 1,
+   msg.flags = 0;
+   msg.len = size + 1;
msg.buf = write_buf;
 
ret = i2c_transfer(ddc, &msg, 1);
-- 
2.25.1



Re: [PATCH 0/8] drm/i915 & drm/xe: shared PCI ID macros

2024-09-03 Thread Jani Nikula
On Mon, 02 Sep 2024, Lucas De Marchi  wrote:
> On Mon, Sep 02, 2024 at 08:13:59PM GMT, Jani Nikula wrote:
>>There's considerable overlap in i915 and xe PCI ID macros, and (as can
>>be seen in this series) they get updated out of sync. With i915 display
>>continuing to use PCI IDs for platforms that i915 core does not support,
>
> humn.. but display is not using a separate device. It's rather the same
> that we bind to the xe driver. Why does i915 need to know the PCI ID?

Because display does its own device identification for display, for
display needs, without depending on either xe or i915 passing along some
data that has to be managed between all three.

>>but xe does, the duplication will just increase. Just use a single file
>>for all of them.
>
> I'd expect PCI IDs to stop being added in one header and start to be
> added in another.

Display could include xe_pciids.h too, and start using the XE_*_IDS()
macros for LNL+, but still the intersection of PCI IDs from both i915
and xe should match.


BR,
Jani.


-- 
Jani Nikula, Intel


Re: [PATCH] drm/i915/psr: Implment WA to help reach PC10

2024-09-03 Thread Hogander, Jouni
On Mon, 2024-09-02 at 10:01 +, Kandpal, Suraj wrote:
> 
> 
> > -Original Message-
> > From: Hogander, Jouni 
> > Sent: Monday, September 2, 2024 3:07 PM
> > To: Kandpal, Suraj ; intel-
> > g...@lists.freedesktop.org
> > Cc: Shankar, Uma 
> > Subject: Re: [PATCH] drm/i915/psr: Implment WA to help reach PC10
> > 
> > On Mon, 2024-09-02 at 10:32 +0530, Suraj Kandpal wrote:
> > > To reach PC10 when PKG_C_LATENCY is configure we must do the
> > following
> > > things
> > > 1) Enter PSR1 only when delayed_vblank < 6 lines and DC5 can be
> > > entered
> > > 2) Allow PSR2 deep sleep when DC5 can be entered
> > > 3) DC5 can be entered when all transocoder have either PSR1, PSR2
> > > or
> > > eDP 1.5 PR ALPM enabled and VBI is disabled and flips and pushes
> > > are
> > > not happening.
> > > 
> > > --v2
> > > -Switch condition and do an early return [Jani] -Do some checks
> > > in
> > > compute_config [Jani] -Do not use register reads as a method of
> > > checking states for DPKGC or delayed vblank [Jani] -Use another
> > > way to
> > > see is vblank interrupts are disabled or not [Jani]
> > > 
> > > --v3
> > > -Use has_psr to check if psr can be enabled or not for dc5_entry
> > > cond
> > > [Uma] -Move the dc5 entry computation to psr_compute_config
> > > [Jouni]
> > > -No need to change sequence of enabled and activate, so dont make
> > > hsw_psr1_activate return anything [Jouni] -Use has_psr to stop
> > > psr1
> > > activation [Jouni] -Use lineage no. in WA -Add the display ver
> > > restrictions for WA
> > > 
> > > WA: 22019444797
> > > Signed-off-by: Suraj Kandpal 
> > > ---
> > >  .../drm/i915/display/intel_display_types.h    |  2 +
> > >  drivers/gpu/drm/i915/display/intel_psr.c  | 96
> > > ++-
> > >  2 files changed, 97 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h
> > > b/drivers/gpu/drm/i915/display/intel_display_types.h
> > > index 868ff8976ed9..5395c1ecde7f 100644
> > > --- a/drivers/gpu/drm/i915/display/intel_display_types.h
> > > +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
> > > @@ -1717,6 +1717,8 @@ struct intel_psr {
> > > bool sink_support;
> > > bool source_support;
> > > bool enabled;
> > > +   bool is_dpkgc_configured;
> > > +   bool is_dc5_entry_possible;
> > > bool paused;
> > > enum pipe pipe;
> > > enum transcoder transcoder;
> > > diff --git a/drivers/gpu/drm/i915/display/intel_psr.c
> > > b/drivers/gpu/drm/i915/display/intel_psr.c
> > > index 257526362b39..1faec76eac32 100644
> > > --- a/drivers/gpu/drm/i915/display/intel_psr.c
> > > +++ b/drivers/gpu/drm/i915/display/intel_psr.c
> > > @@ -870,6 +870,69 @@ static u8 psr_compute_idle_frames(struct
> > intel_dp
> > > *intel_dp)
> > > return idle_frames;
> > >  }
> > > 
> > > +static bool intel_psr_check_delayed_vblank_limit(struct
> > > intel_crtc_state *crtc_state)
> > 
> > You could add some context here in the name. This is somehow
> > telling it's
> > some generic delayed vblank limit while it is actually limit for
> > this
> > workaround.
> 
> Sure will fix in next revision
> How about something like check_wa_delayed_vblank()
> 
> > 
> > > +{
> > > +   struct drm_display_mode *adjusted_mode = &crtc_state-
> > > > hw.adjusted_mode;
> > > +
> > > +   return (adjusted_mode->crtc_vblank_start - adjusted_mode-
> > > > crtc_vdisplay) >= 6;
> > > +}
> > > +
> > > +/*
> > > + * PKG_C_LATENCY is configured only when DISPLAY_VER >= 20 and
> > > + * VRR is not enabled
> > > + */
> > > +static bool intel_psr_is_dpkgc_configured(struct
> > > drm_i915_private
> > > *i915)
> > > +{
> > > +   struct intel_crtc *intel_crtc;
> > > +
> > > +   if (DISPLAY_VER(i915) < 20)
> > > +   return false;
> > > +
> > > +   for_each_intel_crtc(&i915->drm, intel_crtc) {
> > > +   struct intel_crtc_state *crtc_state;
> > > +
> > > +   if (!intel_crtc->active)
> > > +   continue;
> > > +
> > > +   crtc_state = intel_crtc->config;
> > > +
> > > +   if (crtc_state->vrr.enable)
> > > +   return false;
> > > +   }
> > > +
> > > +   return true;
> > > +}
> > > +
> > > +/*
> > > + * DC5 entry is only possible if vblank interrupt is disabled
> > > + * and either psr1, psr2, edp 1.5 pr alpm is enabled on all
> > > + * enabled encoders.
> > > + */
> > > +static bool
> > > +intel_psr_is_dc5_entry_possible(struct drm_i915_private *i915,
> > > +   struct intel_crtc_state
> > > *crtc_state) {
> > > +   struct intel_crtc *intel_crtc;
> > > +
> > > +   if (!(crtc_state->has_psr || crtc_state->has_sel_update))
> > > +   return false;
> > 
> > Currently this is not returning for DP2.1 PR. This would better
> > match with
> > comment above:
> > 
> > if (!crtc_state->has_psr || !intel_dp_is_edp(intel_dp))
> >     return false;
> > 
> > Still "_all_ 

RE: [PATCH] drm/i915/psr: Implment WA to help reach PC10

2024-09-03 Thread Kandpal, Suraj


> -Original Message-
> From: Hogander, Jouni 
> Sent: Tuesday, September 3, 2024 1:12 PM
> To: Kandpal, Suraj ; intel-
> g...@lists.freedesktop.org
> Cc: Shankar, Uma 
> Subject: Re: [PATCH] drm/i915/psr: Implment WA to help reach PC10
> 
> On Mon, 2024-09-02 at 10:01 +, Kandpal, Suraj wrote:
> >
> >
> > > -Original Message-
> > > From: Hogander, Jouni 
> > > Sent: Monday, September 2, 2024 3:07 PM
> > > To: Kandpal, Suraj ; intel-
> > > g...@lists.freedesktop.org
> > > Cc: Shankar, Uma 
> > > Subject: Re: [PATCH] drm/i915/psr: Implment WA to help reach PC10
> > >
> > > On Mon, 2024-09-02 at 10:32 +0530, Suraj Kandpal wrote:
> > > > To reach PC10 when PKG_C_LATENCY is configure we must do the
> > > following
> > > > things
> > > > 1) Enter PSR1 only when delayed_vblank < 6 lines and DC5 can be
> > > > entered
> > > > 2) Allow PSR2 deep sleep when DC5 can be entered
> > > > 3) DC5 can be entered when all transocoder have either PSR1, PSR2
> > > > or eDP 1.5 PR ALPM enabled and VBI is disabled and flips and
> > > > pushes are not happening.
> > > >
> > > > --v2
> > > > -Switch condition and do an early return [Jani] -Do some checks in
> > > > compute_config [Jani] -Do not use register reads as a method of
> > > > checking states for DPKGC or delayed vblank [Jani] -Use another
> > > > way to see is vblank interrupts are disabled or not [Jani]
> > > >
> > > > --v3
> > > > -Use has_psr to check if psr can be enabled or not for dc5_entry
> > > > cond [Uma] -Move the dc5 entry computation to psr_compute_config
> > > > [Jouni] -No need to change sequence of enabled and activate, so
> > > > dont make hsw_psr1_activate return anything [Jouni] -Use has_psr
> > > > to stop
> > > > psr1
> > > > activation [Jouni] -Use lineage no. in WA -Add the display ver
> > > > restrictions for WA
> > > >
> > > > WA: 22019444797
> > > > Signed-off-by: Suraj Kandpal 
> > > > ---
> > > >  .../drm/i915/display/intel_display_types.h    |  2 +
> > > >  drivers/gpu/drm/i915/display/intel_psr.c  | 96
> > > > ++-
> > > >  2 files changed, 97 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h
> > > > b/drivers/gpu/drm/i915/display/intel_display_types.h
> > > > index 868ff8976ed9..5395c1ecde7f 100644
> > > > --- a/drivers/gpu/drm/i915/display/intel_display_types.h
> > > > +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
> > > > @@ -1717,6 +1717,8 @@ struct intel_psr {
> > > > bool sink_support;
> > > > bool source_support;
> > > > bool enabled;
> > > > +   bool is_dpkgc_configured;
> > > > +   bool is_dc5_entry_possible;
> > > > bool paused;
> > > > enum pipe pipe;
> > > > enum transcoder transcoder; diff --git
> > > > a/drivers/gpu/drm/i915/display/intel_psr.c
> > > > b/drivers/gpu/drm/i915/display/intel_psr.c
> > > > index 257526362b39..1faec76eac32 100644
> > > > --- a/drivers/gpu/drm/i915/display/intel_psr.c
> > > > +++ b/drivers/gpu/drm/i915/display/intel_psr.c
> > > > @@ -870,6 +870,69 @@ static u8 psr_compute_idle_frames(struct
> > > intel_dp
> > > > *intel_dp)
> > > > return idle_frames;
> > > >  }
> > > >
> > > > +static bool intel_psr_check_delayed_vblank_limit(struct
> > > > intel_crtc_state *crtc_state)
> > >
> > > You could add some context here in the name. This is somehow telling
> > > it's some generic delayed vblank limit while it is actually limit
> > > for this workaround.
> >
> > Sure will fix in next revision
> > How about something like check_wa_delayed_vblank()
> >
> > >
> > > > +{
> > > > +   struct drm_display_mode *adjusted_mode = &crtc_state-
> > > > > hw.adjusted_mode;
> > > > +
> > > > +   return (adjusted_mode->crtc_vblank_start - adjusted_mode-
> > > > > crtc_vdisplay) >= 6;
> > > > +}
> > > > +
> > > > +/*
> > > > + * PKG_C_LATENCY is configured only when DISPLAY_VER >= 20 and
> > > > + * VRR is not enabled
> > > > + */
> > > > +static bool intel_psr_is_dpkgc_configured(struct
> > > > drm_i915_private
> > > > *i915)
> > > > +{
> > > > +   struct intel_crtc *intel_crtc;
> > > > +
> > > > +   if (DISPLAY_VER(i915) < 20)
> > > > +   return false;
> > > > +
> > > > +   for_each_intel_crtc(&i915->drm, intel_crtc) {
> > > > +   struct intel_crtc_state *crtc_state;
> > > > +
> > > > +   if (!intel_crtc->active)
> > > > +   continue;
> > > > +
> > > > +   crtc_state = intel_crtc->config;
> > > > +
> > > > +   if (crtc_state->vrr.enable)
> > > > +   return false;
> > > > +   }
> > > > +
> > > > +   return true;
> > > > +}
> > > > +
> > > > +/*
> > > > + * DC5 entry is only possible if vblank interrupt is disabled
> > > > + * and either psr1, psr2, edp 1.5 pr alpm is enabled on all
> > > > + * enabled encoders.
> > > > + */
> > > > +static bool
> > > > +intel_psr_is_dc5_entry_possible(struct drm_i915_private *i915,
> > > > +  

Re: [PATCH v3 1/3] drm: Introduce device wedged event

2024-09-03 Thread Raag Jadav
On Mon, Sep 02, 2024 at 02:44:21PM +0530, Aravind Iddamsetty wrote:
> 
> On 02/09/24 13:18, Raag Jadav wrote:
> > Introduce device wedged event, which will notify userspace of wedged
> > (hanged/unusable) state of the DRM device through a uevent. This is
> > useful especially in cases where the device is in unrecoverable state
> > and requires userspace intervention for recovery.
> >
> > Purpose of this implementation is to be vendor agnostic. Userspace
> > consumers (sysadmin) can define udev rules to parse this event and
> > take respective action to recover the device.
> >
> > Consumer expectations:
> > --
> > 1) Unbind driver
> > 2) Reset bus device
> > 3) Re-bind driver
> >
> > Signed-off-by: Raag Jadav 
> > ---
> >  drivers/gpu/drm/drm_drv.c | 21 +
> >  include/drm/drm_drv.h |  1 +
> >  2 files changed, 22 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
> > index 93543071a500..dc55cc237d89 100644
> > --- a/drivers/gpu/drm/drm_drv.c
> > +++ b/drivers/gpu/drm/drm_drv.c
> > @@ -499,6 +499,27 @@ void drm_dev_unplug(struct drm_device *dev)
> >  }
> >  EXPORT_SYMBOL(drm_dev_unplug);
> >  
> > +/**
> > + * drm_dev_wedged - declare DRM device as wedged
> > + * @dev: DRM device
> > + *
> > + * This declares a DRM device specified by @dev as wedged (hanged/unusable)
> this doesn't seem to set any drm state as wedged, it is just sending an
> uevent. you might need to correct the above statement.

On a second thought, perhaps this warrants any action on drm_device?

Raag


Re: [PATCH 04/13] drm/i915/display: Enable MSA Ignore Timing PAR only when in not fixed_rr mode

2024-09-03 Thread kernel test robot
Hi Ankit,

kernel test robot noticed the following build errors:

[auto build test ERROR on drm-intel/for-linux-next]
[also build test ERROR on drm-tip/drm-tip next-20240902]
[cannot apply to drm-intel/for-linux-next-fixes linus/master v6.11-rc6]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:
https://github.com/intel-lab-lkp/linux/commits/Ankit-Nautiyal/drm-i915-dp-Avoid-vrr-compute-config-for-HDMI-sink/20240902-205135
base:   git://anongit.freedesktop.org/drm-intel for-linux-next
patch link:
https://lore.kernel.org/r/20240902080635.2946858-5-ankit.k.nautiyal%40intel.com
patch subject: [PATCH 04/13] drm/i915/display: Enable MSA Ignore Timing PAR 
only when in not fixed_rr mode
config: x86_64-randconfig-071-20240903 
(https://download.01.org/0day-ci/archive/20240903/202409031530.5oehhqkb-...@intel.com/config)
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 
617a15a9eac96088ae5e9134248d8236e34b91b1)
reproduce (this is a W=1 build): 
(https://download.01.org/0day-ci/archive/20240903/202409031530.5oehhqkb-...@intel.com/reproduce)

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-kbuild-all/202409031530.5oehhqkb-...@intel.com/

All errors (new ones prefixed by >>):

>> drivers/gpu/drm/i915/display/intel_dp_link_training.c:724:6: error: variable 
>> 'enable_msa_timing_par_ignore' is used uninitialized whenever 'if' condition 
>> is false [-Werror,-Wsometimes-uninitialized]
 724 | if (crtc_state->vrr.enable && !crtc_state->vrr.fixed_rr)
 | ^~~
   drivers/gpu/drm/i915/display/intel_dp_link_training.c:728:30: note: 
uninitialized use occurs here
 728 | crtc_state->port_clock, 
enable_msa_timing_par_ignore);
 | 
^~~~
   drivers/gpu/drm/i915/display/intel_dp_link_training.c:724:2: note: remove 
the 'if' if its condition is always true
 724 | if (crtc_state->vrr.enable && !crtc_state->vrr.fixed_rr)
 | ^~~~
 725 | enable_msa_timing_par_ignore = true;
>> drivers/gpu/drm/i915/display/intel_dp_link_training.c:724:6: error: variable 
>> 'enable_msa_timing_par_ignore' is used uninitialized whenever '&&' condition 
>> is false [-Werror,-Wsometimes-uninitialized]
 724 | if (crtc_state->vrr.enable && !crtc_state->vrr.fixed_rr)
 | ^~
   drivers/gpu/drm/i915/display/intel_dp_link_training.c:728:30: note: 
uninitialized use occurs here
 728 | crtc_state->port_clock, 
enable_msa_timing_par_ignore);
 | 
^~~~
   drivers/gpu/drm/i915/display/intel_dp_link_training.c:724:6: note: remove 
the '&&' if its condition is always true
 724 | if (crtc_state->vrr.enable && !crtc_state->vrr.fixed_rr)
 | ^
   drivers/gpu/drm/i915/display/intel_dp_link_training.c:721:35: note: 
initialize the variable 'enable_msa_timing_par_ignore' to silence this warning
 721 | bool enable_msa_timing_par_ignore;
 |  ^
 |   = 0
   2 errors generated.


vim +724 drivers/gpu/drm/i915/display/intel_dp_link_training.c

   717  
   718  static void intel_dp_update_downspread_ctrl(struct intel_dp *intel_dp,
   719  const struct 
intel_crtc_state *crtc_state)
   720  {
   721  bool enable_msa_timing_par_ignore;
   722  
   723  /* Enable MSA TIMING PAR IGNORE only in non fixed_rr mode */
 > 724  if (crtc_state->vrr.enable && !crtc_state->vrr.fixed_rr)
   725  enable_msa_timing_par_ignore = true;
   726  
   727  intel_dp_link_training_set_mode(intel_dp,
   728  crtc_state->port_clock, 
enable_msa_timing_par_ignore);
   729  }
   730  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


✓ Fi.CI.BAT: success for drm/i915/display: BMG supports UHBR13.5 (rev4)

2024-09-03 Thread Patchwork
== Series Details ==

Series: drm/i915/display: BMG supports UHBR13.5 (rev4)
URL   : https://patchwork.freedesktop.org/series/137828/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_15347 -> Patchwork_137828v4


Summary
---

  **SUCCESS**

  No regressions found.

  External URL: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137828v4/index.html

Participating hosts (40 -> 38)
--

  Additional (2): bat-kbl-2 bat-arls-2 
  Missing(4): fi-glk-j4005 bat-dg2-11 fi-snb-2520m fi-elk-e7500 

Possible new issues
---

  Here are the unknown changes that may have been introduced in 
Patchwork_137828v4:

### IGT changes ###

 Suppressed 

  The following results come from untrusted machines, tests, or statuses.
  They do not affect the overall result.

  * igt@gem_close_race@basic-threads:
- {bat-arlh-3}:   NOTRUN -> [INCOMPLETE][1]
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137828v4/bat-arlh-3/igt@gem_close_r...@basic-threads.html

  
Known issues


  Here are the changes found in Patchwork_137828v4 that come from known issues:

### CI changes ###

 Possible fixes 

  * boot:
- {bat-arlh-3}:   [FAIL][2] ([i915#12081]) -> [PASS][3]
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15347/bat-arlh-3/boot.html
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137828v4/bat-arlh-3/boot.html

  

### IGT changes ###

 Issues hit 

  * igt@debugfs_test@basic-hwmon:
- bat-arls-2: NOTRUN -> [SKIP][4] ([i915#9318])
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137828v4/bat-arls-2/igt@debugfs_t...@basic-hwmon.html

  * igt@fbdev@info:
- bat-kbl-2:  NOTRUN -> [SKIP][5] ([i915#1849])
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137828v4/bat-kbl-2/igt@fb...@info.html

  * igt@fbdev@read:
- bat-arls-1: [PASS][6] -> [DMESG-WARN][7] ([i915#12102])
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15347/bat-arls-1/igt@fb...@read.html
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137828v4/bat-arls-1/igt@fb...@read.html

  * igt@gem_lmem_swapping@parallel-random-engines:
- bat-kbl-2:  NOTRUN -> [SKIP][8] +39 other tests skip
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137828v4/bat-kbl-2/igt@gem_lmem_swapp...@parallel-random-engines.html

  * igt@gem_lmem_swapping@verify-random:
- bat-arls-2: NOTRUN -> [SKIP][9] ([i915#10213]) +3 other tests skip
   [9]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137828v4/bat-arls-2/igt@gem_lmem_swapp...@verify-random.html

  * igt@gem_mmap@basic:
- bat-arls-2: NOTRUN -> [SKIP][10] ([i915#11343] / [i915#4083])
   [10]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137828v4/bat-arls-2/igt@gem_m...@basic.html

  * igt@gem_mmap_gtt@basic:
- bat-arls-2: NOTRUN -> [SKIP][11] ([i915#10196] / [i915#4077]) +2 
other tests skip
   [11]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137828v4/bat-arls-2/igt@gem_mmap_...@basic.html

  * igt@gem_render_tiled_blits@basic:
- bat-arls-2: NOTRUN -> [SKIP][12] ([i915#10197] / [i915#10211] / 
[i915#4079])
   [12]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137828v4/bat-arls-2/igt@gem_render_tiled_bl...@basic.html

  * igt@gem_tiled_pread_basic:
- bat-arls-2: NOTRUN -> [SKIP][13] ([i915#10206] / [i915#4079])
   [13]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137828v4/bat-arls-2/igt@gem_tiled_pread_basic.html

  * igt@i915_pm_rps@basic-api:
- bat-arls-2: NOTRUN -> [SKIP][14] ([i915#10209] / [i915#11681])
   [14]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137828v4/bat-arls-2/igt@i915_pm_...@basic-api.html

  * igt@i915_selftest@live@workarounds:
- bat-mtlp-6: [PASS][15] -> [ABORT][16] ([i915#12062])
   [15]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15347/bat-mtlp-6/igt@i915_selftest@l...@workarounds.html
   [16]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137828v4/bat-mtlp-6/igt@i915_selftest@l...@workarounds.html

  * igt@kms_addfb_basic@addfb25-y-tiled-small-legacy:
- bat-arls-2: NOTRUN -> [SKIP][17] ([i915#10200]) +9 other tests 
skip
   [17]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137828v4/bat-arls-2/igt@kms_addfb_ba...@addfb25-y-tiled-small-legacy.html

  * igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy:
- bat-arls-2: NOTRUN -> [SKIP][18] ([i915#10202] / [i915#11346]) +1 
other test skip
   [18]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137828v4/bat-arls-2/igt@kms_cursor_leg...@basic-busy-flip-before-cursor-legacy.html

  * igt@kms_dsc@dsc-basic:
- bat-arls-2: NOTRUN -> [SKIP][19] ([i915#11346] / [i915#9886])
   [19]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137828v4/bat-arls-2/igt@kms_...@dsc-basic.html

  * igt@kms_forc

[PATCH] drm/i915/psr: Implment WA to help reach PC10

2024-09-03 Thread Suraj Kandpal
To reach PC10 when PKG_C_LATENCY is configure we must do the following
things
1) Enter PSR1 only when delayed_vblank < 6 lines and DC5 can be entered
2) Allow PSR2 deep sleep when DC5 can be entered
3) DC5 can be entered when all transocoder have either PSR1, PSR2 or
eDP 1.5 PR ALPM enabled and VBI is disabled and flips and pushes are
not happening.

--v2
-Switch condition and do an early return [Jani]
-Do some checks in compute_config [Jani]
-Do not use register reads as a method of checking states for
DPKGC or delayed vblank [Jani]
-Use another way to see is vblank interrupts are disabled or not [Jani]

--v3
-Use has_psr to check if psr can be enabled or not for dc5_entry cond
[Uma]
-Move the dc5 entry computation to psr_compute_config [Jouni]
-No need to change sequence of enabled and activate,
so dont make hsw_psr1_activate return anything [Jouni]
-Use has_psr to stop psr1 activation [Jouni]
-Use lineage no. in WA
-Add the display ver restrictions for WA

--v4
-use more appropriate name for check_vblank_limit() [Jouni]
-Cover the case for idle frames when dpkgc is not configured [Jouni]
-Check psr only for edp [Jouni]

WA: 22019444797
Signed-off-by: Suraj Kandpal 
---
 .../drm/i915/display/intel_display_types.h|   2 +
 drivers/gpu/drm/i915/display/intel_psr.c  | 101 +-
 2 files changed, 102 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h 
b/drivers/gpu/drm/i915/display/intel_display_types.h
index fa03157554b2..6b95a59aba2e 100644
--- a/drivers/gpu/drm/i915/display/intel_display_types.h
+++ b/drivers/gpu/drm/i915/display/intel_display_types.h
@@ -1717,6 +1717,8 @@ struct intel_psr {
bool sink_support;
bool source_support;
bool enabled;
+   bool is_dpkgc_configured;
+   bool is_dc5_entry_possible;
bool paused;
enum pipe pipe;
enum transcoder transcoder;
diff --git a/drivers/gpu/drm/i915/display/intel_psr.c 
b/drivers/gpu/drm/i915/display/intel_psr.c
index 257526362b39..6eb137ecd49f 100644
--- a/drivers/gpu/drm/i915/display/intel_psr.c
+++ b/drivers/gpu/drm/i915/display/intel_psr.c
@@ -870,6 +870,74 @@ static u8 psr_compute_idle_frames(struct intel_dp 
*intel_dp)
return idle_frames;
 }
 
+static bool intel_psr_check_wa_delayed_vblank(struct intel_crtc_state 
*crtc_state)
+{
+   struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode;
+
+   return (adjusted_mode->crtc_vblank_start - 
adjusted_mode->crtc_vdisplay) >= 6;
+}
+
+/*
+ * PKG_C_LATENCY is configured only when DISPLAY_VER >= 20 and
+ * VRR is not enabled
+ */
+static bool intel_psr_is_dpkgc_configured(struct drm_i915_private *i915)
+{
+   struct intel_crtc *intel_crtc;
+
+   if (DISPLAY_VER(i915) < 20)
+   return false;
+
+   for_each_intel_crtc(&i915->drm, intel_crtc) {
+   struct intel_crtc_state *crtc_state;
+
+   if (!intel_crtc->active)
+   continue;
+
+   crtc_state = intel_crtc->config;
+
+   if (crtc_state->vrr.enable)
+   return false;
+   }
+
+   return true;
+}
+
+/*
+ * DC5 entry is only possible if vblank interrupt is disabled
+ * and either psr1, psr2, edp 1.5 pr alpm is enabled on all
+ * enabled encoders.
+ */
+static bool
+intel_psr_is_dc5_entry_possible(struct drm_i915_private *i915,
+   struct intel_crtc_state *crtc_state)
+{
+   struct intel_crtc *intel_crtc;
+
+   if (!crtc_state->has_psr)
+   return false;
+
+   for_each_intel_crtc(&i915->drm, intel_crtc) {
+   struct drm_crtc *crtc = &intel_crtc->base;
+   struct drm_vblank_crtc *vblank;
+   struct intel_encoder *encoder;
+
+   if (!intel_crtc->active)
+   continue;
+
+   vblank = drm_crtc_vblank_crtc(crtc);
+
+   if (vblank->enabled)
+   return false;
+
+   for_each_encoder_on_crtc(&i915->drm, crtc, encoder)
+   if (encoder->type != INTEL_OUTPUT_EDP)
+   return false;
+   }
+
+   return true;
+}
+
 static void hsw_activate_psr1(struct intel_dp *intel_dp)
 {
struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);
@@ -980,7 +1048,11 @@ static void hsw_activate_psr2(struct intel_dp *intel_dp)
u32 val = EDP_PSR2_ENABLE;
u32 psr_val = 0;
 
-   val |= EDP_PSR2_IDLE_FRAMES(psr_compute_idle_frames(intel_dp));
+   /* Wa_22019444797 */
+   if (DISPLAY_VER(dev_priv) != 20 ||
+   !intel_dp->psr.is_dpkgc_configured ||
+   intel_dp->psr.is_dc5_entry_possible)
+   val |= EDP_PSR2_IDLE_FRAMES(psr_compute_idle_frames(intel_dp));
 
if (DISPLAY_VER(dev_priv) < 14 && !IS_ALDERLAKE_P(dev_priv))
val |= EDP_SU_TRACK_ENABLE;
@@ -1595,6 +1667,32 @@ _panel_replay_compute_config(struct intel_dp *intel_dp,
   

✓ Fi.CI.BAT: success for drm/i915: convert comma to semicolon

2024-09-03 Thread Patchwork
== Series Details ==

Series: drm/i915: convert comma to semicolon
URL   : https://patchwork.freedesktop.org/series/138128/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_15349 -> Patchwork_138128v1


Summary
---

  **SUCCESS**

  No regressions found.

  External URL: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138128v1/index.html

Participating hosts (41 -> 36)
--

  Missing(5): bat-kbl-2 fi-bsw-n3050 fi-snb-2520m fi-glk-j4005 fi-kbl-8809g 

Known issues


  Here are the changes found in Patchwork_138128v1 that come from known issues:

### IGT changes ###

 Issues hit 

  * igt@fbdev@eof:
- bat-arls-1: [PASS][1] -> [DMESG-WARN][2] ([i915#12102])
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15349/bat-arls-1/igt@fb...@eof.html
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138128v1/bat-arls-1/igt@fb...@eof.html

  * igt@i915_selftest@live@workarounds:
- bat-mtlp-8: [PASS][3] -> [ABORT][4] ([i915#12062])
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15349/bat-mtlp-8/igt@i915_selftest@l...@workarounds.html
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138128v1/bat-mtlp-8/igt@i915_selftest@l...@workarounds.html

  
 Possible fixes 

  * igt@fbdev@info:
- bat-arls-1: [DMESG-WARN][5] ([i915#12102]) -> [PASS][6]
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15349/bat-arls-1/igt@fb...@info.html
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138128v1/bat-arls-1/igt@fb...@info.html

  
 Warnings 

  * igt@i915_module_load@reload:
- bat-apl-1:  [DMESG-WARN][7] ([i915#180]) -> [DMESG-WARN][8] 
([i915#180] / [i915#1982]) +1 other test dmesg-warn
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15349/bat-apl-1/igt@i915_module_l...@reload.html
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138128v1/bat-apl-1/igt@i915_module_l...@reload.html

  
  [i915#12062]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/12062
  [i915#12102]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/12102
  [i915#180]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/180
  [i915#1982]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/1982


Build changes
-

  * Linux: CI_DRM_15349 -> Patchwork_138128v1

  CI-20190529: 20190529
  CI_DRM_15349: dd987a9431a336ddbfc6bfe9720f4783a6bc94b0 @ 
git://anongit.freedesktop.org/gfx-ci/linux
  IGT_8001: d3a77fc98e89cc94b03be2b0903d44f83480b8a0 @ 
https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
  Patchwork_138128v1: dd987a9431a336ddbfc6bfe9720f4783a6bc94b0 @ 
git://anongit.freedesktop.org/gfx-ci/linux

== Logs ==

For more details see: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138128v1/index.html


Re: [PATCH v3 02/81] drm/fbdev-helper: Set and clear VGA switcheroo client from fb_info

2024-09-03 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

Hello Thomas,

> Call vga_switcheroo_client_fb_set() with the PCI device from the
> instance of struct fb_info. All fbdev clients now run these calls.
> For non-PCI devices or drivers without vga-switcheroo, this does
> nothing. For i915 and radeon, it allows these drivers to use a
> common fbdev client.
>
> The device is the same as the one stored in struct drm_client and
> struct drm_fb_helper, so there is no difference in behavior. Some
> NULL-pointer checks are being removed, where those pointers cannot
> be NULL.
>
> Signed-off-by: Thomas Zimmermann 
> ---
>  drivers/gpu/drm/drm_fb_helper.c | 15 +++
>  1 file changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index af1fe79c701d..13095d38aa42 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -562,8 +562,12 @@ EXPORT_SYMBOL(drm_fb_helper_release_info);
>   */
>  void drm_fb_helper_unregister_info(struct drm_fb_helper *fb_helper)
>  {
> - if (fb_helper && fb_helper->info)
> - unregister_framebuffer(fb_helper->info);

I'm not sure if we can assume these won't be NULL... AFAICT some drivers
still have their own struct drm_client_funcs vtable and could potentially
pass a NULL struct drm_fb_helper ?

If you think that's safe to do this and the function semantics should be
changed, then I think that the kernel-doc needs to be updated:

- * @fb_helper: driver-allocated fbdev helper, can be NULL
+ * @fb_helper: driver-allocated fbdev helper, must not be NULL

Other than that, the patch looks good to me:

Reviewed-by: Javier Martinez Canillas 

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



✓ Fi.CI.BAT: success for drm/i915/psr: Implment WA to help reach PC10 (rev2)

2024-09-03 Thread Patchwork
== Series Details ==

Series: drm/i915/psr: Implment WA to help reach PC10 (rev2)
URL   : https://patchwork.freedesktop.org/series/138065/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_15349 -> Patchwork_138065v2


Summary
---

  **SUCCESS**

  No regressions found.

  External URL: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138065v2/index.html

Participating hosts (41 -> 35)
--

  Additional (1): bat-mtlp-6 
  Missing(7): bat-kbl-2 fi-bsw-n3050 fi-snb-2520m fi-glk-j4005 fi-kbl-8809g 
bat-dg2-11 bat-jsl-1 

Known issues


  Here are the changes found in Patchwork_138065v2 that come from known issues:

### IGT changes ###

 Issues hit 

  * igt@debugfs_test@basic-hwmon:
- bat-mtlp-6: NOTRUN -> [SKIP][1] ([i915#9318])
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138065v2/bat-mtlp-6/igt@debugfs_t...@basic-hwmon.html

  * igt@fbdev@info:
- bat-mtlp-6: NOTRUN -> [SKIP][2] ([i915#1849] / [i915#2582])
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138065v2/bat-mtlp-6/igt@fb...@info.html

  * igt@fbdev@read:
- bat-arls-1: [PASS][3] -> [DMESG-WARN][4] ([i915#12102])
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15349/bat-arls-1/igt@fb...@read.html
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138065v2/bat-arls-1/igt@fb...@read.html

  * igt@fbdev@write:
- bat-mtlp-6: NOTRUN -> [SKIP][5] ([i915#2582]) +3 other tests skip
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138065v2/bat-mtlp-6/igt@fb...@write.html

  * igt@gem_lmem_swapping@verify-random:
- bat-mtlp-6: NOTRUN -> [SKIP][6] ([i915#4613]) +3 other tests skip
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138065v2/bat-mtlp-6/igt@gem_lmem_swapp...@verify-random.html

  * igt@gem_mmap@basic:
- bat-mtlp-6: NOTRUN -> [SKIP][7] ([i915#4083])
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138065v2/bat-mtlp-6/igt@gem_m...@basic.html

  * igt@gem_tiled_blits@basic:
- bat-mtlp-6: NOTRUN -> [SKIP][8] ([i915#4077]) +2 other tests skip
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138065v2/bat-mtlp-6/igt@gem_tiled_bl...@basic.html

  * igt@gem_tiled_pread_basic:
- bat-mtlp-6: NOTRUN -> [SKIP][9] ([i915#4079]) +1 other test skip
   [9]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138065v2/bat-mtlp-6/igt@gem_tiled_pread_basic.html

  * igt@i915_pm_rps@basic-api:
- bat-mtlp-6: NOTRUN -> [SKIP][10] ([i915#11681] / [i915#6621])
   [10]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138065v2/bat-mtlp-6/igt@i915_pm_...@basic-api.html

  * igt@i915_selftest@live@hangcheck:
- bat-arls-1: [PASS][11] -> [DMESG-WARN][12] ([i915#11349])
   [11]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15349/bat-arls-1/igt@i915_selftest@l...@hangcheck.html
   [12]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138065v2/bat-arls-1/igt@i915_selftest@l...@hangcheck.html

  * igt@i915_selftest@live@workarounds:
- bat-mtlp-8: [PASS][13] -> [ABORT][14] ([i915#12062])
   [13]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15349/bat-mtlp-8/igt@i915_selftest@l...@workarounds.html
   [14]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138065v2/bat-mtlp-8/igt@i915_selftest@l...@workarounds.html

  * igt@kms_addfb_basic@addfb25-x-tiled-legacy:
- bat-mtlp-6: NOTRUN -> [SKIP][15] ([i915#4212] / [i915#9792]) +8 
other tests skip
   [15]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138065v2/bat-mtlp-6/igt@kms_addfb_ba...@addfb25-x-tiled-legacy.html

  * igt@kms_addfb_basic@addfb25-y-tiled-small-legacy:
- bat-mtlp-6: NOTRUN -> [SKIP][16] ([i915#5190] / [i915#9792])
   [16]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138065v2/bat-mtlp-6/igt@kms_addfb_ba...@addfb25-y-tiled-small-legacy.html

  * igt@kms_cursor_legacy@basic-flip-after-cursor-legacy:
- bat-mtlp-6: NOTRUN -> [SKIP][17] ([i915#9792]) +17 other tests 
skip
   [17]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138065v2/bat-mtlp-6/igt@kms_cursor_leg...@basic-flip-after-cursor-legacy.html

  * igt@kms_flip@basic-flip-vs-dpms:
- bat-mtlp-6: NOTRUN -> [SKIP][18] ([i915#3637] / [i915#9792]) +3 
other tests skip
   [18]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138065v2/bat-mtlp-6/igt@kms_f...@basic-flip-vs-dpms.html

  * igt@kms_force_connector_basic@prune-stale-modes:
- bat-mtlp-6: NOTRUN -> [SKIP][19] ([i915#5274] / [i915#9792])
   [19]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138065v2/bat-mtlp-6/igt@kms_force_connector_ba...@prune-stale-modes.html

  * igt@kms_frontbuffer_tracking@basic:
- bat-mtlp-6: NOTRUN -> [SKIP][20] ([i915#4342] / [i915#5354] / 
[i915#9792])
   [20]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138065v2/bat-mtlp

RE: [PATCH] drm/i915/dmc: Hardcode path to MTL DMC v2.23

2024-09-03 Thread Bhadane, Dnyaneshwar



> -Original Message-
> From: Bhadane, Dnyaneshwar 
> Sent: Tuesday, August 27, 2024 7:34 PM
> To: intel-gfx@lists.freedesktop.org
> Cc: Bhadane, Dnyaneshwar 
> Subject: [PATCH] drm/i915/dmc: Hardcode path to MTL DMC v2.23
> 
> NOT TO BE REVIEWED/MERGED
> Hardcode path to DMC firmware for CI purposes only.
> 
> Signed-off-by: Dnyaneshwar Bhadane 

The regression issue kms_psr2_sf test failure observed in mtl dmc v2.22 is now 
passed with mtl dmc v2.23.
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137842v1/shards-all.html?testfilter=kms_psr2_sf

DMC FW loaded successfully : 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137842v1/index.html?testfilter=module_load

> ---
>  drivers/gpu/drm/i915/display/intel_dmc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_dmc.c
> b/drivers/gpu/drm/i915/display/intel_dmc.c
> index 7c756d5ba2a2..723743cbe8e2 100644
> --- a/drivers/gpu/drm/i915/display/intel_dmc.c
> +++ b/drivers/gpu/drm/i915/display/intel_dmc.c
> @@ -119,7 +119,7 @@ MODULE_FIRMWARE(XE2LPD_DMC_PATH);
>  #define BMG_DMC_PATH DMC_PATH(bmg)
>  MODULE_FIRMWARE(BMG_DMC_PATH);
> 
> -#define MTL_DMC_PATH DMC_PATH(mtl)
> +#define MTL_DMC_PATH "i915/mtl_dmc_ver2_23.bin"
>  MODULE_FIRMWARE(MTL_DMC_PATH);
> 
>  #define DG2_DMC_PATH DMC_LEGACY_PATH(dg2, 2, 08)
> --
> 2.34.1



Re: [PATCH v3 03/81] drm/fbdev: Add memory-agnostic fbdev client

2024-09-03 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> Add an fbdev client that can work with any memory manager. The
> client implementation is the same as existing code in fbdev-dma or
> fbdev-shmem.
>
> Provide struct drm_driver.fbdev_probe for the new client to allocate
> the surface GEM buffer. The new callback replaces fb_probe of struct
> drm_fb_helper_funcs, which does the same.
>
> To use the new client, DRM drivers set fbdev_probe in their struct
> drm_driver instance and call drm_fbdev_client_setup(). Probing and
> creating the fbdev surface buffer is now independent from the other
> operations in struct drm_fb_helper. For the pixel format, the fbdev
> client either uses a specified format, the value in preferred_depth
> or 32-bit RGB.
>
> v2:
> - test for struct drm_fb_helper.funcs for NULL (Sui)
> - respect struct drm_mode_config.preferred_depth for default format
>
> Signed-off-by: Thomas Zimmermann 
> ---

Reviewed-by: Javier Martinez Canillas 

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH v3 02/81] drm/fbdev-helper: Set and clear VGA switcheroo client from fb_info

2024-09-03 Thread Thomas Zimmermann

Hi Javier

Am 03.09.24 um 12:18 schrieb Javier Martinez Canillas:

Thomas Zimmermann  writes:

Hello Thomas,


Call vga_switcheroo_client_fb_set() with the PCI device from the
instance of struct fb_info. All fbdev clients now run these calls.
For non-PCI devices or drivers without vga-switcheroo, this does
nothing. For i915 and radeon, it allows these drivers to use a
common fbdev client.

The device is the same as the one stored in struct drm_client and
struct drm_fb_helper, so there is no difference in behavior. Some
NULL-pointer checks are being removed, where those pointers cannot
be NULL.

Signed-off-by: Thomas Zimmermann 
---
  drivers/gpu/drm/drm_fb_helper.c | 15 +++
  1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index af1fe79c701d..13095d38aa42 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -562,8 +562,12 @@ EXPORT_SYMBOL(drm_fb_helper_release_info);
   */
  void drm_fb_helper_unregister_info(struct drm_fb_helper *fb_helper)
  {
-   if (fb_helper && fb_helper->info)
-   unregister_framebuffer(fb_helper->info);

I'm not sure if we can assume these won't be NULL... AFAICT some drivers
still have their own struct drm_client_funcs vtable and could potentially
pass a NULL struct drm_fb_helper ?


I did a

  git grep -B4 drm_fb_helper_unregister_info

on drm-tip and all callers, such as [1], test fb_helper->info before 
calling the function. So it's safe to remove the test.


[1] 
https://elixir.bootlin.com/linux/v6.10/source/drivers/gpu/drm/drm_fbdev_dma.c#L162




If you think that's safe to do this and the function semantics should be
changed, then I think that the kernel-doc needs to be updated:

- * @fb_helper: driver-allocated fbdev helper, can be NULL
+ * @fb_helper: driver-allocated fbdev helper, must not be NULL


Ok.



Other than that, the patch looks good to me:

Reviewed-by: Javier Martinez Canillas 


Thanks.

Best regards
Thomas





--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)



Re: [PATCH v3 05/81] drm/fbdev-dma: Support struct drm_driver.fbdev_probe

2024-09-03 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> Rework fbdev probing to support fbdev_probe in struct drm_driver
> and reimplement the old fb_probe callback on top of it. Provide an
> initializer macro for struct drm_driver that sets the callback
> according to the kernel configuration.
>
> This change allows the common fbdev client to run on top of DMA-
> based DRM drivers.
>
> Signed-off-by: Thomas Zimmermann 
> ---
>  drivers/gpu/drm/drm_fbdev_dma.c | 60 -
>  include/drm/drm_fbdev_dma.h | 12 +++
>  2 files changed, 48 insertions(+), 24 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_fbdev_dma.c b/drivers/gpu/drm/drm_fbdev_dma.c
> index 7ef5a48c8029..aeccf7f7a522 100644
> --- a/drivers/gpu/drm/drm_fbdev_dma.c
> +++ b/drivers/gpu/drm/drm_fbdev_dma.c
> @@ -86,6 +86,40 @@ static const struct fb_ops drm_fbdev_dma_fb_ops = {
>  
>  static int drm_fbdev_dma_helper_fb_probe(struct drm_fb_helper *fb_helper,
>struct drm_fb_helper_surface_size 
> *sizes)
> +{

static inline for this wrapper maybe ?

> + return drm_fbdev_dma_driver_fbdev_probe(fb_helper, sizes);
> +}
> +

Reviewed-by: Javier Martinez Canillas 

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH v3 06/81] drm/arcgpu: Run DRM default client setup

2024-09-03 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> Call drm_client_setup_with_fourcc() to run the kernel's default client
> setup for DRM. Set fbdev_probe in struct drm_driver, so that the client
> setup can start the common fbdev client.
>
> v2:
> - use drm_client_setup_with_fourcc()
>
> Signed-off-by: Thomas Zimmermann 

Acked-by: Javier Martinez Canillas 

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH v3 10/81] drm/aspeed: Run DRM default client setup

2024-09-03 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> Call drm_client_setup() to run the kernel's default client setup
> for DRM. Set fbdev_probe in struct drm_driver, so that the client
> setup can start the common fbdev client.
>
> The aspeed driver specifies a preferred color mode of 32. As this
> is the default if no format has been given, leave it out entirely.
>
> v3:
> - add DRM_FBDEV_DMA_DRIVER_OPS macro
>
> Signed-off-by: Thomas Zimmermann 
> Cc: Joel Stanley 
> Cc: Andrew Jeffery 
> ---
>  drivers/gpu/drm/aspeed/aspeed_gfx_drv.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Acked-by: Javier Martinez Canillas 

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH v3 12/81] drm/fsl-dcu: Run DRM default client setup

2024-09-03 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> Call drm_client_setup_with_color_mode() to run the kernel's default
> client setup for DRM. Set fbdev_probe in struct drm_driver, so that
> the client setup can start the common fbdev client.
>
> Signed-off-by: Thomas Zimmermann 
> Cc: Stefan Agner 
> Cc: Alison Wang 
> ---
>  drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>

Acked-by: Javier Martinez Canillas 

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH v3 02/81] drm/fbdev-helper: Set and clear VGA switcheroo client from fb_info

2024-09-03 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> Hi Javier
>
> Am 03.09.24 um 12:18 schrieb Javier Martinez Canillas:
>> Thomas Zimmermann  writes:
>>
>> Hello Thomas,
>>
>>> Call vga_switcheroo_client_fb_set() with the PCI device from the
>>> instance of struct fb_info. All fbdev clients now run these calls.
>>> For non-PCI devices or drivers without vga-switcheroo, this does
>>> nothing. For i915 and radeon, it allows these drivers to use a
>>> common fbdev client.
>>>
>>> The device is the same as the one stored in struct drm_client and
>>> struct drm_fb_helper, so there is no difference in behavior. Some
>>> NULL-pointer checks are being removed, where those pointers cannot
>>> be NULL.
>>>
>>> Signed-off-by: Thomas Zimmermann 
>>> ---
>>>   drivers/gpu/drm/drm_fb_helper.c | 15 +++
>>>   1 file changed, 11 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/drm_fb_helper.c 
>>> b/drivers/gpu/drm/drm_fb_helper.c
>>> index af1fe79c701d..13095d38aa42 100644
>>> --- a/drivers/gpu/drm/drm_fb_helper.c
>>> +++ b/drivers/gpu/drm/drm_fb_helper.c
>>> @@ -562,8 +562,12 @@ EXPORT_SYMBOL(drm_fb_helper_release_info);
>>>*/
>>>   void drm_fb_helper_unregister_info(struct drm_fb_helper *fb_helper)
>>>   {
>>> -   if (fb_helper && fb_helper->info)
>>> -   unregister_framebuffer(fb_helper->info);
>> I'm not sure if we can assume these won't be NULL... AFAICT some drivers
>> still have their own struct drm_client_funcs vtable and could potentially
>> pass a NULL struct drm_fb_helper ?
>
> I did a
>
>    git grep -B4 drm_fb_helper_unregister_info
>
> on drm-tip and all callers, such as [1], test fb_helper->info before 
> calling the function. So it's safe to remove the test.
>

Yes, I also noticed that all callers were already checking if is not NULL
but still is more robust for the function to check it in case there is a
bug in a driver.

But as a said, I'm OK with dropping it as long as it is mentioned in the
kernel-doc that the parameter must not be NULL.

> [1] 
> https://elixir.bootlin.com/linux/v6.10/source/drivers/gpu/drm/drm_fbdev_dma.c#L162
>
>>
>> If you think that's safe to do this and the function semantics should be
>> changed, then I think that the kernel-doc needs to be updated:
>>
>> - * @fb_helper: driver-allocated fbdev helper, can be NULL
>> + * @fb_helper: driver-allocated fbdev helper, must not be NULL
>
> Ok.
>
>>
>> Other than that, the patch looks good to me:
>>
>> Reviewed-by: Javier Martinez Canillas 
>
> Thanks.
>
> Best regards
> Thomas
>
>>
>
> -- 
> --
> Thomas Zimmermann
> Graphics Driver Developer
> SUSE Software Solutions Germany GmbH
> Frankenstrasse 146, 90461 Nuernberg, Germany
> GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
> HRB 36809 (AG Nuernberg)
>

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH v3 14/81] drm/hx8357d: Run DRM default client setup

2024-09-03 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> Call drm_client_setup() to run the kernel's default client setup
> for DRM. Set fbdev_probe in struct drm_driver, so that the client
> setup can start the common fbdev client.
>
> Signed-off-by: Thomas Zimmermann 
> ---
>  drivers/gpu/drm/tiny/hx8357d.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>

Acked-by: Javier Martinez Canillas 

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH v3 15/81] drm/ili9163: Run DRM default client setup

2024-09-03 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> Call drm_client_setup() to run the kernel's default client setup
> for DRM. Set fbdev_probe in struct drm_driver, so that the client
> setup can start the common fbdev client.
>
> Signed-off-by: Thomas Zimmermann 
> ---
>  drivers/gpu/drm/tiny/ili9163.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>

Acked-by: Javier Martinez Canillas 

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH v3 17/81] drm/ili9341: Run DRM default client setup

2024-09-03 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> Call drm_client_setup() to run the kernel's default client setup
> for DRM. Set fbdev_probe in struct drm_driver, so that the client
> setup can start the common fbdev client.
>
> Signed-off-by: Thomas Zimmermann 
> ---
>  drivers/gpu/drm/tiny/ili9341.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>

Acked-by: Javier Martinez Canillas 

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH v3 18/81] drm/ili9486: Run DRM default client setup

2024-09-03 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> Call drm_client_setup() to run the kernel's default client setup
> for DRM. Set fbdev_probe in struct drm_driver, so that the client
> setup can start the common fbdev client.
>
> Signed-off-by: Thomas Zimmermann 
> Cc: Kamlesh Gurudasani 
> ---
>  drivers/gpu/drm/tiny/ili9486.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
Acked-by: Javier Martinez Canillas 

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH v3 19/81] drm/imx/dcss: Run DRM default client setup

2024-09-03 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> Call drm_client_setup() to run the kernel's default client setup
> for DRM. Set fbdev_probe in struct drm_driver, so that the client
> setup can start the common fbdev client.
>
> The dcss driver specifies a preferred color mode of 32. As this
> is the default if no format has been given, leave it out entirely.
>
> Signed-off-by: Thomas Zimmermann 
> Cc: Laurentiu Palcu 
> Cc: Lucas Stach 
> Cc: Shawn Guo 
> Cc: Sascha Hauer 
> Cc: Pengutronix Kernel Team 
> Cc: Fabio Estevam 
> ---
>  drivers/gpu/drm/imx/dcss/dcss-kms.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
Acked-by: Javier Martinez Canillas 


-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH v3 20/81] drm/imx/ipuv3: Run DRM default client setup

2024-09-03 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> Call drm_client_setup_with_color_mode() to run the kernel's default
> client setup for DRM. Set fbdev_probe in struct drm_driver, so that
> the client setup can start the common fbdev client.
>
> Signed-off-by: Thomas Zimmermann 
> Cc: Philipp Zabel 
> Cc: Shawn Guo 
> Cc: Sascha Hauer 
> Cc: Pengutronix Kernel Team 
> Cc: Fabio Estevam 
> ---
>  drivers/gpu/drm/imx/ipuv3/imx-drm-core.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>

Acked-by: Javier Martinez Canillas 

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH v3 21/81] drm/imx/lcdc: Run DRM default client setup

2024-09-03 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> Call drm_client_setup() to run the kernel's default client setup
> for DRM. Set fbdev_probe in struct drm_driver, so that the client
> setup can start the common fbdev client.
>
> Signed-off-by: Thomas Zimmermann 
> Cc: Shawn Guo 
> Cc: Sascha Hauer 
> Cc: Pengutronix Kernel Team 
> Cc: Fabio Estevam 
> ---
>  drivers/gpu/drm/imx/lcdc/imx-lcdc.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>

Acked-by: Javier Martinez Canillas 


-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH v3 23/81] drm/kmb: Run DRM default client setup

2024-09-03 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> Call drm_client_setup() to run the kernel's default client setup
> for DRM. Set fbdev_probe in struct drm_driver, so that the client
> setup can start the common fbdev client.
>
> Signed-off-by: Thomas Zimmermann 
> Cc: Anitha Chrisanthus 
> Cc: Edmund Dea 
> ---
>  drivers/gpu/drm/kmb/kmb_drv.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>

Acked-by: Javier Martinez Canillas 


-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH v3 24/81] drm/logicvc: Run DRM default client setup

2024-09-03 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> Call drm_client_setup() to run the kernel's default client setup
> for DRM. Set fbdev_probe in struct drm_driver, so that the client
> setup can start the common fbdev client.
>
> The logicvc driver specifies a preferred color mode from the value
> in struct drm_mode_config.preferred_depth. The fbdev client also
> looks at this value for the default pixel format. Thus remove the
> format selection from logicvc.
>
> Signed-off-by: Thomas Zimmermann 
> Cc: Paul Kocialkowski 
> ---
>  drivers/gpu/drm/logicvc/logicvc_drm.c | 16 
>  1 file changed, 4 insertions(+), 12 deletions(-)
>

Acked-by: Javier Martinez Canillas 

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH v3 25/81] drm/mcde: Run DRM default client setup

2024-09-03 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> Call drm_client_setup() to run the kernel's default client setup
> for DRM. Set fbdev_probe in struct drm_driver, so that the client
> setup can start the common fbdev client.
>
> The mcde driver specifies a preferred color mode of 32. As this
> is the default if no format has been given, leave it out entirely.
>
> Signed-off-by: Thomas Zimmermann 
> Cc: Linus Walleij 
> Acked-by: Linus Walleij 
> ---
>  drivers/gpu/drm/mcde/mcde_drv.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>

Acked-by: Javier Martinez Canillas 

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH v3 29/81] drm/mxsfb/lcdif: Run DRM default client setup

2024-09-03 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> Call drm_client_setup() to run the kernel's default client setup
> for DRM. Set fbdev_probe in struct drm_driver, so that the client
> setup can start the common fbdev client.
>
> The lcdif driver specifies a preferred color mode of 32. As this
> is the default if no format has been given, leave it out entirely.
>
> Signed-off-by: Thomas Zimmermann 
> Cc: Marek Vasut 
> Cc: Stefan Agner 
> Cc: Shawn Guo 
> Cc: Sascha Hauer 
> Cc: Pengutronix Kernel Team 
> Cc: Fabio Estevam 
> ---
>  drivers/gpu/drm/mxsfb/lcdif_drv.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>

Acked-by: Javier Martinez Canillas 

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH v3 30/81] drm/mxsfb: Run DRM default client setup

2024-09-03 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> Call drm_client_setup() to run the kernel's default client setup
> for DRM. Set fbdev_probe in struct drm_driver, so that the client
> setup can start the common fbdev client.
>
> The mxsfb driver specifies a preferred color mode of 32. As this
> is the default if no format has been given, leave it out entirely.
>
> v3:
> - fix driver name "msxfb" to "mxsfb"
>
> Signed-off-by: Thomas Zimmermann 
> Cc: Marek Vasut 
> Cc: Stefan Agner 
> Cc: Shawn Guo 
> Cc: Sascha Hauer 
> Cc: Pengutronix Kernel Team 
> Cc: Fabio Estevam 
> ---
>  drivers/gpu/drm/mxsfb/mxsfb_drv.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>

Acked-by: Javier Martinez Canillas 

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH v3 33/81] drm/pl111: Run DRM default client setup

2024-09-03 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> Call drm_client_setup_with_color_mode() to run the kernel's default
> client setup for DRM. Set fbdev_probe in struct drm_driver, so that
> the client setup can start the common fbdev client.
>
> Signed-off-by: Thomas Zimmermann 
> ---
>  drivers/gpu/drm/pl111/pl111_drv.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>

Acked-by: Javier Martinez Canillas 

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH v3 39/81] drm/sti: Run DRM default client setup

2024-09-03 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> Call drm_client_setup() to run the kernel's default client setup
> for DRM. Set fbdev_probe in struct drm_driver, so that the client
> setup can start the common fbdev client.
>
> The sti driver specifies a preferred color mode of 32. As this
> is the default if no format has been given, leave it out entirely.
>
> Signed-off-by: Thomas Zimmermann 
> Cc: Alain Volmat 
> ---
>  drivers/gpu/drm/sti/sti_drv.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>

Acked-by: Javier Martinez Canillas 

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH v3 41/81] drm/sun4i: Run DRM default client setup

2024-09-03 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> Call drm_client_setup() to run the kernel's default client setup
> for DRM. Set fbdev_probe in struct drm_driver, so that the client
> setup can start the common fbdev client.
>
> The sun4i driver specifies as preferred color mode of 32. As this
> is the default if no format has been given, leave it out entirely.
>
> Signed-off-by: Thomas Zimmermann 
> Cc: Maxime Ripard 
> Cc: Chen-Yu Tsai 
> Cc: Jernej Skrabec 
> Cc: Samuel Holland 
> ---
>  drivers/gpu/drm/sun4i/sun4i_drv.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>

Acked-by: Javier Martinez Canillas 

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH v3 42/81] drm/tidss: Run DRM default client setup

2024-09-03 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> Call drm_client_setup() to run the kernel's default client setup
> for DRM. Set fbdev_probe in struct drm_driver, so that the client
> setup can start the common fbdev client.
>
> The tidss driver specifies a preferred color mode of 32. As this
> is the default if no format has been given, leave it out entirely.
>
> Signed-off-by: Thomas Zimmermann 
> Cc: Jyri Sarha 
> Cc: Tomi Valkeinen 
> ---
>  drivers/gpu/drm/tidss/tidss_drv.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>

Acked-by: Javier Martinez Canillas 

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH v3 43/81] drm/tilcdc: Run DRM default client setup

2024-09-03 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> Call drm_client_setup_with_color_mode() to run the kernel's default
> client setup for DRM. Set fbdev_probe in struct drm_driver, so that
> the client setup can start the common fbdev client.
>
> v3:
> - add DRM_FBDEV_DMA_DRIVER_OPS macro
>
> Signed-off-by: Thomas Zimmermann 
> Cc: Jyri Sarha 
> Cc: Tomi Valkeinen 
> ---
>  drivers/gpu/drm/tilcdc/tilcdc_drv.c | 5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)
>

Acked-by: Javier Martinez Canillas 

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH v3 49/81] drm/fbdev-dma: Remove obsolete setup function

2024-09-03 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> The old setup function drm_fbdev_dma_setup() is unused. Remove it and
> its internal callbacks. New drivers should call drm_client_setup()
> instead.
>
> Signed-off-by: Thomas Zimmermann 
> ---
>  drivers/gpu/drm/drm_fbdev_dma.c | 120 +---
>  include/drm/drm_fbdev_dma.h |   7 --
>  2 files changed, 1 insertion(+), 126 deletions(-)
>

Reviewed-by: Javier Martinez Canillas 

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH v3 50/81] drm/fbdev-shmem: Support struct drm_driver.fbdev_probe

2024-09-03 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> Rework fbdev probing to support fbdev_probe in struct drm_driver
> and reimplement the old fb_probe callback on top of it. Provide an
> initializer macro for struct drm_driver that sets the callback
> according to the kernel configuration.
>
> This change allows the common fbdev client to run on top of SHMEM-
> based DRM drivers.
>
> Signed-off-by: Thomas Zimmermann 
> ---
>  drivers/gpu/drm/drm_fbdev_shmem.c | 60 ++-
>  include/drm/drm_fbdev_shmem.h | 11 ++
>  2 files changed, 47 insertions(+), 24 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_fbdev_shmem.c 
> b/drivers/gpu/drm/drm_fbdev_shmem.c
> index 0c785007f11b..3bca333917d1 100644
> --- a/drivers/gpu/drm/drm_fbdev_shmem.c
> +++ b/drivers/gpu/drm/drm_fbdev_shmem.c
> @@ -107,6 +107,40 @@ static struct page *drm_fbdev_shmem_get_page(struct 
> fb_info *info, unsigned long
>  
>  static int drm_fbdev_shmem_helper_fb_probe(struct drm_fb_helper *fb_helper,
>  struct drm_fb_helper_surface_size 
> *sizes)
> +{

I was going to ask if this whould be static inline too but I guess is just
a transition change and will be removed by a later patch, as was the case
for the fbdev-dma setup function. So it doesn't really matter that much...

Reviewed-by: Javier Martinez Canillas 

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH v3 05/81] drm/fbdev-dma: Support struct drm_driver.fbdev_probe

2024-09-03 Thread Thomas Zimmermann

Hi

Am 03.09.24 um 13:08 schrieb Javier Martinez Canillas:

Thomas Zimmermann  writes:


Rework fbdev probing to support fbdev_probe in struct drm_driver
and reimplement the old fb_probe callback on top of it. Provide an
initializer macro for struct drm_driver that sets the callback
according to the kernel configuration.

This change allows the common fbdev client to run on top of DMA-
based DRM drivers.

Signed-off-by: Thomas Zimmermann 
---
  drivers/gpu/drm/drm_fbdev_dma.c | 60 -
  include/drm/drm_fbdev_dma.h | 12 +++
  2 files changed, 48 insertions(+), 24 deletions(-)

diff --git a/drivers/gpu/drm/drm_fbdev_dma.c b/drivers/gpu/drm/drm_fbdev_dma.c
index 7ef5a48c8029..aeccf7f7a522 100644
--- a/drivers/gpu/drm/drm_fbdev_dma.c
+++ b/drivers/gpu/drm/drm_fbdev_dma.c
@@ -86,6 +86,40 @@ static const struct fb_ops drm_fbdev_dma_fb_ops = {
  
  static int drm_fbdev_dma_helper_fb_probe(struct drm_fb_helper *fb_helper,

 struct drm_fb_helper_surface_size 
*sizes)
+{

static inline for this wrapper maybe ?


It's only called indirectly via drm_fb_helper_funcs.fb_probe. So it 
needs an address. It well be removed later in the series when all 
related drivers have been converted.


Best regards
Thomas




+   return drm_fbdev_dma_driver_fbdev_probe(fb_helper, sizes);
+}
+

Reviewed-by: Javier Martinez Canillas 



--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)



Re: [PATCH v3 52/81] drm/cirrus: Run DRM default client setup

2024-09-03 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> Call drm_client_setup() to run the kernel's default client setup
> for DRM. Set fbdev_probe in struct drm_driver, so that the client
> setup can start the common fbdev client.
>
> The cirrus driver requests the same client pixel format as the value
> stored in struct drm_mode_config.preferred_depth. The fbdev client
> also looks at this value for the default pixel format. Thus remove
> the format selection from cirrus.
>
> Signed-off-by: Thomas Zimmermann 
> Cc: Dave Airlie 
> Cc: Gerd Hoffmann 
> ---
>  drivers/gpu/drm/tiny/cirrus.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>

Acked-by: Javier Martinez Canillas 

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH v3 53/81] drm/gm12u320: Run DRM default client setup

2024-09-03 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> Call drm_client_setup() to run the kernel's default client setup
> for DRM. Set fbdev_probe in struct drm_driver, so that the client
> setup can start the common fbdev client.
>
> Signed-off-by: Thomas Zimmermann 
> Cc: Hans de Goede 
> ---
>  drivers/gpu/drm/tiny/gm12u320.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>

Acked-by: Javier Martinez Canillas 

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH v3 60/81] drm/udl: Run DRM default client setup

2024-09-03 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> Call drm_client_setup() to run the kernel's default client setup
> for DRM. Set fbdev_probe in struct drm_driver, so that the client
> setup can start the common fbdev client.
>
> Signed-off-by: Thomas Zimmermann 
> Cc: Dave Airlie 
> Cc: Sean Paul 
> Cc: Thomas Zimmermann 
> ---
>  drivers/gpu/drm/udl/udl_drv.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>

Acked-by: Javier Martinez Canillas 

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH v3 61/81] drm/virtgpu: Run DRM default client setup

2024-09-03 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> Call drm_client_setup() to run the kernel's default client setup
> for DRM. Set fbdev_probe in struct drm_driver, so that the client
> setup can start the common fbdev client.
>
> The virtgpu driver specifies a preferred color mode of 32. As this
> is the default if no format has been given, leave it out entirely.
>
> Signed-off-by: Thomas Zimmermann 
> Cc: David Airlie 
> Cc: Gerd Hoffmann 
> Cc: Gurchetan Singh 
> Cc: Chia-I Wu 
> ---
>  drivers/gpu/drm/virtio/virtgpu_drv.c | 6 +-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>

Acked-by: Javier Martinez Canillas 

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH v3 62/81] drm/vkms: Run DRM default client setup

2024-09-03 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> Call drm_client_setup() to run the kernel's default client setup
> for DRM. Set fbdev_probe in struct drm_driver, so that the client
> setup can start the common fbdev client.
>
> Signed-off-by: Thomas Zimmermann 
> Cc: Rodrigo Siqueira 
> Cc: Melissa Wen 
> Cc: "Maíra Canal" 
> Cc: Haneen Mohammed 
> ---
>  drivers/gpu/drm/vkms/vkms_drv.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>

Acked-by: Javier Martinez Canillas 

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH v3 63/81] drm/fbdev-shmem: Remove obsolete setup function

2024-09-03 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> The old setup function drm_fbdev_shmem_setup() is unused. Remove it
> and its internal callbacks. New drivers should call drm_client_setup()
> instead.
>
> Signed-off-by: Thomas Zimmermann 
> ---
>  drivers/gpu/drm/drm_fbdev_shmem.c | 120 +-
>  include/drm/drm_fbdev_shmem.h |   6 --
>  2 files changed, 1 insertion(+), 125 deletions(-)
>

Reviewed-by: Javier Martinez Canillas 

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH v3 64/81] drm/fbdev-ttm: Support struct drm_driver.fbdev_probe

2024-09-03 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> Rework fbdev probing to support fbdev_probe in struct drm_driver
> and reimplement the old fb_probe callback on top of it. Provide an
> initializer macro for struct drm_driver that sets the callback
> according to the kernel configuration.
>
> This change allows the common fbdev client to run on top of TTM-
> based DRM drivers.
>
> Signed-off-by: Thomas Zimmermann 
> ---
>  drivers/gpu/drm/drm_fbdev_ttm.c | 142 +---
>  include/drm/drm_fbdev_ttm.h |  13 +++
>  2 files changed, 90 insertions(+), 65 deletions(-)
>

Acked-by: Javier Martinez Canillas 

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH v3 66/81] drm/bochs: Run DRM default client setup

2024-09-03 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> Call drm_client_setup() to run the kernel's default client setup
> for DRM. Set fbdev_probe in struct drm_driver, so that the client
> setup can start the common fbdev client.
>
> The bochs driver specifies a preferred color mode of 32. As this
> is the default if no format has been given, leave it out entirely.
>
> Signed-off-by: Thomas Zimmermann 
> Cc: Gerd Hoffmann 
> ---
>  drivers/gpu/drm/tiny/bochs.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>

Acked-by: Javier Martinez Canillas 

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH v3 67/81] drm/hisilicon/hibmc: Run DRM default client setup

2024-09-03 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> Call drm_client_setup() to run the kernel's default client setup
> for DRM. Set fbdev_probe in struct drm_driver, so that the client
> setup can start the common fbdev client.
>
> The hibmc driver specifies a preferred color mode of 32. As this
> is the default if no format has been given, leave it out entirely.
>
> Signed-off-by: Thomas Zimmermann 
> Cc: Xinliang Liu 
> Cc: Tian Tao 
> Cc: Xinwei Kong 
> Cc: Sumit Semwal 
> Cc: Yongqin Liu 
> Cc: John Stultz 
> ---
>  drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>

Acked-by: Javier Martinez Canillas 

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH v3 70/81] drm/qxl: Run DRM default client setup

2024-09-03 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> Call drm_client_setup() to run the kernel's default client setup
> for DRM. Set fbdev_probe in struct drm_driver, so that the client
> setup can start the common fbdev client.
>
> The qxl driver specifies a preferred color mode of 32. As this
> is the default if no format has been given, leave it out entirely.
>
> Signed-off-by: Thomas Zimmermann 
> Cc: Dave Airlie 
> Cc: Gerd Hoffmann 
> ---
>  drivers/gpu/drm/qxl/qxl_drv.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>

Acked-by: Javier Martinez Canillas 

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH v3 71/81] drm/vboxvideo: Run DRM default client setup

2024-09-03 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> Call drm_client_setup() to run the kernel's default client setup
> for DRM. Set fbdev_probe in struct drm_driver, so that the client
> setup can start the common fbdev client.
>
> The vboxvideo driver specifies a preferred color mode of 32. As this
> is the default if no format has been given, leave it out entirely.
>
> Signed-off-by: Thomas Zimmermann 
> Cc: Hans de Goede 
> ---
>  drivers/gpu/drm/vboxvideo/vbox_drv.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>

Acked-by: Javier Martinez Canillas 

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH v3 72/81] drm/vmwgfx: Run DRM default client setup

2024-09-03 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> Call drm_client_setup() to run the kernel's default client setup
> for DRM. Set fbdev_probe in struct drm_driver, so that the client
> setup can start the common fbdev client.
>
> Signed-off-by: Thomas Zimmermann 
> Cc: Zack Rusin 
> Cc: Broadcom internal kernel review list 
> 
> ---
>  drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)
>

Acked-by: Javier Martinez Canillas 

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH v3 73/81] drm/fbdev-ttm: Remove obsolete setup function

2024-09-03 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> The old setup function drm_fbdev_ttm_setup() is unused. Remove it and
> its internal callbacks. New drivers should call drm_client_setup()
> instead.
>
> Signed-off-by: Thomas Zimmermann 
> ---
>  drivers/gpu/drm/drm_fbdev_ttm.c | 119 
>  include/drm/drm_fbdev_ttm.h |   6 --
>  2 files changed, 125 deletions(-)
>

Acked-by: Javier Martinez Canillas 

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH v3 74/81] drm/armada: Run DRM default client setup

2024-09-03 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> Rework fbdev probing to support fbdev_probe in struct drm_driver
> and remove the old fb_probe callback. Provide an initializer macro
> for struct drm_driver that sets the callback according to the kernel
> configuration.
>
> Call drm_client_setup() to run the kernel's default client setup
> for DRM. Set fbdev_probe in struct drm_driver, so that the client
> setup can start the common fbdev client.
>
> The armada driver specifies a preferred color mode of 32. As this
> is the default if no format has been given, leave it out entirely.
>
> Signed-off-by: Thomas Zimmermann 
> Cc: Russell King 
> ---
>  drivers/gpu/drm/armada/armada_drm.h   |  11 ++-
>  drivers/gpu/drm/armada/armada_drv.c   |   4 +-
>  drivers/gpu/drm/armada/armada_fbdev.c | 115 ++
>  3 files changed, 17 insertions(+), 113 deletions(-)
>
> diff --git a/drivers/gpu/drm/armada/armada_drm.h 
> b/drivers/gpu/drm/armada/armada_drm.h
> index c303e8c7ff6c..3c0ff221a43b 100644

[...]

> @@ -108,113 +111,7 @@ static int armada_fbdev_create(struct drm_fb_helper 
> *fbh,
>  
>   return 0;
>  
> - err_fballoc:
> +err_fballoc:

Unrelated cleanup but probably not worth to split in a separate patch...

>   dfb->fb.funcs->destroy(&dfb->fb);
>   return ret;
>  }

Acked-by: Javier Martinez Canillas 

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH v3 75/81] drm/exynos-drm: Run DRM default client setup

2024-09-03 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> Rework fbdev probing to support fbdev_probe in struct drm_driver
> and remove the old fb_probe callback. Provide an initializer macro
> for struct drm_driver that sets the callback according to the kernel
> configuration.
>
> Call drm_client_setup() to run the kernel's default client setup
> for DRM. Set fbdev_probe in struct drm_driver, so that the client
> setup can start the common fbdev client.
>
> The exynos-drm driver specifies a preferred color mode of 32. As this
> is the default if no format has been given, leave it out entirely.
>
> Signed-off-by: Thomas Zimmermann 
> Cc: Inki Dae 
> Cc: Seung-Woo Kim 
> Cc: Kyungmin Park 
> ---
>  drivers/gpu/drm/exynos/exynos_drm_drv.c   |   4 +-
>  drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 101 ++
>  drivers/gpu/drm/exynos/exynos_drm_fbdev.h |  15 ++--
>  3 files changed, 19 insertions(+), 101 deletions(-)
>
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c 
> b/drivers/gpu/drm/exynos/exynos_drm_drv.c
> index 7c59e1164a48..2a466d8179f4 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
> @@ -15,6 +15,7 @@
>  
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -111,6 +112,7 @@ static const struct drm_driver exynos_drm_driver = {
>   .dumb_create= exynos_drm_gem_dumb_create,
>   .gem_prime_import   = exynos_drm_gem_prime_import,
>   .gem_prime_import_sg_table  = exynos_drm_gem_prime_import_sg_table,
> + EXYNOS_DRM_FBDEV_DRIVER_OPS,
>   .ioctls = exynos_ioctls,
>   .num_ioctls = ARRAY_SIZE(exynos_ioctls),
>   .fops   = &exynos_drm_driver_fops,
> @@ -288,7 +290,7 @@ static int exynos_drm_bind(struct device *dev)
>   if (ret < 0)
>   goto err_cleanup_poll;
>  
> - exynos_drm_fbdev_setup(drm);
> + drm_client_setup(drm, NULL);
>  
>   return 0;
>  
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c 
> b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
> index a379c8ca435a..73fa7b77d8d0 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
> @@ -22,9 +22,6 @@
>  #include "exynos_drm_fb.h"
>  #include "exynos_drm_fbdev.h"
>  
> -#define MAX_CONNECTOR4

I see this constant was unused. Is an unrelated cleanup but I guess is OK too.

Acked-by: Javier Martinez Canillas 

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH v3 76/81] drm/gma500: Run DRM default client setup

2024-09-03 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> Rework fbdev probing to support fbdev_probe in struct drm_driver
> and remove the old fb_probe callback. Provide an initializer macro
> for struct drm_driver that sets the callback according to the kernel
> configuration.
>
> Call drm_client_setup() to run the kernel's default client setup
> for DRM. Set fbdev_probe in struct drm_driver, so that the client
> setup can start the common fbdev client.
>
> Signed-off-by: Thomas Zimmermann 
> Cc: Patrik Jakobsson 
> ---
>  drivers/gpu/drm/gma500/fbdev.c   | 100 +++
>  drivers/gpu/drm/gma500/psb_drv.c |   4 +-
>  drivers/gpu/drm/gma500/psb_drv.h |  12 +++-
>  3 files changed, 19 insertions(+), 97 deletions(-)
>

Acked-by: Javier Martinez Canillas 

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH v3 77/81] drm/msm: Run DRM default client setup

2024-09-03 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> Rework fbdev probing to support fbdev_probe in struct drm_driver
> and remove the old fb_probe callback. Provide an initializer macro
> for struct drm_driver that sets the callback according to the kernel
> configuration.
>
> Call drm_client_setup() to run the kernel's default client setup
> for DRM. Set fbdev_probe in struct drm_driver, so that the client
> setup can start the common fbdev client.
>
> The msm driver specifies a preferred color mode of 32. As this
> is the default if no format has been given, leave it out entirely.
>
> Signed-off-by: Thomas Zimmermann 
> Cc: Rob Clark 
> Cc: Abhinav Kumar 
> Cc: Dmitry Baryshkov 
> Cc: Sean Paul 
> Cc: Marijn Suijten 
> ---
>  drivers/gpu/drm/msm/msm_drv.c   |   4 +-
>  drivers/gpu/drm/msm/msm_drv.h   |  13 ++-
>  drivers/gpu/drm/msm/msm_fbdev.c | 144 ++--
>  3 files changed, 38 insertions(+), 123 deletions(-)
>

Acked-by: Javier Martinez Canillas 

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH v3 79/81] drm/tegra: Run DRM default client setup

2024-09-03 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> Rework fbdev probing to support fbdev_probe in struct drm_driver
> and remove the old fb_probe callback. Provide an initializer macro
> for struct drm_driver that sets the callback according to the kernel
> configuration.
>
> Call drm_client_setup() to run the kernel's default client setup
> for DRM. Set fbdev_probe in struct drm_driver, so that the client
> setup can start the common fbdev client.
>
> The tegra driver specifies a preferred color mode of 32. As this
> is the default if no format has been given, leave it out entirely.
>
> Signed-off-by: Thomas Zimmermann 
> Cc: Thierry Reding 
> Cc: Mikko Perttunen 
> Cc: Jonathan Hunter 
> ---
>  drivers/gpu/drm/tegra/drm.c   |  5 +-
>  drivers/gpu/drm/tegra/drm.h   | 12 +++--
>  drivers/gpu/drm/tegra/fbdev.c | 98 +++
>  3 files changed, 19 insertions(+), 96 deletions(-)
>

Acked-by: Javier Martinez Canillas 

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH v3 80/81] drm/omapdrm: Remove struct drm_fb_helper from struct omap_fbdev.

2024-09-03 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> Store instances of drm_fb_helper and struct omap_fbdev separately.
> This will allow omapdrm to use the common fbdev client, which allocates
> its own instance of struct drm_fb_helper.
>
> There is at most one instance of each per DRM device, so both can be
> referenced directly from the omap and DRM device structures. A later
> patchset might rework the common fbdev client to allow for storing
> both, drm_fb_helper and omap_fbdev, together in the same place.
>
> Signed-off-by: Thomas Zimmermann 
> Cc: Tomi Valkeinen 
> ---
>  drivers/gpu/drm/omapdrm/omap_drv.h   |  3 ++
>  drivers/gpu/drm/omapdrm/omap_fbdev.c | 42 +++-
>  2 files changed, 26 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/gpu/drm/omapdrm/omap_drv.h 
> b/drivers/gpu/drm/omapdrm/omap_drv.h
> index 4c7217b35f6b..d903568fd8cc 100644
> --- a/drivers/gpu/drm/omapdrm/omap_drv.h
> +++ b/drivers/gpu/drm/omapdrm/omap_drv.h
> @@ -32,6 +32,7 @@
>  #define MODULE_NAME "omapdrm"
>  

Acked-by: Javier Martinez Canillas 

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH v3 81/81] drm/omapdrm: Run DRM default client setup

2024-09-03 Thread Javier Martinez Canillas
Thomas Zimmermann  writes:

> Rework fbdev probing to support fbdev_probe in struct drm_driver
> and remove the old fb_probe callback. Provide an initializer macro
> for struct drm_driver that sets the callback according to the kernel
> configuration.
>
> Call drm_client_setup() to run the kernel's default client setup
> for DRM. Set fbdev_probe in struct drm_driver, so that the client
> setup can start the common fbdev client.
>
> The omapdrm driver specifies a preferred color mode of 32. As this
> is the default if no format has been given, leave it out entirely.
>
> Signed-off-by: Thomas Zimmermann 
> Cc: Tomi Valkeinen 
> ---
>  drivers/gpu/drm/omapdrm/omap_drv.c   |   1 +
>  drivers/gpu/drm/omapdrm/omap_fbdev.c | 131 ++-
>  drivers/gpu/drm/omapdrm/omap_fbdev.h |   8 ++
>  3 files changed, 38 insertions(+), 102 deletions(-)
>

Acked-by: Javier Martinez Canillas 

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat



Re: [PATCH 07/11] drm/i915/pps: pass intel_dp to pps_name()

2024-09-03 Thread Ville Syrjälä
On Fri, Aug 30, 2024 at 01:15:44PM +0300, Jani Nikula wrote:
> Currently all of intel_pps.c passes struct intel_dp around. Do the same
> with pps_name() instead of passing both struct drm_i915_private and
> struct intel_pps.
> 
> Signed-off-by: Jani Nikula 
> ---
>  drivers/gpu/drm/i915/display/intel_pps.c | 61 +---
>  1 file changed, 32 insertions(+), 29 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_pps.c 
> b/drivers/gpu/drm/i915/display/intel_pps.c
> index 68141af4da54..1e87ce95c85d 100644
> --- a/drivers/gpu/drm/i915/display/intel_pps.c
> +++ b/drivers/gpu/drm/i915/display/intel_pps.c
> @@ -24,9 +24,12 @@ static void vlv_steal_power_sequencer(struct 
> drm_i915_private *dev_priv,
>  static void pps_init_delays(struct intel_dp *intel_dp);
>  static void pps_init_registers(struct intel_dp *intel_dp, bool 
> force_disable_vdd);
>  
> -static const char *pps_name(struct drm_i915_private *i915,
> - struct intel_pps *pps)
> +static const char *pps_name(struct intel_dp *intel_dp)
>  {
> + struct intel_display *display = to_intel_display(intel_dp);
> + struct drm_i915_private *i915 = to_i915(display->drm);
> + struct intel_pps *pps = &intel_dp->pps;
> +

I've been thinking that we'd eventually turn intel_pps into some kind of
proper object with a 1:1 relationship to the corresponding hw block.
This is sort of going in the opposite direction, but looks trivial
enough to deal with if/when we get to reworking intel_pps.

Series is
Reviewed-by: Ville Syrjälä 

-- 
Ville Syrjälä
Intel


Re: [PATCH 06/13] drm/i915/vrr: Compute vrr vsync if platforms support it

2024-09-03 Thread Ville Syrjälä
On Mon, Sep 02, 2024 at 01:36:27PM +0530, Ankit Nautiyal wrote:
> Previously, TRANS_VRR_VSYNC was exclusively used for panels with
> adaptive-sync SDP support in VRR scenarios. However, to drive fixed refresh
> rates using the VRR Timing generator, we now need to program
> TRANS_VRR_VSYNC regardless of adaptive sync SDP support. Therefore, let's
> remove the adaptive sync SDP check and program TRANS_VRR_VSYNC for
> platforms where VRR timing generator is used.
> 
> Signed-off-by: Ankit Nautiyal 
> ---
>  drivers/gpu/drm/i915/display/intel_vrr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_vrr.c 
> b/drivers/gpu/drm/i915/display/intel_vrr.c
> index 9a51f5bac307..03af50b9f9eb 100644
> --- a/drivers/gpu/drm/i915/display/intel_vrr.c
> +++ b/drivers/gpu/drm/i915/display/intel_vrr.c
> @@ -231,7 +231,7 @@ intel_vrr_compute_config(struct intel_crtc_state 
> *crtc_state,
>   crtc_state->mode_flags |= I915_MODE_FLAG_VRR;
>   }
>  
> - if (intel_dp->as_sdp_supported && crtc_state->vrr.enable) {
> + if (HAS_AS_SDP(display) && crtc_state->vrr.enable) {

That vrr.enable check should be nuked as well. We are supposed to
compute the full state whether VRR is actually enabled or not.

>   crtc_state->vrr.vsync_start =
>   (crtc_state->hw.adjusted_mode.crtc_vtotal -
>crtc_state->hw.adjusted_mode.vsync_start);
> -- 
> 2.45.2

-- 
Ville Syrjälä
Intel


Re: [PATCH 03/13] drm/i915/display: Add member fixed_rr to denote Fixed refresh rate with VRRTG

2024-09-03 Thread Ville Syrjälä
On Mon, Sep 02, 2024 at 01:36:24PM +0530, Ankit Nautiyal wrote:
> Add fixed_rr member to struct vrr to represent the case where a
> fixed refresh rate with VRR timing generator is required.
> 
> v2: Move get_config change where vrr.fixed is actually set. (Mitul)
> 
> Signed-off-by: Ankit Nautiyal 
> ---
>  drivers/gpu/drm/i915/display/intel_display.c   | 4 +++-
>  drivers/gpu/drm/i915/display/intel_display_types.h | 2 +-
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c 
> b/drivers/gpu/drm/i915/display/intel_display.c
> index 78ce402a5cd0..8b437e79c8df 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -1005,7 +1005,8 @@ static bool vrr_params_changed(const struct 
> intel_crtc_state *old_crtc_state,
>   old_crtc_state->vrr.vmin != new_crtc_state->vrr.vmin ||
>   old_crtc_state->vrr.vmax != new_crtc_state->vrr.vmax ||
>   old_crtc_state->vrr.guardband != new_crtc_state->vrr.guardband 
> ||
> - old_crtc_state->vrr.pipeline_full != 
> new_crtc_state->vrr.pipeline_full;
> + old_crtc_state->vrr.pipeline_full != 
> new_crtc_state->vrr.pipeline_full ||
> + old_crtc_state->vrr.fixed_rr != new_crtc_state->vrr.fixed_rr;

I have a feeling we shouldn't need this. We could just check for
vmin==vmax instead.

>  }
>  
>  static bool cmrr_params_changed(const struct intel_crtc_state 
> *old_crtc_state,
> @@ -5480,6 +5481,7 @@ intel_pipe_config_compare(const struct intel_crtc_state 
> *current_config,
>  
>   if (!fastset) {
>   PIPE_CONF_CHECK_BOOL(vrr.enable);
> + PIPE_CONF_CHECK_BOOL(vrr.fixed_rr);
>   PIPE_CONF_CHECK_I(vrr.vmin);
>   PIPE_CONF_CHECK_I(vrr.vmax);
>   PIPE_CONF_CHECK_I(vrr.flipline);
> diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h 
> b/drivers/gpu/drm/i915/display/intel_display_types.h
> index 868ff8976ed9..62a796f61d20 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_types.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
> @@ -1407,7 +1407,7 @@ struct intel_crtc_state {
>  
>   /* Variable Refresh Rate state */
>   struct {
> - bool enable, in_range;
> + bool enable, in_range, fixed_rr;
>   u8 pipeline_full;
>   u16 flipline, vmin, vmax, guardband;
>   u32 vsync_end, vsync_start;
> -- 
> 2.45.2

-- 
Ville Syrjälä
Intel


[PATCH -next] drm/i915/gt: Make use of __assign_bit() API

2024-09-03 Thread Hongbo Li
We have for some time the __assign_bit() API to replace
open coded
if (foo)
__set_bit(n, bar);
else
__clear_bit(n, bar);

Use this API to simplify the code. No functional change
intended.

Signed-off-by: Hongbo Li 
---
 drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c 
b/drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c
index 0ffba50981e3..4380e6f9d0ab 100644
--- a/drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c
+++ b/drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c
@@ -827,10 +827,7 @@ i915_gem_object_save_bit_17_swizzle(struct 
drm_i915_gem_object *obj,
i = 0;
 
for_each_sgt_page(page, sgt_iter, pages) {
-   if (page_to_phys(page) & (1 << 17))
-   __set_bit(i, obj->bit_17);
-   else
-   __clear_bit(i, obj->bit_17);
+   __assign_bit(i, obj->bit_17, page_to_phys(page) & (1 << 17));
i++;
}
 }
-- 
2.34.1



[PATCH -next] drm/i915: Remove extra unlikely helper

2024-09-03 Thread Hongbo Li
In IS_ERR, the unlikely is used for the input parameter,
so these is no need to use it again outside.

Signed-off-by: Hongbo Li 
---
 drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c 
b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
index 01b7587dd1f8..a3b83cfe1726 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
@@ -825,7 +825,7 @@ static int eb_select_context(struct i915_execbuffer *eb)
struct i915_gem_context *ctx;
 
ctx = i915_gem_context_lookup(eb->file->driver_priv, eb->args->rsvd1);
-   if (unlikely(IS_ERR(ctx)))
+   if (IS_ERR(ctx))
return PTR_ERR(ctx);
 
eb->gem_context = ctx;
-- 
2.34.1



i915 | Bug in virtual PCH detection

2024-09-03 Thread Andrey Toloknev
Hello!

I have 2 machines with Comet Lake CPUs on Tiger Lake PCH (500 series of
Intel chipsets).
For that configuration there was a patch for adding support for Tiger Lake
PCH with CometLake CPU in 2021 -
https://patchwork.freedesktop.org/patch/412664/
This patch made possible correct detection of such chipset and cpu
configuration for i915 kernel module. Without it there was no output to any
display (HDMI/DP/DVI, even VGA).

But this patch doesn't touch intel_virt_detect_pch method, when you
passthrough iGPU to a virtual machine.
So, virtual PCH incorrectly detects as Cannon Lake and you have no output
to a physical display with i915 driver:

[2.933139] i915 :00:02.0: [drm:intel_virt_detect_pch [i915]]
Assuming PCH ID a300
[2.933308] i915 :00:02.0: [drm:intel_pch_type [i915]] Found Cannon
Lake PCH (CNP)


The bug is on line 173 in drivers/gpu/drm/i915/soc/intel_pch.c in method
intel_virt_detect_pch:

else if (IS_TIGERLAKE(dev_priv) || IS_ROCKETLAKE(dev_priv))

id = INTEL_PCH_TGP_DEVICE_ID_TYPE;

It must be:

else if (IS_TIGERLAKE(dev_priv) || IS_ROCKETLAKE(dev_priv) ||
IS_GEN9_BC(dev_priv))

id = INTEL_PCH_TGP_DEVICE_ID_TYPE;


After that small change you get correct detection of PCH and have output to
a physical display in VM with passthrough iGPU:

[   16.139809] i915 :00:02.0: [drm:intel_virt_detect_pch [i915]]
Assuming PCH ID a080
[   16.261151] i915 :00:02.0: [drm:intel_pch_type [i915]] Found Tiger
Lake LP PCH


All kernel versions in any distro since 2021 are affected by this small bug.
The patch for i915 module of the actual kernel version is in attachment.

-- 
Best regards, Andrey Toloknev


tgl_vpch_fix.patch
Description: Binary data


[PATCH -next] drm/i915: Use memdup_user() helper

2024-09-03 Thread Jinjie Ruan
Switching to memdup_user(), which combines kmalloc() and copy_from_user(),
and it can simplfy code.

Signed-off-by: Jinjie Ruan 
---
 drivers/gpu/drm/i915/gem/i915_gem_context.c | 12 +++-
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_context.c 
b/drivers/gpu/drm/i915/gem/i915_gem_context.c
index c0543c35cd6a..c1cc41e90502 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_context.c
@@ -2159,18 +2159,12 @@ static int set_context_image(struct i915_gem_context 
*ctx,
goto out_ce;
}
 
-   state = kmalloc(ce->engine->context_size, GFP_KERNEL);
-   if (!state) {
-   ret = -ENOMEM;
+   state = memdup_user(u64_to_user_ptr(user.image), 
ce->engine->context_size);
+   if (IS_ERR(state)) {
+   ret = PTR_ERR(state);
goto out_ce;
}
 
-   if (copy_from_user(state, u64_to_user_ptr(user.image),
-  ce->engine->context_size)) {
-   ret = -EFAULT;
-   goto out_state;
-   }
-
shmem_state = shmem_create_from_data(ce->engine->name,
 state, ce->engine->context_size);
if (IS_ERR(shmem_state)) {
-- 
2.34.1



Re: [PATCH v3 43/81] drm/tilcdc: Run DRM default client setup

2024-09-03 Thread jyri . sarha
August 30, 2024 at 11:40 AM, "Thomas Zimmermann" mailto:tzimmerm...@suse.de?to=%22Thomas%20Zimmermann%22%20%3Ctzimmermann%40suse.de%3E
 > wrote:

> 
> Call drm_client_setup_with_color_mode() to run the kernel's default
> client setup for DRM. Set fbdev_probe in struct drm_driver, so that
> the client setup can start the common fbdev client.
> 
> v3:
> - add DRM_FBDEV_DMA_DRIVER_OPS macro
> 
> Signed-off-by: Thomas Zimmermann 
> Cc: Jyri Sarha 
> Cc: Tomi Valkeinen 

Acked-by: Jyri Sarha 

Thanks,
Jyri

> ---
> drivers/gpu/drm/tilcdc/tilcdc_drv.c | 5 -
> 1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c 
> b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> index cd5eefa06060..8c9f3705aa6c 100644
> --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> @@ -14,6 +14,7 @@
> #include 
> 
> #include 
> +#include 
> #include 
> #include 
> #include 
> @@ -374,7 +375,8 @@ static int tilcdc_init(const struct drm_driver *ddrv, 
> struct device *dev)
>  goto init_failed;
>  priv->is_registered = true;
> 
> - drm_fbdev_dma_setup(ddev, bpp);
> + drm_client_setup_with_color_mode(ddev, bpp);
> +
>  return 0;
> 
> init_failed:
> @@ -472,6 +474,7 @@ DEFINE_DRM_GEM_DMA_FOPS(fops);
> static const struct drm_driver tilcdc_driver = {
>  .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC,
>  DRM_GEM_DMA_DRIVER_OPS,
> + DRM_FBDEV_DMA_DRIVER_OPS,
> #ifdef CONFIG_DEBUG_FS
>  .debugfs_init = tilcdc_debugfs_init,
> #endif
> -- 
> 2.46.0
>


Re: [PATCH 10/13] drm/i915/vrr: Avoid sending PUSH when VRR TG is used with Fixed refresh rate

2024-09-03 Thread Ville Syrjälä
On Mon, Sep 02, 2024 at 01:36:31PM +0530, Ankit Nautiyal wrote:
> As per Bspec:68925: Push enable must be set if not configuring for a
> fixed refresh rate (i.e Vmin == Flipline == Vmax is not true).
> 
> Signed-off-by: Ankit Nautiyal 
> Reviewed-by: Mitul Golani 
> ---
>  drivers/gpu/drm/i915/display/intel_vrr.c | 9 +
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_vrr.c 
> b/drivers/gpu/drm/i915/display/intel_vrr.c
> index 03af50b9f9eb..5e947465c6e0 100644
> --- a/drivers/gpu/drm/i915/display/intel_vrr.c
> +++ b/drivers/gpu/drm/i915/display/intel_vrr.c
> @@ -313,7 +313,7 @@ void intel_vrr_send_push(const struct intel_crtc_state 
> *crtc_state)
>   struct intel_display *display = to_intel_display(crtc_state);
>   enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;
>  
> - if (!crtc_state->vrr.enable)
> + if (!crtc_state->vrr.enable || crtc_state->vrr.fixed_rr)

Hmm. I wonder if we should keep vrr.enable meaning VRR actually
enabled... Maybe not as that would complicate the readout/check
a bit too much perhaps.

But we could have some kind of helper for these "do we need to use
push?" checks (eg. intel_vrr_use_push()).

>   return;
>  
>   intel_de_write(display, TRANS_PUSH(display, cpu_transcoder),
> @@ -325,7 +325,7 @@ bool intel_vrr_is_push_sent(const struct intel_crtc_state 
> *crtc_state)
>   struct intel_display *display = to_intel_display(crtc_state);
>   enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;
>  
> - if (!crtc_state->vrr.enable)
> + if (!crtc_state->vrr.enable || crtc_state->vrr.fixed_rr)
>   return false;
>  
>   return intel_de_read(display, TRANS_PUSH(display, cpu_transcoder)) & 
> TRANS_PUSH_SEND;
> @@ -339,8 +339,9 @@ void intel_vrr_enable(const struct intel_crtc_state 
> *crtc_state)
>   if (!crtc_state->vrr.enable)
>   return;
>  
> - intel_de_write(display, TRANS_PUSH(display, cpu_transcoder),
> -TRANS_PUSH_EN);
> + if (!crtc_state->vrr.fixed_rr)
> + intel_de_write(display, TRANS_PUSH(display, cpu_transcoder),
> +TRANS_PUSH_EN);
>  
>   if (HAS_AS_SDP(display))
>   intel_de_write(display,
> -- 
> 2.45.2

-- 
Ville Syrjälä
Intel


Re: [PATCH 11/13] drm/i915/vrr: Handle joiner with vrr

2024-09-03 Thread Ville Syrjälä
On Mon, Sep 02, 2024 at 01:36:32PM +0530, Ankit Nautiyal wrote:
> Do not program transcoder registers for VRR for the secondary pipe of
> the joiner. Remove check to skip VRR for joiner case.
> 
> Signed-off-by: Ankit Nautiyal 
> ---
>  drivers/gpu/drm/i915/display/intel_vrr.c | 19 ---
>  1 file changed, 12 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_vrr.c 
> b/drivers/gpu/drm/i915/display/intel_vrr.c
> index 5e947465c6e0..e01d4b4b8fa7 100644
> --- a/drivers/gpu/drm/i915/display/intel_vrr.c
> +++ b/drivers/gpu/drm/i915/display/intel_vrr.c
> @@ -169,13 +169,6 @@ intel_vrr_compute_config(struct intel_crtc_state 
> *crtc_state,
>   const struct drm_display_info *info = &connector->base.display_info;
>   int vmin, vmax;
>  
> - /*
> -  * FIXME all joined pipes share the same transcoder.
> -  * Need to account for that during VRR toggle/push/etc.
> -  */
> - if (crtc_state->joiner_pipes)
> - return;

There's more to this than just sprinkling the secondary checks.
Namely, we need to make sure the timing changes happen in the
correct spot in the sequence for both primary and secondary pipes.

> -
>   if (adjusted_mode->flags & DRM_MODE_FLAG_INTERLACE)
>   return;
>  
> @@ -272,6 +265,9 @@ void intel_vrr_set_transcoder_timings(const struct 
> intel_crtc_state *crtc_state)
>   struct intel_display *display = to_intel_display(crtc_state);
>   enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;
>  
> + if (intel_crtc_is_joiner_secondary(crtc_state))
> + return;
> +
>   /*
>* This bit seems to have two meanings depending on the platform:
>* TGL: generate VRR "safe window" for DSB vblank waits
> @@ -313,6 +309,9 @@ void intel_vrr_send_push(const struct intel_crtc_state 
> *crtc_state)
>   struct intel_display *display = to_intel_display(crtc_state);
>   enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;
>  
> + if (intel_crtc_is_joiner_secondary(crtc_state))
> + return;
> +
>   if (!crtc_state->vrr.enable || crtc_state->vrr.fixed_rr)
>   return;
>  
> @@ -336,6 +335,9 @@ void intel_vrr_enable(const struct intel_crtc_state 
> *crtc_state)
>   struct intel_display *display = to_intel_display(crtc_state);
>   enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;
>  
> + if (intel_crtc_is_joiner_secondary(crtc_state))
> + return;
> +
>   if (!crtc_state->vrr.enable)
>   return;
>  
> @@ -364,6 +366,9 @@ void intel_vrr_disable(const struct intel_crtc_state 
> *old_crtc_state)
>   struct intel_display *display = to_intel_display(old_crtc_state);
>   enum transcoder cpu_transcoder = old_crtc_state->cpu_transcoder;
>  
> + if (intel_crtc_is_joiner_secondary(old_crtc_state))
> + return;
> +
>   if (!old_crtc_state->vrr.enable)
>   return;
>  
> -- 
> 2.45.2

-- 
Ville Syrjälä
Intel


Re: [PATCH v3 77/81] drm/msm: Run DRM default client setup

2024-09-03 Thread Dmitry Baryshkov
On Fri, 30 Aug 2024 at 11:45, Thomas Zimmermann  wrote:
>
> Rework fbdev probing to support fbdev_probe in struct drm_driver
> and remove the old fb_probe callback. Provide an initializer macro
> for struct drm_driver that sets the callback according to the kernel
> configuration.
>
> Call drm_client_setup() to run the kernel's default client setup
> for DRM. Set fbdev_probe in struct drm_driver, so that the client
> setup can start the common fbdev client.
>
> The msm driver specifies a preferred color mode of 32. As this
> is the default if no format has been given, leave it out entirely.
>
> Signed-off-by: Thomas Zimmermann 
> Cc: Rob Clark 
> Cc: Abhinav Kumar 
> Cc: Dmitry Baryshkov 
> Cc: Sean Paul 
> Cc: Marijn Suijten 
> ---
>  drivers/gpu/drm/msm/msm_drv.c   |   4 +-
>  drivers/gpu/drm/msm/msm_drv.h   |  13 ++-
>  drivers/gpu/drm/msm/msm_fbdev.c | 144 ++--
>  3 files changed, 38 insertions(+), 123 deletions(-)
>

Reviewed-by: Dmitry Baryshkov 

-- 
With best wishes
Dmitry


Re: [PATCH 12/13] drm/i915/vrr: Always use VRR timing generator for XELPD+

2024-09-03 Thread Ville Syrjälä
On Mon, Sep 02, 2024 at 01:36:33PM +0530, Ankit Nautiyal wrote:
> Currently VRR timing generator is used only when VRR is enabled by
> userspace. From XELPD+, gradually move away from older timing
> generator and use VRR timing generator for fixed refresh rate also.
> In such a case, Flipline VMin and VMax all are set to the Vtotal of the
> mode, which effectively makes the VRR timing generator work in
> fixed refresh rate mode.
> 
> v2: Use VRR Timing Generator from XELPD+ instead of MTL as it needs
> Wa_14015406119.
> v3: Set vrr.fixed during vrr_get_config (Mitul)
> v4: Avoid setting vrr.fixed when vrr.cmrr is enabled.
> 
> Signed-off-by: Ankit Nautiyal 
> ---
>  drivers/gpu/drm/i915/display/intel_vrr.c | 61 +++-
>  1 file changed, 39 insertions(+), 22 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_vrr.c 
> b/drivers/gpu/drm/i915/display/intel_vrr.c
> index e01d4b4b8fa7..625728aff5a2 100644
> --- a/drivers/gpu/drm/i915/display/intel_vrr.c
> +++ b/drivers/gpu/drm/i915/display/intel_vrr.c
> @@ -172,41 +172,54 @@ intel_vrr_compute_config(struct intel_crtc_state 
> *crtc_state,
>   if (adjusted_mode->flags & DRM_MODE_FLAG_INTERLACE)
>   return;
>  
> - crtc_state->vrr.in_range =
> - intel_vrr_is_in_range(connector, 
> drm_mode_vrefresh(adjusted_mode));
> - if (!crtc_state->vrr.in_range)
> - return;
> -
>   if (HAS_LRR(display))
>   crtc_state->update_lrr = true;

We aren't supposed to do a LRR update unless the refresh rates are
within the VRR range. So this needs to be moved as well.

>  
> - vmin = DIV_ROUND_UP(adjusted_mode->crtc_clock * 1000,
> - adjusted_mode->crtc_htotal * 
> info->monitor_range.max_vfreq);
> - vmax = adjusted_mode->crtc_clock * 1000 /
> - (adjusted_mode->crtc_htotal * info->monitor_range.min_vfreq);
> + if (!crtc_state->uapi.vrr_enabled && DISPLAY_VER(display) >= 20) {
> + /*
> +  * for XELPD+ always go for VRR timing generator even for
> +  * fixed refresh rate.
> +  */
> + crtc_state->vrr.vmin = adjusted_mode->crtc_vtotal;
> + crtc_state->vrr.vmax = adjusted_mode->crtc_vtotal;
> + crtc_state->vrr.flipline = adjusted_mode->crtc_vtotal;

Has the "flipline can't be below vmin+1" issue been changed in the hardware?

> + crtc_state->vrr.fixed_rr = true;
> + } else {
> + crtc_state->vrr.in_range =
> + intel_vrr_is_in_range(connector, 
> drm_mode_vrefresh(adjusted_mode));
>  
> - vmin = max_t(int, vmin, adjusted_mode->crtc_vtotal);
> - vmax = max_t(int, vmax, adjusted_mode->crtc_vtotal);
> + if (!crtc_state->vrr.in_range)
> + return;
>  
> - if (vmin >= vmax)
> - return;
> + vmin = DIV_ROUND_UP(adjusted_mode->crtc_clock * 1000,
> + adjusted_mode->crtc_htotal * 
> info->monitor_range.max_vfreq);
> + vmax = adjusted_mode->crtc_clock * 1000 /
> + (adjusted_mode->crtc_htotal * 
> info->monitor_range.min_vfreq);
>  
> - /*
> -  * flipline determines the min vblank length the hardware will
> -  * generate, and flipline>=vmin+1, hence we reduce vmin by one
> -  * to make sure we can get the actual min vblank length.
> -  */
> - crtc_state->vrr.vmin = vmin - 1;
> - crtc_state->vrr.vmax = vmax;
> + vmin = max_t(int, vmin, adjusted_mode->crtc_vtotal);
> + vmax = max_t(int, vmax, adjusted_mode->crtc_vtotal);
> +
> + if (vmin >= vmax)
> + return;
> +
> + /*
> +  * flipline determines the min vblank length the hardware will
> +  * generate, and flipline>=vmin+1, hence we reduce vmin by one
> +  * to make sure we can get the actual min vblank length.
> +  */
> + crtc_state->vrr.vmin = vmin - 1;
> + crtc_state->vrr.vmax = vmax;
>  
> - crtc_state->vrr.flipline = crtc_state->vrr.vmin + 1;
> + crtc_state->vrr.flipline = crtc_state->vrr.vmin + 1;
> + crtc_state->vrr.fixed_rr = false;
> + }
>  
>   /*
>* When panel is VRR capable and userspace has
>* not enabled adaptive sync mode then Fixed Average
>* Vtotal mode should be enabled.
>*/
> - if (crtc_state->uapi.vrr_enabled) {
> + if (crtc_state->uapi.vrr_enabled || crtc_state->vrr.fixed_rr) {
>   crtc_state->vrr.enable = true;
>   crtc_state->mode_flags |= I915_MODE_FLAG_VRR;

Hmm. This is now a bit of a mess. We need to come up with a sane way to
deal with the vblank timestamping code. Dunno if we want to make it so
that we'd always use VRR timings or the non-VRR timings. Should be
identical from HW POV so technically might not matter, apart from the
software state tracking POV. And fro

RE: [PATCH] drm: Ensure Proper Unload/Reload Order of MEI Modules for i915/Xe Driver

2024-09-03 Thread Bommu, Krishnaiah
++ intel-gfx@lists.freedesktop.org

> -Original Message-
> From: Kamil Konieczny 
> Sent: Tuesday, September 3, 2024 5:38 PM
> To: intel...@lists.freedesktop.org
> Cc: Bommu, Krishnaiah ; Ceraolo Spurio,
> Daniele ; De Marchi, Lucas
> 
> Subject: Re: [PATCH] drm: Ensure Proper Unload/Reload Order of MEI Modules
> for i915/Xe Driver
> 
> Hi Bommu,
> On 2024-09-02 at 19:40:41 +0530, Bommu Krishnaiah wrote:
> > This update addresses the unload/reload sequence of MEI modules in
> > relation to the i915/Xe graphics driver. On platforms where the MEI
> > hardware is integrated with the graphics device (e.g., DG2/BMG), the
> > MEI modules depend on the i915/Xe driver. Conversely, on newer
> > platforms like CLS, where the MEI hardware is separate, this dependency does
> not exist.
> >
> > The changes introduced ensure that MEI modules are unloaded and
> > reloaded in the correct order based on platform-specific dependencies.
> > This is achieved by adding a MODULE_SOFTDEP directive to the i915 and Xe
> module code.
> >
> > These changes enhance the robustness of MEI module handling across
> > different hardware platforms, ensuring that the i915/Xe driver can be
> > cleanly unloaded and reloaded without issues.
> >
> > Signed-off-by: Bommu Krishnaiah 
> > Cc: Kamil Konieczny 
> > Cc: Daniele Ceraolo Spurio 
> > Cc: Lucas De Marchi 
> > ---
> >  drivers/gpu/drm/i915/i915_module.c | 2 ++
> 
> imho as you touch i915 driver you should also Cc to intel-
> g...@lists.freedesktop.org
> 
> Regards,
> Kamil
> 
> >  drivers/gpu/drm/xe/xe_module.c | 2 ++
> >  2 files changed, 4 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_module.c
> > b/drivers/gpu/drm/i915/i915_module.c
> > index 65acd7bf75d0..2ad079ad35db 100644
> > --- a/drivers/gpu/drm/i915/i915_module.c
> > +++ b/drivers/gpu/drm/i915/i915_module.c
> > @@ -75,6 +75,8 @@ static const struct {  };  static int init_progress;
> >
> > +MODULE_SOFTDEP("pre: mei_gsc_proxy mei_gsc");
> > +
> >  static int __init i915_init(void)
> >  {
> > int err, i;
> > diff --git a/drivers/gpu/drm/xe/xe_module.c
> > b/drivers/gpu/drm/xe/xe_module.c index bfc3deebdaa2..5633ea1841b7
> > 100644
> > --- a/drivers/gpu/drm/xe/xe_module.c
> > +++ b/drivers/gpu/drm/xe/xe_module.c
> > @@ -127,6 +127,8 @@ static void xe_call_exit_func(unsigned int i)
> > init_funcs[i].exit();
> >  }
> >
> > +MODULE_SOFTDEP("pre: mei_gsc_proxy mei_gsc");
> > +
> >  static int __init xe_init(void)
> >  {
> > int err, i;
> > --
> > 2.25.1
> >


Re: i915 | Bug in virtual PCH detection

2024-09-03 Thread Ville Syrjälä
On Sun, Sep 01, 2024 at 02:56:07PM +0500, Andrey Toloknev wrote:
> Hello!
> 
> I have 2 machines with Comet Lake CPUs on Tiger Lake PCH (500 series of
> Intel chipsets).
> For that configuration there was a patch for adding support for Tiger Lake
> PCH with CometLake CPU in 2021 -
> https://patchwork.freedesktop.org/patch/412664/
> This patch made possible correct detection of such chipset and cpu
> configuration for i915 kernel module. Without it there was no output to any
> display (HDMI/DP/DVI, even VGA).
> 
> But this patch doesn't touch intel_virt_detect_pch method, when you
> passthrough iGPU to a virtual machine.
> So, virtual PCH incorrectly detects as Cannon Lake and you have no output
> to a physical display with i915 driver:
> 
> [2.933139] i915 :00:02.0: [drm:intel_virt_detect_pch [i915]]
> Assuming PCH ID a300
> [2.933308] i915 :00:02.0: [drm:intel_pch_type [i915]] Found Cannon
> Lake PCH (CNP)
> 
> 
> The bug is on line 173 in drivers/gpu/drm/i915/soc/intel_pch.c in method
> intel_virt_detect_pch:
> 
> else if (IS_TIGERLAKE(dev_priv) || IS_ROCKETLAKE(dev_priv))
> 
> id = INTEL_PCH_TGP_DEVICE_ID_TYPE;
> 
> It must be:
> 
> else if (IS_TIGERLAKE(dev_priv) || IS_ROCKETLAKE(dev_priv) ||
> IS_GEN9_BC(dev_priv))
> 
> id = INTEL_PCH_TGP_DEVICE_ID_TYPE;
> 
> 
> After that small change you get correct detection of PCH and have output to
> a physical display in VM with passthrough iGPU:
> 
> [   16.139809] i915 :00:02.0: [drm:intel_virt_detect_pch [i915]]
> Assuming PCH ID a080
> [   16.261151] i915 :00:02.0: [drm:intel_pch_type [i915]] Found Tiger
> Lake LP PCH
> 
> 
> All kernel versions in any distro since 2021 are affected by this small bug.
> The patch for i915 module of the actual kernel version is in attachment.

You fix one CPU+PCH combo, but break the other. I don't think there is
any way to handle this mess in intel_virt_detect_pch(). The best thing
would be if the virtual machine would advertise the correct ISA/LPC
bridge, then the heiristic is not even invoked. If that's not possible
for some reason then I suppose we'd need a modparam/etc. so the user
can specify the PCH ID by hand.

-- 
Ville Syrjälä
Intel


[PATCH 0/4] drm/i915/display: add snapshot capture/print infra

2024-09-03 Thread Jani Nikula
Add display capture/print infra to abstract it from i915 gpu error state
capture, and prepare for perhaps bolting it into xe devcoredump in the
future.

BR,
Jani.


Jani Nikula (4):
  drm/i915: dump display parameters captured in error state, not current
  drm/i915/display: add intel_display_snapshot abstraction
  drm/i915/display: move device info and params handling to snapshot
  drm/i915/display: move dmc snapshotting to new display snapshot

 drivers/gpu/drm/i915/Makefile |  1 +
 .../drm/i915/display/intel_display_params.c   |  8 ++-
 .../drm/i915/display/intel_display_params.h   |  5 +-
 .../drm/i915/display/intel_display_snapshot.c | 72 +++
 .../drm/i915/display/intel_display_snapshot.h | 16 +
 drivers/gpu/drm/i915/display/intel_dmc.c  | 39 +++---
 drivers/gpu/drm/i915/display/intel_dmc.h  |  7 +-
 drivers/gpu/drm/i915/display/intel_overlay.c  | 16 +++--
 drivers/gpu/drm/i915/display/intel_overlay.h  | 19 ++---
 drivers/gpu/drm/i915/i915_debugfs.c   |  2 +-
 drivers/gpu/drm/i915/i915_gpu_error.c | 25 ++-
 drivers/gpu/drm/i915/i915_gpu_error.h | 11 +--
 12 files changed, 162 insertions(+), 59 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/display/intel_display_snapshot.c
 create mode 100644 drivers/gpu/drm/i915/display/intel_display_snapshot.h

-- 
2.39.2



[PATCH 2/4] drm/i915/display: add intel_display_snapshot abstraction

2024-09-03 Thread Jani Nikula
The error state capture still handles display info at a too detailed
level. Start abstracting the whole display snapshot capture and printing
at a higher level. Move overlay to display snapshot first.

Use the same nomenclature and style as in xe devcoredump, in preparation
for perhaps some day bolting the snapshots there as well.

Signed-off-by: Jani Nikula 
---
 drivers/gpu/drm/i915/Makefile |  1 +
 .../drm/i915/display/intel_display_snapshot.c | 42 +++
 .../drm/i915/display/intel_display_snapshot.h | 16 +++
 drivers/gpu/drm/i915/display/intel_overlay.c  | 16 ---
 drivers/gpu/drm/i915/display/intel_overlay.h  | 19 +
 drivers/gpu/drm/i915/i915_gpu_error.c | 12 +++---
 drivers/gpu/drm/i915/i915_gpu_error.h |  6 +--
 7 files changed, 88 insertions(+), 24 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/display/intel_display_snapshot.c
 create mode 100644 drivers/gpu/drm/i915/display/intel_display_snapshot.h

diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
index c63fa2133ccb..9fcd9e09bc0b 100644
--- a/drivers/gpu/drm/i915/Makefile
+++ b/drivers/gpu/drm/i915/Makefile
@@ -242,6 +242,7 @@ i915-y += \
display/intel_display_power_well.o \
display/intel_display_reset.o \
display/intel_display_rps.o \
+   display/intel_display_snapshot.o \
display/intel_display_wa.o \
display/intel_dmc.o \
display/intel_dmc_wl.o \
diff --git a/drivers/gpu/drm/i915/display/intel_display_snapshot.c 
b/drivers/gpu/drm/i915/display/intel_display_snapshot.c
new file mode 100644
index ..78b019dcd41d
--- /dev/null
+++ b/drivers/gpu/drm/i915/display/intel_display_snapshot.c
@@ -0,0 +1,42 @@
+// SPDX-License-Identifier: MIT
+/* Copyright © 2024 Intel Corporation */
+
+#include 
+
+#include "intel_display_snapshot.h"
+#include "intel_overlay.h"
+
+struct intel_display_snapshot {
+   struct intel_overlay_snapshot *overlay;
+};
+
+struct intel_display_snapshot *intel_display_snapshot_capture(struct 
intel_display *display)
+{
+   struct intel_display_snapshot *snapshot;
+
+   snapshot = kzalloc(sizeof(*snapshot), GFP_ATOMIC);
+   if (!snapshot)
+   return NULL;
+
+   snapshot->overlay = intel_overlay_snapshot_capture(display);
+
+   return snapshot;
+}
+
+void intel_display_snapshot_print(const struct intel_display_snapshot 
*snapshot,
+ struct drm_printer *p)
+{
+   if (!snapshot)
+   return;
+
+   intel_overlay_snapshot_print(snapshot->overlay, p);
+}
+
+void intel_display_snapshot_free(struct intel_display_snapshot *snapshot)
+{
+   if (!snapshot)
+   return;
+
+   kfree(snapshot->overlay);
+   kfree(snapshot);
+}
diff --git a/drivers/gpu/drm/i915/display/intel_display_snapshot.h 
b/drivers/gpu/drm/i915/display/intel_display_snapshot.h
new file mode 100644
index ..7ed27cdea644
--- /dev/null
+++ b/drivers/gpu/drm/i915/display/intel_display_snapshot.h
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: MIT */
+/* Copyright © 2024 Intel Corporation */
+
+#ifndef __INTEL_DISPLAY_SNAPSHOT_H__
+#define __INTEL_DISPLAY_SNAPSHOT_H__
+
+struct drm_printer;
+struct intel_display;
+struct intel_display_snapshot;
+
+struct intel_display_snapshot *intel_display_snapshot_capture(struct 
intel_display *display);
+void intel_display_snapshot_print(const struct intel_display_snapshot 
*snapshot,
+ struct drm_printer *p);
+void intel_display_snapshot_free(struct intel_display_snapshot *snapshot);
+
+#endif /* __INTEL_DISPLAY_SNAPSHOT_H__ */
diff --git a/drivers/gpu/drm/i915/display/intel_overlay.c 
b/drivers/gpu/drm/i915/display/intel_overlay.c
index 06b1122ec13e..b89541458765 100644
--- a/drivers/gpu/drm/i915/display/intel_overlay.c
+++ b/drivers/gpu/drm/i915/display/intel_overlay.c
@@ -1457,18 +1457,19 @@ void intel_overlay_cleanup(struct drm_i915_private 
*dev_priv)
 
 #if IS_ENABLED(CONFIG_DRM_I915_CAPTURE_ERROR)
 
-struct intel_overlay_error_state {
+struct intel_overlay_snapshot {
struct overlay_registers regs;
unsigned long base;
u32 dovsta;
u32 isr;
 };
 
-struct intel_overlay_error_state *
-intel_overlay_capture_error_state(struct drm_i915_private *dev_priv)
+struct intel_overlay_snapshot *
+intel_overlay_snapshot_capture(struct intel_display *display)
 {
+   struct drm_i915_private *dev_priv = to_i915(display->drm);
struct intel_overlay *overlay = dev_priv->display.overlay;
-   struct intel_overlay_error_state *error;
+   struct intel_overlay_snapshot *error;
 
if (!overlay || !overlay->active)
return NULL;
@@ -1487,9 +1488,12 @@ intel_overlay_capture_error_state(struct 
drm_i915_private *dev_priv)
 }
 
 void
-intel_overlay_print_error_state(struct drm_printer *p,
-   struct intel_overlay_error_state *error)
+intel_overlay_snapshot_print(cons

[PATCH 3/4] drm/i915/display: move device info and params handling to snapshot

2024-09-03 Thread Jani Nikula
Snapshot display device and runtime info as well as display parameters
in display snapshot.

Signed-off-by: Jani Nikula 
---
 .../drm/i915/display/intel_display_snapshot.c | 25 +++
 drivers/gpu/drm/i915/i915_gpu_error.c | 10 
 drivers/gpu/drm/i915/i915_gpu_error.h |  5 
 3 files changed, 25 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display_snapshot.c 
b/drivers/gpu/drm/i915/display/intel_display_snapshot.c
index 78b019dcd41d..a61ff0f81397 100644
--- a/drivers/gpu/drm/i915/display/intel_display_snapshot.c
+++ b/drivers/gpu/drm/i915/display/intel_display_snapshot.c
@@ -3,10 +3,18 @@
 
 #include 
 
+#include "i915_drv.h"
+#include "intel_display_device.h"
+#include "intel_display_params.h"
 #include "intel_display_snapshot.h"
 #include "intel_overlay.h"
 
 struct intel_display_snapshot {
+   struct intel_display *display;
+
+   struct intel_display_device_info info;
+   struct intel_display_runtime_info runtime_info;
+   struct intel_display_params params;
struct intel_overlay_snapshot *overlay;
 };
 
@@ -18,6 +26,14 @@ struct intel_display_snapshot 
*intel_display_snapshot_capture(struct intel_displ
if (!snapshot)
return NULL;
 
+   snapshot->display = display;
+
+   memcpy(&snapshot->info, DISPLAY_INFO(display), sizeof(snapshot->info));
+   memcpy(&snapshot->runtime_info, DISPLAY_RUNTIME_INFO(display),
+  sizeof(snapshot->runtime_info));
+
+   intel_display_params_copy(&snapshot->params);
+
snapshot->overlay = intel_overlay_snapshot_capture(display);
 
return snapshot;
@@ -26,9 +42,16 @@ struct intel_display_snapshot 
*intel_display_snapshot_capture(struct intel_displ
 void intel_display_snapshot_print(const struct intel_display_snapshot 
*snapshot,
  struct drm_printer *p)
 {
+   struct intel_display *display;
+
if (!snapshot)
return;
 
+   display = snapshot->display;
+
+   intel_display_device_info_print(&snapshot->info, 
&snapshot->runtime_info, p);
+   intel_display_params_dump(&snapshot->params, 
display->drm->driver->name, p);
+
intel_overlay_snapshot_print(snapshot->overlay, p);
 }
 
@@ -37,6 +60,8 @@ void intel_display_snapshot_free(struct 
intel_display_snapshot *snapshot)
if (!snapshot)
return;
 
+   intel_display_params_free(&snapshot->params);
+
kfree(snapshot->overlay);
kfree(snapshot);
 }
diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c 
b/drivers/gpu/drm/i915/i915_gpu_error.c
index b047b24a90d5..15d57206b281 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.c
+++ b/drivers/gpu/drm/i915/i915_gpu_error.c
@@ -651,8 +651,6 @@ static void err_print_capabilities(struct 
drm_i915_error_state_buf *m,
struct drm_printer p = i915_error_printer(m);
 
intel_device_info_print(&error->device_info, &error->runtime_info, &p);
-   intel_display_device_info_print(&error->display_device_info,
-   &error->display_runtime_info, &p);
intel_driver_caps_print(&error->driver_caps, &p);
 }
 
@@ -660,10 +658,8 @@ static void err_print_params(struct 
drm_i915_error_state_buf *m,
 const struct i915_params *params)
 {
struct drm_printer p = i915_error_printer(m);
-   struct intel_display *display = &m->i915->display;
 
i915_params_dump(params, &p);
-   intel_display_params_dump(&display->params, display->drm->driver->name, 
&p);
 }
 
 static void err_print_pciid(struct drm_i915_error_state_buf *m,
@@ -1031,7 +1027,6 @@ static void i915_vma_coredump_free(struct 
i915_vma_coredump *vma)
 static void cleanup_params(struct i915_gpu_coredump *error)
 {
i915_params_free(&error->params);
-   intel_display_params_free(&error->display_params);
 }
 
 static void cleanup_uc(struct intel_uc_coredump *uc)
@@ -1992,17 +1987,12 @@ static void capture_gen(struct i915_gpu_coredump *error)
error->suspend_count = i915->suspend_count;
 
i915_params_copy(&error->params, &i915->params);
-   intel_display_params_copy(&error->display_params);
memcpy(&error->device_info,
   INTEL_INFO(i915),
   sizeof(error->device_info));
memcpy(&error->runtime_info,
   RUNTIME_INFO(i915),
   sizeof(error->runtime_info));
-   memcpy(&error->display_device_info, DISPLAY_INFO(i915),
-  sizeof(error->display_device_info));
-   memcpy(&error->display_runtime_info, DISPLAY_RUNTIME_INFO(i915),
-  sizeof(error->display_runtime_info));
error->driver_caps = i915->caps;
 }
 
diff --git a/drivers/gpu/drm/i915/i915_gpu_error.h 
b/drivers/gpu/drm/i915/i915_gpu_error.h
index 1a11942d7800..78a8928562a9 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.h
+++ b/drivers/gpu/drm/i915/i915_gpu_error.h
@@ -14,8 +14,6 @@
 
 #include 
 
-#inclu

[PATCH 4/4] drm/i915/display: move dmc snapshotting to new display snapshot

2024-09-03 Thread Jani Nikula
Convert dmc error state printing to new snapshot capture/print division.

Signed-off-by: Jani Nikula 
---
 .../drm/i915/display/intel_display_snapshot.c |  5 +++
 drivers/gpu/drm/i915/display/intel_dmc.c  | 39 +++
 drivers/gpu/drm/i915/display/intel_dmc.h  |  7 +++-
 drivers/gpu/drm/i915/i915_gpu_error.c |  3 --
 4 files changed, 41 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display_snapshot.c 
b/drivers/gpu/drm/i915/display/intel_display_snapshot.c
index a61ff0f81397..030c4f873da1 100644
--- a/drivers/gpu/drm/i915/display/intel_display_snapshot.c
+++ b/drivers/gpu/drm/i915/display/intel_display_snapshot.c
@@ -7,6 +7,7 @@
 #include "intel_display_device.h"
 #include "intel_display_params.h"
 #include "intel_display_snapshot.h"
+#include "intel_dmc.h"
 #include "intel_overlay.h"
 
 struct intel_display_snapshot {
@@ -16,6 +17,7 @@ struct intel_display_snapshot {
struct intel_display_runtime_info runtime_info;
struct intel_display_params params;
struct intel_overlay_snapshot *overlay;
+   struct intel_dmc_snapshot *dmc;
 };
 
 struct intel_display_snapshot *intel_display_snapshot_capture(struct 
intel_display *display)
@@ -35,6 +37,7 @@ struct intel_display_snapshot 
*intel_display_snapshot_capture(struct intel_displ
intel_display_params_copy(&snapshot->params);
 
snapshot->overlay = intel_overlay_snapshot_capture(display);
+   snapshot->dmc = intel_dmc_snapshot_capture(display);
 
return snapshot;
 }
@@ -53,6 +56,7 @@ void intel_display_snapshot_print(const struct 
intel_display_snapshot *snapshot,
intel_display_params_dump(&snapshot->params, 
display->drm->driver->name, p);
 
intel_overlay_snapshot_print(snapshot->overlay, p);
+   intel_dmc_snapshot_print(snapshot->dmc, p);
 }
 
 void intel_display_snapshot_free(struct intel_display_snapshot *snapshot)
@@ -63,5 +67,6 @@ void intel_display_snapshot_free(struct 
intel_display_snapshot *snapshot)
intel_display_params_free(&snapshot->params);
 
kfree(snapshot->overlay);
+   kfree(snapshot->dmc);
kfree(snapshot);
 }
diff --git a/drivers/gpu/drm/i915/display/intel_dmc.c 
b/drivers/gpu/drm/i915/display/intel_dmc.c
index 7c756d5ba2a2..d2f9684c8b0e 100644
--- a/drivers/gpu/drm/i915/display/intel_dmc.c
+++ b/drivers/gpu/drm/i915/display/intel_dmc.c
@@ -1184,21 +1184,44 @@ void intel_dmc_fini(struct drm_i915_private *i915)
}
 }
 
-void intel_dmc_print_error_state(struct drm_printer *p,
-struct drm_i915_private *i915)
+struct intel_dmc_snapshot {
+   bool initialized;
+   bool loaded;
+   u32 version;
+};
+
+struct intel_dmc_snapshot *intel_dmc_snapshot_capture(struct intel_display 
*display)
 {
+   struct drm_i915_private *i915 = to_i915(display->drm);
struct intel_dmc *dmc = i915_to_dmc(i915);
+   struct intel_dmc_snapshot *snapshot;
 
if (!HAS_DMC(i915))
-   return;
+   return NULL;
 
-   drm_printf(p, "DMC initialized: %s\n", str_yes_no(dmc));
-   drm_printf(p, "DMC loaded: %s\n",
-  str_yes_no(intel_dmc_has_payload(i915)));
+   snapshot = kzalloc(sizeof(*snapshot), GFP_ATOMIC);
+   if (!snapshot)
+   return NULL;
+
+   snapshot->initialized = dmc;
+   snapshot->loaded = intel_dmc_has_payload(i915);
if (dmc)
+   snapshot->version = dmc->version;
+
+   return snapshot;
+}
+
+void intel_dmc_snapshot_print(const struct intel_dmc_snapshot *snapshot, 
struct drm_printer *p)
+{
+   if (!snapshot)
+   return;
+
+   drm_printf(p, "DMC initialized: %s\n", 
str_yes_no(snapshot->initialized));
+   drm_printf(p, "DMC loaded: %s\n", str_yes_no(snapshot->loaded));
+   if (snapshot->initialized)
drm_printf(p, "DMC fw version: %d.%d\n",
-  DMC_VERSION_MAJOR(dmc->version),
-  DMC_VERSION_MINOR(dmc->version));
+  DMC_VERSION_MAJOR(snapshot->version),
+  DMC_VERSION_MINOR(snapshot->version));
 }
 
 static int intel_dmc_debugfs_status_show(struct seq_file *m, void *unused)
diff --git a/drivers/gpu/drm/i915/display/intel_dmc.h 
b/drivers/gpu/drm/i915/display/intel_dmc.h
index 54cff6002e31..e2186c900505 100644
--- a/drivers/gpu/drm/i915/display/intel_dmc.h
+++ b/drivers/gpu/drm/i915/display/intel_dmc.h
@@ -11,6 +11,8 @@
 enum pipe;
 struct drm_i915_private;
 struct drm_printer;
+struct intel_display;
+struct intel_dmc_snapshot;
 
 void intel_dmc_init(struct drm_i915_private *i915);
 void intel_dmc_load_program(struct drm_i915_private *i915);
@@ -22,8 +24,9 @@ void intel_dmc_suspend(struct drm_i915_private *i915);
 void intel_dmc_resume(struct drm_i915_private *i915);
 bool intel_dmc_has_payload(struct drm_i915_private *i915);
 void intel_dmc_debugfs_register(struct drm_i915_private *i915);
-void intel_dmc_

[PATCH 1/4] drm/i915: dump display parameters captured in error state, not current

2024-09-03 Thread Jani Nikula
intel_display_params_dump() prints the current display parameters, not
the ones captured during error capture. It's not likely the params get
changed in between, but make it pedantically correct anyway. Pass in the
parameters and driver name to intel_display_params_dump().

Signed-off-by: Jani Nikula 
---
 drivers/gpu/drm/i915/display/intel_display_params.c | 8 +---
 drivers/gpu/drm/i915/display/intel_display_params.h | 5 ++---
 drivers/gpu/drm/i915/i915_debugfs.c | 2 +-
 drivers/gpu/drm/i915/i915_gpu_error.c   | 2 +-
 4 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display_params.c 
b/drivers/gpu/drm/i915/display/intel_display_params.c
index 1a45d300b6f0..024de8abcb1a 100644
--- a/drivers/gpu/drm/i915/display/intel_display_params.c
+++ b/drivers/gpu/drm/i915/display/intel_display_params.c
@@ -173,14 +173,16 @@ static void _param_print_charp(struct drm_printer *p, 
const char *driver_name,
 
 /**
  * intel_display_params_dump - dump intel display modparams
- * @display: display device
+ * @params: display params
+ * @driver_name: driver name to use for printing
  * @p: the &drm_printer
  *
  * Pretty printer for i915 modparams.
  */
-void intel_display_params_dump(struct intel_display *display, struct 
drm_printer *p)
+void intel_display_params_dump(const struct intel_display_params *params,
+  const char *driver_name, struct drm_printer *p)
 {
-#define PRINT(T, x, ...) _param_print(p, display->drm->driver->name, #x, 
display->params.x);
+#define PRINT(T, x, ...) _param_print(p, driver_name, #x, params->x);
INTEL_DISPLAY_PARAMS_FOR_EACH(PRINT);
 #undef PRINT
 }
diff --git a/drivers/gpu/drm/i915/display/intel_display_params.h 
b/drivers/gpu/drm/i915/display/intel_display_params.h
index da8dc943234b..dcb6face936a 100644
--- a/drivers/gpu/drm/i915/display/intel_display_params.h
+++ b/drivers/gpu/drm/i915/display/intel_display_params.h
@@ -9,7 +9,6 @@
 #include 
 
 struct drm_printer;
-struct intel_display;
 
 /*
  * Invoke param, a function-like macro, for each intel display param, with
@@ -56,8 +55,8 @@ struct intel_display_params {
 };
 #undef MEMBER
 
-void intel_display_params_dump(struct intel_display *display,
-  struct drm_printer *p);
+void intel_display_params_dump(const struct intel_display_params *params,
+  const char *driver_name, struct drm_printer *p);
 void intel_display_params_copy(struct intel_display_params *dest);
 void intel_display_params_free(struct intel_display_params *params);
 
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c 
b/drivers/gpu/drm/i915/i915_debugfs.c
index f969f585d07b..246fece628d6 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -78,7 +78,7 @@ static int i915_capabilities(struct seq_file *m, void *data)
 
kernel_param_lock(THIS_MODULE);
i915_params_dump(&i915->params, &p);
-   intel_display_params_dump(display, &p);
+   intel_display_params_dump(&display->params, display->drm->driver->name, 
&p);
kernel_param_unlock(THIS_MODULE);
 
return 0;
diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c 
b/drivers/gpu/drm/i915/i915_gpu_error.c
index 6469b9bcf2ec..f23769ccf050 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.c
+++ b/drivers/gpu/drm/i915/i915_gpu_error.c
@@ -663,7 +663,7 @@ static void err_print_params(struct 
drm_i915_error_state_buf *m,
struct intel_display *display = &m->i915->display;
 
i915_params_dump(params, &p);
-   intel_display_params_dump(display, &p);
+   intel_display_params_dump(&display->params, display->drm->driver->name, 
&p);
 }
 
 static void err_print_pciid(struct drm_i915_error_state_buf *m,
-- 
2.39.2



Re: [PATCH 07/11] drm/i915/pps: pass intel_dp to pps_name()

2024-09-03 Thread Jani Nikula
On Tue, 03 Sep 2024, Ville Syrjälä  wrote:
> On Fri, Aug 30, 2024 at 01:15:44PM +0300, Jani Nikula wrote:
>> Currently all of intel_pps.c passes struct intel_dp around. Do the same
>> with pps_name() instead of passing both struct drm_i915_private and
>> struct intel_pps.
>> 
>> Signed-off-by: Jani Nikula 
>> ---
>>  drivers/gpu/drm/i915/display/intel_pps.c | 61 +---
>>  1 file changed, 32 insertions(+), 29 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/display/intel_pps.c 
>> b/drivers/gpu/drm/i915/display/intel_pps.c
>> index 68141af4da54..1e87ce95c85d 100644
>> --- a/drivers/gpu/drm/i915/display/intel_pps.c
>> +++ b/drivers/gpu/drm/i915/display/intel_pps.c
>> @@ -24,9 +24,12 @@ static void vlv_steal_power_sequencer(struct 
>> drm_i915_private *dev_priv,
>>  static void pps_init_delays(struct intel_dp *intel_dp);
>>  static void pps_init_registers(struct intel_dp *intel_dp, bool 
>> force_disable_vdd);
>>  
>> -static const char *pps_name(struct drm_i915_private *i915,
>> -struct intel_pps *pps)
>> +static const char *pps_name(struct intel_dp *intel_dp)
>>  {
>> +struct intel_display *display = to_intel_display(intel_dp);
>> +struct drm_i915_private *i915 = to_i915(display->drm);
>> +struct intel_pps *pps = &intel_dp->pps;
>> +
>
> I've been thinking that we'd eventually turn intel_pps into some kind of
> proper object with a 1:1 relationship to the corresponding hw block.
> This is sort of going in the opposite direction, but looks trivial
> enough to deal with if/when we get to reworking intel_pps.

Right. I think there are more problematic cases than this one.

> Series is
> Reviewed-by: Ville Syrjälä 

Thanks, appreciated. Pushed the lot to drm-intel-next.

BR,
Jani.

-- 
Jani Nikula, Intel


[PULL] drm-intel-next

2024-09-03 Thread Rodrigo Vivi
Hi Dave and Sima,

We'd like to include this extra display clean-up
towards the 6.12. Hence this extra pull-request on top
of what I declared as our last one last week.

It only delayed because it touches both Xe and i915 and
it depended on xe changes that propagated through drm-xe-next
last week + backmerge after that.

Thanks,
Rodrigo.

drm-intel-next-2024-09-03:
- Fix probe on 'nomodeset and deprecate i915.modeset=0 (Jani)
- Update new entries in VBT BDB block definitions (Dnyaneshwar)
- Fix clang build (Andy Shevchenko)
- More clean up on drvdata usage in display code (Jani)
- Increase fastwake DP sync pulse count as a quirk (Jouni)
The following changes since commit 6d0ebb3904853d18eeec7af5e8b4ca351b6f9025:

  Merge tag 'drm-intel-next-2024-08-29' of 
https://gitlab.freedesktop.org/drm/i915/kernel into drm-next (2024-08-30 
13:41:32 +1000)

are available in the Git repository at:

  https://gitlab.freedesktop.org/drm/i915/kernel.git 
tags/drm-intel-next-2024-09-03

for you to fetch changes up to 963ed4efe0c6416f5a2f61e107ee3a27f0bb757d:

  drm/i915/dp: hide dp_to_i915() inside intel_dp.c (2024-09-03 17:11:25 +0300)


- Fix probe on 'nomodeset and deprecate i915.modeset=0 (Jani)
- Update new entries in VBT BDB block definitions (Dnyaneshwar)
- Fix clang build (Andy Shevchenko)
- More clean up on drvdata usage in display code (Jani)
- Increase fastwake DP sync pulse count as a quirk (Jouni)


Andy Shevchenko (2):
  drm/i915/fence: Mark debug_fence_init_onstack() with __maybe_unused
  drm/i915/fence: Mark debug_fence_free() with __maybe_unused

Dnyaneshwar Bhadane (1):
  drm/i915/bios: Update new entries in VBT BDB block definitions

Jani Nikula (19):
  drm/i915: fail module probe on nomodeset and i915.modeset=0
  drm/i915: deprecate the i915.modeset module parameter
  drm/i915 & drm/xe: save struct drm_device to drvdata
  drm/i915: support struct device and pci_dev in to_intel_display()
  drm/i915/audio: migrate away from kdev_to_i915()
  drm/i915/hdcp: migrate away from kdev_to_i915() in bind/unbind
  drm/i915/hdcp: migrate away from kdev_to_i915() in GSC messaging
  drm/xe/display: remove unused compat kdev_to_i915() and pdev_to_i915()
  drm/xe/display: use xe && 0 to avoid warnings about unused variables
  drm/i915/hdmi: convert to struct intel_display
  drm/i915/dp: convert g4x_dp.[ch] to struct intel_display
  drm/i915/dp: convert intel_dp_tunnel.[ch] to struct intel_display
  drm/i915/dp: convert intel_dp_aux.[ch] to struct intel_display
  drm/i915/dp: convert intel_dp_link_training.[ch] to struct intel_display
  drm/i915/pps: pass intel_dp to pps_name()
  drm/i915/pps: convert intel_pps.[ch] to struct intel_display
  drm/i915/psr: convert intel_psr.[ch] to struct intel_display
  drm/i915/ddi: stop using dp_to_i915()
  drm/i915/dp: hide dp_to_i915() inside intel_dp.c

Jouni Högander (2):
  drm/i915/display: Add mechanism to use sink model when applying quirk
  drm/i915/display: Increase Fast Wake Sync length as a quirk

Rodrigo Vivi (1):
  Merge drm/drm-next into drm-intel-next

 drivers/gpu/drm/i915/display/g4x_dp.c  | 152 ++--
 drivers/gpu/drm/i915/display/intel_alpm.c  |   2 +-
 drivers/gpu/drm/i915/display/intel_audio.c |  34 +-
 drivers/gpu/drm/i915/display/intel_ddi.c   |  14 +-
 drivers/gpu/drm/i915/display/intel_display.c   |   2 +-
 .../gpu/drm/i915/display/intel_display_debugfs.c   |   2 +-
 .../gpu/drm/i915/display/intel_display_driver.c|   8 +-
 drivers/gpu/drm/i915/display/intel_display_irq.c   |  13 +-
 .../drm/i915/display/intel_display_power_well.c|  15 +-
 drivers/gpu/drm/i915/display/intel_display_reset.c |   7 +-
 drivers/gpu/drm/i915/display/intel_display_types.h |  14 +-
 drivers/gpu/drm/i915/display/intel_dp.c|   6 +
 drivers/gpu/drm/i915/display/intel_dp_aux.c| 130 ++--
 drivers/gpu/drm/i915/display/intel_dp_aux.h|   6 +-
 .../gpu/drm/i915/display/intel_dp_link_training.c  | 105 +--
 drivers/gpu/drm/i915/display/intel_dp_tunnel.c |  77 +-
 drivers/gpu/drm/i915/display/intel_dp_tunnel.h |  11 +-
 drivers/gpu/drm/i915/display/intel_dpll.c  |   9 +-
 drivers/gpu/drm/i915/display/intel_frontbuffer.c   |   7 +-
 drivers/gpu/drm/i915/display/intel_hdcp.c  |  10 +-
 .../gpu/drm/i915/display/intel_hdcp_gsc_message.c  |  67 +-
 drivers/gpu/drm/i915/display/intel_hdmi.c  | 500 ++--
 drivers/gpu/drm/i915/display/intel_hdmi.h  |   1 -
 drivers/gpu/drm/i915/display/intel_hotplug_irq.c   |   6 +-
 drivers/gpu/drm/i915/display/intel_pch_display.c   |   3 +-
 drivers/gpu/drm/i915/display/intel_pps.c   | 563 +++---
 drivers/gpu/drm/i915/display/intel_pps.h   |  10 +-
 drivers/gpu/drm/i915/display/intel_psr.c   | 84

✓ Fi.CI.BAT: success for drm/i915/gt: Make use of __assign_bit() API

2024-09-03 Thread Patchwork
== Series Details ==

Series: drm/i915/gt: Make use of __assign_bit() API
URL   : https://patchwork.freedesktop.org/series/138141/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_15351 -> Patchwork_138141v1


Summary
---

  **SUCCESS**

  No regressions found.

  External URL: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138141v1/index.html

Participating hosts (39 -> 37)
--

  Additional (1): fi-kbl-8809g 
  Missing(3): bat-dg2-11 bat-arlh-3 fi-snb-2520m 

Known issues


  Here are the changes found in Patchwork_138141v1 that come from known issues:

### IGT changes ###

 Issues hit 

  * igt@fbdev@read:
- bat-arls-1: [PASS][1] -> [DMESG-WARN][2] ([i915#12102])
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15351/bat-arls-1/igt@fb...@read.html
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138141v1/bat-arls-1/igt@fb...@read.html

  * igt@gem_huc_copy@huc-copy:
- fi-kbl-8809g:   NOTRUN -> [SKIP][3] ([i915#2190])
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138141v1/fi-kbl-8809g/igt@gem_huc_c...@huc-copy.html

  * igt@gem_lmem_swapping@basic:
- fi-kbl-8809g:   NOTRUN -> [SKIP][4] ([i915#4613]) +3 other tests skip
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138141v1/fi-kbl-8809g/igt@gem_lmem_swapp...@basic.html

  * igt@i915_selftest@live@workarounds:
- bat-arls-2: [PASS][5] -> [ABORT][6] ([i915#12061])
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15351/bat-arls-2/igt@i915_selftest@l...@workarounds.html
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138141v1/bat-arls-2/igt@i915_selftest@l...@workarounds.html
- bat-mtlp-8: [PASS][7] -> [ABORT][8] ([i915#12062])
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15351/bat-mtlp-8/igt@i915_selftest@l...@workarounds.html
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138141v1/bat-mtlp-8/igt@i915_selftest@l...@workarounds.html

  * igt@kms_force_connector_basic@force-load-detect:
- fi-kbl-8809g:   NOTRUN -> [SKIP][9] +30 other tests skip
   [9]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138141v1/fi-kbl-8809g/igt@kms_force_connector_ba...@force-load-detect.html

  
 Possible fixes 

  * igt@fbdev@info:
- bat-arls-1: [DMESG-WARN][10] ([i915#12102]) -> [PASS][11]
   [10]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15351/bat-arls-1/igt@fb...@info.html
   [11]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138141v1/bat-arls-1/igt@fb...@info.html

  
  [i915#12061]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/12061
  [i915#12062]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/12062
  [i915#12102]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/12102
  [i915#2190]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/2190
  [i915#4613]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/4613


Build changes
-

  * Linux: CI_DRM_15351 -> Patchwork_138141v1

  CI-20190529: 20190529
  CI_DRM_15351: 03c3df86be6554d000257704958e586111d08947 @ 
git://anongit.freedesktop.org/gfx-ci/linux
  IGT_8001: d3a77fc98e89cc94b03be2b0903d44f83480b8a0 @ 
https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
  Patchwork_138141v1: 03c3df86be6554d000257704958e586111d08947 @ 
git://anongit.freedesktop.org/gfx-ci/linux

== Logs ==

For more details see: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138141v1/index.html


✓ Fi.CI.BAT: success for drm/i915: Remove extra unlikely helper

2024-09-03 Thread Patchwork
== Series Details ==

Series: drm/i915: Remove extra unlikely helper
URL   : https://patchwork.freedesktop.org/series/138142/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_15351 -> Patchwork_138142v1


Summary
---

  **SUCCESS**

  No regressions found.

  External URL: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138142v1/index.html

Participating hosts (39 -> 39)
--

  Additional (2): bat-kbl-2 bat-mtlp-6 
  Missing(2): bat-arlh-3 fi-snb-2520m 

Known issues


  Here are the changes found in Patchwork_138142v1 that come from known issues:

### IGT changes ###

 Issues hit 

  * igt@debugfs_test@basic-hwmon:
- bat-mtlp-6: NOTRUN -> [SKIP][1] ([i915#9318])
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138142v1/bat-mtlp-6/igt@debugfs_t...@basic-hwmon.html

  * igt@fbdev@info:
- bat-kbl-2:  NOTRUN -> [SKIP][2] ([i915#1849])
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138142v1/bat-kbl-2/igt@fb...@info.html
- bat-mtlp-6: NOTRUN -> [SKIP][3] ([i915#1849] / [i915#2582])
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138142v1/bat-mtlp-6/igt@fb...@info.html

  * igt@fbdev@write:
- bat-arls-1: [PASS][4] -> [FAIL][5] ([i915#12030]) +1 other test 
fail
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15351/bat-arls-1/igt@fb...@write.html
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138142v1/bat-arls-1/igt@fb...@write.html
- bat-mtlp-6: NOTRUN -> [SKIP][6] ([i915#2582]) +3 other tests skip
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138142v1/bat-mtlp-6/igt@fb...@write.html

  * igt@gem_lmem_swapping@parallel-random-engines:
- bat-kbl-2:  NOTRUN -> [SKIP][7] +39 other tests skip
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138142v1/bat-kbl-2/igt@gem_lmem_swapp...@parallel-random-engines.html

  * igt@gem_lmem_swapping@verify-random:
- bat-mtlp-6: NOTRUN -> [SKIP][8] ([i915#4613]) +3 other tests skip
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138142v1/bat-mtlp-6/igt@gem_lmem_swapp...@verify-random.html

  * igt@gem_mmap@basic:
- bat-mtlp-6: NOTRUN -> [SKIP][9] ([i915#4083])
   [9]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138142v1/bat-mtlp-6/igt@gem_m...@basic.html

  * igt@gem_tiled_blits@basic:
- bat-mtlp-6: NOTRUN -> [SKIP][10] ([i915#4077]) +2 other tests skip
   [10]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138142v1/bat-mtlp-6/igt@gem_tiled_bl...@basic.html

  * igt@gem_tiled_pread_basic:
- bat-mtlp-6: NOTRUN -> [SKIP][11] ([i915#4079]) +1 other test skip
   [11]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138142v1/bat-mtlp-6/igt@gem_tiled_pread_basic.html

  * igt@i915_pm_rps@basic-api:
- bat-mtlp-6: NOTRUN -> [SKIP][12] ([i915#11681] / [i915#6621])
   [12]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138142v1/bat-mtlp-6/igt@i915_pm_...@basic-api.html

  * igt@i915_selftest@live@hangcheck:
- bat-arls-2: [PASS][13] -> [DMESG-WARN][14] ([i915#11349])
   [13]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15351/bat-arls-2/igt@i915_selftest@l...@hangcheck.html
   [14]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138142v1/bat-arls-2/igt@i915_selftest@l...@hangcheck.html

  * igt@kms_addfb_basic@addfb25-x-tiled-legacy:
- bat-mtlp-6: NOTRUN -> [SKIP][15] ([i915#4212] / [i915#9792]) +8 
other tests skip
   [15]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138142v1/bat-mtlp-6/igt@kms_addfb_ba...@addfb25-x-tiled-legacy.html

  * igt@kms_addfb_basic@addfb25-y-tiled-small-legacy:
- bat-mtlp-6: NOTRUN -> [SKIP][16] ([i915#5190] / [i915#9792])
   [16]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138142v1/bat-mtlp-6/igt@kms_addfb_ba...@addfb25-y-tiled-small-legacy.html

  * igt@kms_cursor_legacy@basic-flip-after-cursor-legacy:
- bat-mtlp-6: NOTRUN -> [SKIP][17] ([i915#9792]) +17 other tests 
skip
   [17]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138142v1/bat-mtlp-6/igt@kms_cursor_leg...@basic-flip-after-cursor-legacy.html

  * igt@kms_flip@basic-flip-vs-dpms:
- bat-mtlp-6: NOTRUN -> [SKIP][18] ([i915#3637] / [i915#9792]) +3 
other tests skip
   [18]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138142v1/bat-mtlp-6/igt@kms_f...@basic-flip-vs-dpms.html

  * igt@kms_force_connector_basic@prune-stale-modes:
- bat-mtlp-6: NOTRUN -> [SKIP][19] ([i915#5274] / [i915#9792])
   [19]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138142v1/bat-mtlp-6/igt@kms_force_connector_ba...@prune-stale-modes.html

  * igt@kms_frontbuffer_tracking@basic:
- bat-mtlp-6: NOTRUN -> [SKIP][20] ([i915#4342] / [i915#5354] / 
[i915#9792])
   [20]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138142v1/bat-mtlp

✓ Fi.CI.BAT: success for drm/i915: Use memdup_user() helper

2024-09-03 Thread Patchwork
== Series Details ==

Series: drm/i915: Use memdup_user() helper
URL   : https://patchwork.freedesktop.org/series/138143/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_15353 -> Patchwork_138143v1


Summary
---

  **SUCCESS**

  No regressions found.

  External URL: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138143v1/index.html

Participating hosts (41 -> 35)
--

  Missing(6): bat-dg1-7 fi-snb-2520m fi-cfl-8109u fi-kbl-8809g bat-arls-1 
bat-mtlp-6 

Known issues


  Here are the changes found in Patchwork_138143v1 that come from known issues:

### IGT changes ###

 Possible fixes 

  * igt@gem_exec_parallel@engines@basic:
- {bat-arlh-3}:   [INCOMPLETE][1] -> [PASS][2]
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15353/bat-arlh-3/igt@gem_exec_parallel@engi...@basic.html
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138143v1/bat-arlh-3/igt@gem_exec_parallel@engi...@basic.html

  * igt@i915_selftest@live@workarounds:
- bat-dg2-11: [DMESG-FAIL][3] ([i915#9500]) -> [PASS][4]
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15353/bat-dg2-11/igt@i915_selftest@l...@workarounds.html
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138143v1/bat-dg2-11/igt@i915_selftest@l...@workarounds.html
- bat-mtlp-8: [ABORT][5] ([i915#12062]) -> [PASS][6]
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15353/bat-mtlp-8/igt@i915_selftest@l...@workarounds.html
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138143v1/bat-mtlp-8/igt@i915_selftest@l...@workarounds.html

  
  {name}: This element is suppressed. This means it is ignored when computing
  the status of the difference (SUCCESS, WARNING, or FAILURE).

  [i915#10196]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/10196
  [i915#11343]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/11343
  [i915#11346]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/11346
  [i915#11666]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/11666
  [i915#11671]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/11671
  [i915#11681]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/11681
  [i915#11723]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/11723
  [i915#11724]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/11724
  [i915#11725]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/11725
  [i915#11726]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/11726
  [i915#12062]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/12062
  [i915#8809]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/8809
  [i915#9500]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/9500
  [i915#9886]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/9886


Build changes
-

  * Linux: CI_DRM_15353 -> Patchwork_138143v1

  CI-20190529: 20190529
  CI_DRM_15353: 40f1f3d2913934d6a1446bbfeaf6a2fbaffe33a2 @ 
git://anongit.freedesktop.org/gfx-ci/linux
  IGT_8001: d3a77fc98e89cc94b03be2b0903d44f83480b8a0 @ 
https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
  Patchwork_138143v1: 40f1f3d2913934d6a1446bbfeaf6a2fbaffe33a2 @ 
git://anongit.freedesktop.org/gfx-ci/linux

== Logs ==

For more details see: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138143v1/index.html


✗ Fi.CI.CHECKPATCH: warning for drm/i915/display: add snapshot capture/print infra

2024-09-03 Thread Patchwork
== Series Details ==

Series: drm/i915/display: add snapshot capture/print infra
URL   : https://patchwork.freedesktop.org/series/138151/
State : warning

== Summary ==

Error: dim checkpatch failed
f3820671e52e drm/i915: dump display parameters captured in error state, not 
current
-:34: WARNING:MACRO_ARG_UNUSED: Argument 'T' is not used in function-like macro
#34: FILE: drivers/gpu/drm/i915/display/intel_display_params.c:185:
+#define PRINT(T, x, ...) _param_print(p, driver_name, #x, params->x);

-:34: CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'x' may be better as '(x)' to 
avoid precedence issues
#34: FILE: drivers/gpu/drm/i915/display/intel_display_params.c:185:
+#define PRINT(T, x, ...) _param_print(p, driver_name, #x, params->x);

-:34: WARNING:TRAILING_SEMICOLON: macros should not use a trailing semicolon
#34: FILE: drivers/gpu/drm/i915/display/intel_display_params.c:185:
+#define PRINT(T, x, ...) _param_print(p, driver_name, #x, params->x);

total: 0 errors, 2 warnings, 1 checks, 52 lines checked
6365571faddb drm/i915/display: add intel_display_snapshot abstraction
-:28: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does 
MAINTAINERS need updating?
#28: 
new file mode 100644

-:176: CHECK:LINE_SPACING: Please use a blank line after 
function/struct/union/enum declarations
#176: FILE: drivers/gpu/drm/i915/display/intel_overlay.h:54:
 }
+static inline struct intel_overlay_snapshot *

-:183: CHECK:LINE_SPACING: Please use a blank line after 
function/struct/union/enum declarations
#183: FILE: drivers/gpu/drm/i915/display/intel_overlay.h:59:
 }
+static inline void intel_overlay_snapshot_print(const struct 
intel_overlay_snapshot *error,

total: 0 errors, 1 warnings, 2 checks, 207 lines checked
a5cc323f664c drm/i915/display: move device info and params handling to snapshot
cf44129858d1 drm/i915/display: move dmc snapshotting to new display snapshot




✗ Fi.CI.SPARSE: warning for drm/i915/display: add snapshot capture/print infra

2024-09-03 Thread Patchwork
== Series Details ==

Series: drm/i915/display: add snapshot capture/print infra
URL   : https://patchwork.freedesktop.org/series/138151/
State : warning

== Summary ==

Error: dim sparse failed
Sparse version: v0.6.2
Fast mode used, each commit won't be checked separately.




✓ Fi.CI.BAT: success for drm/i915/display: add snapshot capture/print infra

2024-09-03 Thread Patchwork
== Series Details ==

Series: drm/i915/display: add snapshot capture/print infra
URL   : https://patchwork.freedesktop.org/series/138151/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_15353 -> Patchwork_138151v1


Summary
---

  **SUCCESS**

  No regressions found.

  External URL: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138151v1/index.html

Participating hosts (41 -> 35)
--

  Additional (1): fi-bsw-n3050 
  Missing(7): bat-dg1-7 bat-kbl-2 fi-snb-2520m fi-cfl-8109u fi-kbl-8809g 
bat-arls-1 bat-mtlp-6 

Known issues


  Here are the changes found in Patchwork_138151v1 that come from known issues:

### IGT changes ###

 Issues hit 

  * igt@gem_lmem_swapping@random-engines:
- fi-bsw-n3050:   NOTRUN -> [SKIP][1] +19 other tests skip
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138151v1/fi-bsw-n3050/igt@gem_lmem_swapp...@random-engines.html

  
 Possible fixes 

  * igt@gem_exec_parallel@engines@basic:
- {bat-arlh-3}:   [INCOMPLETE][2] -> [PASS][3]
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15353/bat-arlh-3/igt@gem_exec_parallel@engi...@basic.html
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138151v1/bat-arlh-3/igt@gem_exec_parallel@engi...@basic.html

  * igt@i915_selftest@live@workarounds:
- bat-dg2-11: [DMESG-FAIL][4] ([i915#9500]) -> [PASS][5]
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15353/bat-dg2-11/igt@i915_selftest@l...@workarounds.html
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138151v1/bat-dg2-11/igt@i915_selftest@l...@workarounds.html
- bat-mtlp-8: [ABORT][6] ([i915#12062]) -> [PASS][7]
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15353/bat-mtlp-8/igt@i915_selftest@l...@workarounds.html
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138151v1/bat-mtlp-8/igt@i915_selftest@l...@workarounds.html

  
  {name}: This element is suppressed. This means it is ignored when computing
  the status of the difference (SUCCESS, WARNING, or FAILURE).

  [i915#10196]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/10196
  [i915#11343]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/11343
  [i915#11346]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/11346
  [i915#11666]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/11666
  [i915#11671]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/11671
  [i915#11681]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/11681
  [i915#11723]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/11723
  [i915#11724]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/11724
  [i915#11725]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/11725
  [i915#11726]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/11726
  [i915#12062]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/12062
  [i915#8809]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/8809
  [i915#9500]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/9500
  [i915#9886]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/9886


Build changes
-

  * Linux: CI_DRM_15353 -> Patchwork_138151v1

  CI-20190529: 20190529
  CI_DRM_15353: 40f1f3d2913934d6a1446bbfeaf6a2fbaffe33a2 @ 
git://anongit.freedesktop.org/gfx-ci/linux
  IGT_8001: d3a77fc98e89cc94b03be2b0903d44f83480b8a0 @ 
https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
  Patchwork_138151v1: 40f1f3d2913934d6a1446bbfeaf6a2fbaffe33a2 @ 
git://anongit.freedesktop.org/gfx-ci/linux

== Logs ==

For more details see: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138151v1/index.html


Re: [PATCH 3/3] drm/amdgpu: drop redundant W=1 warnings from Makefile

2024-09-03 Thread Hamza Mahfooz

On 5/23/24 09:37, Jani Nikula wrote:

Since commit a61ddb4393ad ("drm: enable (most) W=1 warnings by default
across the subsystem"), most of the extra warnings in the driver
Makefile are redundant. Remove them.

Note that -Wmissing-declarations and -Wmissing-prototypes are always
enabled by default in scripts/Makefile.extrawarn.

Signed-off-by: Jani Nikula 


Sorry, it took me so long to get to this. But, I guess as they say,
better late than never.

Applied, thanks!


---
  drivers/gpu/drm/amd/amdgpu/Makefile | 18 +-
  1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/Makefile 
b/drivers/gpu/drm/amd/amdgpu/Makefile
index 1f6b56ec99f6..9508d0b5708e 100644
--- a/drivers/gpu/drm/amd/amdgpu/Makefile
+++ b/drivers/gpu/drm/amd/amdgpu/Makefile
@@ -39,23 +39,7 @@ ccflags-y := -I$(FULL_AMD_PATH)/include/asic_reg \
-I$(FULL_AMD_DISPLAY_PATH)/amdgpu_dm \
-I$(FULL_AMD_PATH)/amdkfd
  
-subdir-ccflags-y := -Wextra

-subdir-ccflags-y += -Wunused
-subdir-ccflags-y += -Wmissing-prototypes
-subdir-ccflags-y += -Wmissing-declarations
-subdir-ccflags-y += -Wmissing-include-dirs
-subdir-ccflags-y += -Wold-style-definition
-subdir-ccflags-y += -Wmissing-format-attribute
-# Need this to avoid recursive variable evaluation issues
-cond-flags := $(call cc-option, -Wunused-but-set-variable) \
-   $(call cc-option, -Wunused-const-variable) \
-   $(call cc-option, -Wstringop-truncation) \
-   $(call cc-option, -Wpacked-not-aligned)
-subdir-ccflags-y += $(cond-flags)
-subdir-ccflags-y += -Wno-unused-parameter
-subdir-ccflags-y += -Wno-type-limits
-subdir-ccflags-y += -Wno-sign-compare
-subdir-ccflags-y += -Wno-missing-field-initializers
+# Locally disable W=1 warnings enabled in drm subsystem Makefile
  subdir-ccflags-y += -Wno-override-init
  subdir-ccflags-$(CONFIG_DRM_AMDGPU_WERROR) += -Werror
  

--
Hamza



✗ Fi.CI.BAT: failure for drm/i915/hwmon: expose package temperature (rev2)

2024-09-03 Thread Patchwork
== Series Details ==

Series: drm/i915/hwmon: expose package temperature (rev2)
URL   : https://patchwork.freedesktop.org/series/137874/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_15354 -> Patchwork_137874v2


Summary
---

  **FAILURE**

  Serious unknown changes coming with Patchwork_137874v2 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_137874v2, please notify your bug team 
(i915-ci-in...@lists.freedesktop.org) to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137874v2/index.html

Participating hosts (37 -> 37)
--

  Additional (1): fi-kbl-8809g 
  Missing(1): fi-snb-2520m 

Possible new issues
---

  Here are the unknown changes that may have been introduced in 
Patchwork_137874v2:

### IGT changes ###

 Possible regressions 

  * igt@i915_selftest@live@gt_mocs:
- bat-arls-5: [PASS][1] -> [DMESG-FAIL][2]
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15354/bat-arls-5/igt@i915_selftest@live@gt_mocs.html
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137874v2/bat-arls-5/igt@i915_selftest@live@gt_mocs.html

  
Known issues


  Here are the changes found in Patchwork_137874v2 that come from known issues:

### IGT changes ###

 Issues hit 

  * igt@gem_huc_copy@huc-copy:
- fi-kbl-8809g:   NOTRUN -> [SKIP][3] ([i915#2190])
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137874v2/fi-kbl-8809g/igt@gem_huc_c...@huc-copy.html

  * igt@gem_lmem_swapping@basic:
- fi-kbl-8809g:   NOTRUN -> [SKIP][4] ([i915#4613]) +3 other tests skip
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137874v2/fi-kbl-8809g/igt@gem_lmem_swapp...@basic.html

  * igt@i915_selftest@live@hangcheck:
- bat-arls-1: [PASS][5] -> [DMESG-WARN][6] ([i915#11349])
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15354/bat-arls-1/igt@i915_selftest@l...@hangcheck.html
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137874v2/bat-arls-1/igt@i915_selftest@l...@hangcheck.html

  * igt@i915_selftest@live@workarounds:
- bat-mtlp-8: [PASS][7] -> [ABORT][8] ([i915#12062])
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15354/bat-mtlp-8/igt@i915_selftest@l...@workarounds.html
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137874v2/bat-mtlp-8/igt@i915_selftest@l...@workarounds.html

  * igt@kms_force_connector_basic@force-load-detect:
- fi-kbl-8809g:   NOTRUN -> [SKIP][9] +30 other tests skip
   [9]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137874v2/fi-kbl-8809g/igt@kms_force_connector_ba...@force-load-detect.html

  
 Possible fixes 

  * igt@i915_selftest@live@hangcheck:
- bat-arls-2: [DMESG-WARN][10] ([i915#11349]) -> [PASS][11]
   [10]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15354/bat-arls-2/igt@i915_selftest@l...@hangcheck.html
   [11]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137874v2/bat-arls-2/igt@i915_selftest@l...@hangcheck.html

  
 Warnings 

  * igt@fbdev@read:
- bat-arls-1: [DMESG-FAIL][12] ([i915#12102]) -> [DMESG-WARN][13] 
([i915#12102])
   [12]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15354/bat-arls-1/igt@fb...@read.html
   [13]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137874v2/bat-arls-1/igt@fb...@read.html

  
  [i915#11349]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/11349
  [i915#12062]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/12062
  [i915#12102]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/12102
  [i915#2190]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/2190
  [i915#4613]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/4613


Build changes
-

  * Linux: CI_DRM_15354 -> Patchwork_137874v2

  CI-20190529: 20190529
  CI_DRM_15354: 7378077b0be32160022a73b7050b963d52364618 @ 
git://anongit.freedesktop.org/gfx-ci/linux
  IGT_8001: d3a77fc98e89cc94b03be2b0903d44f83480b8a0 @ 
https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
  Patchwork_137874v2: 7378077b0be32160022a73b7050b963d52364618 @ 
git://anongit.freedesktop.org/gfx-ci/linux

== Logs ==

For more details see: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_137874v2/index.html


[PATCH 0/4] drm/xe/display: Clean-up PM sequences

2024-09-03 Thread Rodrigo Vivi
This series aim to bring a bit of clarity in the display PM
sequences and start a clean-up around the runtime_pm ones.

Specially around D3Cold. There are some ongoing discussions
that we wouldn't need all the sequences that we currently have.

So, let's at least split them up to separate functions so
we can individually scrutinize.

For now, I removed what I'm sure that we don't need in a
d3cold scenario where we lose power and that I could
validate in my DG2. Any other attempt to clean-up further
at my end failed badly DG2's d3cold.

But again, let's at least bring some clarity on the
sequences before we go even further.

Cc: Vinod Govindapillai 
Cc: Imre Deak 
Signed-off-by: Rodrigo Vivi 


Rodrigo Vivi (4):
  drm/xe/display: Spin-off xe_display runtime/d3cold sequences
  drm/xe/display: Remove i915_drv.h include
  drm/xe/display: Kill useless has_display
  drm/xe/display: Reduce and streamline d3cold display sequence

 drivers/gpu/drm/xe/display/xe_display.c | 109 ++--
 drivers/gpu/drm/xe/display/xe_display.h |   8 +-
 drivers/gpu/drm/xe/xe_pm.c  |   8 +-
 3 files changed, 74 insertions(+), 51 deletions(-)

-- 
2.46.0



[PATCH 1/4] drm/xe/display: Spin-off xe_display runtime/d3cold sequences

2024-09-03 Thread Rodrigo Vivi
No functional change. This patch only splits the xe_display_pm
suspend/resume functions in the regular suspend/resume from the
runtime/d3cold ones.

The goal is to continue with a clean-up on the sequences
that might not be needed on runtime, even for D3cold. But,
for now, bring them to a separate place where it can be
easily seen and scrutinized.

Cc: Imre Deak 
Cc: Vinod Govindapillai 
Signed-off-by: Rodrigo Vivi 
---
 drivers/gpu/drm/xe/display/xe_display.c | 83 +++--
 drivers/gpu/drm/xe/display/xe_display.h |  8 +--
 drivers/gpu/drm/xe/xe_pm.c  |  8 +--
 3 files changed, 72 insertions(+), 27 deletions(-)

diff --git a/drivers/gpu/drm/xe/display/xe_display.c 
b/drivers/gpu/drm/xe/display/xe_display.c
index 75736faf2a80..c93b753fc88e 100644
--- a/drivers/gpu/drm/xe/display/xe_display.c
+++ b/drivers/gpu/drm/xe/display/xe_display.c
@@ -308,22 +308,78 @@ static void xe_display_flush_cleanup_work(struct 
xe_device *xe)
}
 }
 
-/* TODO: System and runtime suspend/resume sequences will be sanitized as a 
follow-up. */
+/* TODO: Sanitize D3Cold bringing it to a minimal possible sequence */
+static void xe_display_to_d3cold(struct xe_device *xe)
+{
+   struct intel_display *display = &xe->display;
+
+   /*
+* We do a lot of poking in a lot of registers, make sure they work
+* properly.
+*/
+   intel_power_domains_disable(xe);
+   intel_fbdev_set_suspend(&xe->drm, FBINFO_STATE_SUSPENDED, true);
+
+   xe_display_flush_cleanup_work(xe);
+
+   intel_dp_mst_suspend(xe);
+
+   intel_hpd_cancel_work(xe);
+
+   intel_opregion_suspend(display, PCI_D3cold);
+
+   intel_dmc_suspend(xe);
+}
+
+static void xe_display_from_d3cold(struct xe_device *xe)
+{
+   struct intel_display *display = &xe->display;
+
+   intel_dmc_resume(xe);
+
+   if (has_display(xe))
+   drm_mode_config_reset(&xe->drm);
+
+   intel_display_driver_init_hw(xe);
+   intel_hpd_init(xe);
+
+   /* MST sideband requires HPD interrupts enabled */
+   intel_dp_mst_resume(xe);
+
+   intel_opregion_resume(display);
+
+   intel_fbdev_set_suspend(&xe->drm, FBINFO_STATE_RUNNING, false);
+
+   intel_power_domains_enable(xe);
+}
+
 void xe_display_pm_runtime_suspend(struct xe_device *xe)
 {
if (!xe->info.probe_display)
return;
 
if (xe->d3cold.allowed)
-   xe_display_pm_suspend(xe, true);
+   xe_display_to_d3cold(xe);
 
intel_hpd_poll_enable(xe);
 }
 
-void xe_display_pm_suspend(struct xe_device *xe, bool runtime)
+void xe_display_pm_runtime_resume(struct xe_device *xe)
+{
+   if (!xe->info.probe_display)
+   return;
+
+   intel_hpd_poll_disable(xe);
+
+   if (xe->d3cold.allowed)
+   xe_display_from_d3cold(xe);
+}
+
+void xe_display_pm_suspend(struct xe_device *xe)
 {
struct intel_display *display = &xe->display;
bool s2idle = suspend_to_idle();
+
if (!xe->info.probe_display)
return;
 
@@ -333,7 +389,7 @@ void xe_display_pm_suspend(struct xe_device *xe, bool 
runtime)
 */
intel_power_domains_disable(xe);
intel_fbdev_set_suspend(&xe->drm, FBINFO_STATE_SUSPENDED, true);
-   if (!runtime && has_display(xe)) {
+   if (has_display(xe)) {
drm_kms_helper_poll_disable(&xe->drm);
intel_display_driver_disable_user_access(xe);
intel_display_driver_suspend(xe);
@@ -345,7 +401,7 @@ void xe_display_pm_suspend(struct xe_device *xe, bool 
runtime)
 
intel_hpd_cancel_work(xe);
 
-   if (!runtime && has_display(xe)) {
+   if (has_display(xe)) {
intel_display_driver_suspend_access(xe);
intel_encoder_suspend_all(&xe->display);
}
@@ -366,17 +422,6 @@ void xe_display_pm_suspend_late(struct xe_device *xe)
intel_display_power_suspend_late(xe);
 }
 
-void xe_display_pm_runtime_resume(struct xe_device *xe)
-{
-   if (!xe->info.probe_display)
-   return;
-
-   intel_hpd_poll_disable(xe);
-
-   if (xe->d3cold.allowed)
-   xe_display_pm_resume(xe, true);
-}
-
 void xe_display_pm_resume_early(struct xe_device *xe)
 {
if (!xe->info.probe_display)
@@ -387,7 +432,7 @@ void xe_display_pm_resume_early(struct xe_device *xe)
intel_power_domains_resume(xe);
 }
 
-void xe_display_pm_resume(struct xe_device *xe, bool runtime)
+void xe_display_pm_resume(struct xe_device *xe)
 {
struct intel_display *display = &xe->display;
 
@@ -402,12 +447,12 @@ void xe_display_pm_resume(struct xe_device *xe, bool 
runtime)
intel_display_driver_init_hw(xe);
intel_hpd_init(xe);
 
-   if (!runtime && has_display(xe))
+   if (has_display(xe))
intel_display_driver_resume_access(xe);
 
/* MST sideband requires HPD interrupts enabled */
intel_dp_mst_resume(xe);
-   if (!runtime && ha

[PATCH 2/4] drm/xe/display: Remove i915_drv.h include

2024-09-03 Thread Rodrigo Vivi
Change HAS_DISPLAY towards intel_display and remove one of the
last includes of i915_drv.h in Xe.

Cc: Jani Nikula 
Signed-off-by: Rodrigo Vivi 
---
 drivers/gpu/drm/xe/display/xe_display.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/xe/display/xe_display.c 
b/drivers/gpu/drm/xe/display/xe_display.c
index c93b753fc88e..65331bbbc068 100644
--- a/drivers/gpu/drm/xe/display/xe_display.c
+++ b/drivers/gpu/drm/xe/display/xe_display.c
@@ -13,7 +13,6 @@
 #include 
 
 #include "soc/intel_dram.h"
-#include "i915_drv.h"  /* FIXME: HAS_DISPLAY() depends on this */
 #include "intel_acpi.h"
 #include "intel_audio.h"
 #include "intel_bw.h"
@@ -34,7 +33,7 @@
 
 static bool has_display(struct xe_device *xe)
 {
-   return HAS_DISPLAY(xe);
+   return HAS_DISPLAY(&xe->display);
 }
 
 /**
-- 
2.46.0



[PATCH 3/4] drm/xe/display: Kill useless has_display

2024-09-03 Thread Rodrigo Vivi
When HAS_DISPLAY is false, info.probe_display is set to false.
Hence, all these calls to has_display() are bogus.

With only one place left, use the main macro now and entirely
kill has_display() local helper.

Cc: Jani Nikula 
Cc: Maarten Lankhorst 
Cc: Lucas De Marchi 
Signed-off-by: Rodrigo Vivi 
---
 drivers/gpu/drm/xe/display/xe_display.c | 43 -
 1 file changed, 14 insertions(+), 29 deletions(-)

diff --git a/drivers/gpu/drm/xe/display/xe_display.c 
b/drivers/gpu/drm/xe/display/xe_display.c
index 65331bbbc068..daf9b9baa88a 100644
--- a/drivers/gpu/drm/xe/display/xe_display.c
+++ b/drivers/gpu/drm/xe/display/xe_display.c
@@ -29,13 +29,6 @@
 #include "intel_opregion.h"
 #include "xe_module.h"
 
-/* Xe device functions */
-
-static bool has_display(struct xe_device *xe)
-{
-   return HAS_DISPLAY(&xe->display);
-}
-
 /**
  * xe_display_driver_probe_defer - Detect if we need to wait for other drivers
  *early on
@@ -336,8 +329,7 @@ static void xe_display_from_d3cold(struct xe_device *xe)
 
intel_dmc_resume(xe);
 
-   if (has_display(xe))
-   drm_mode_config_reset(&xe->drm);
+   drm_mode_config_reset(&xe->drm);
 
intel_display_driver_init_hw(xe);
intel_hpd_init(xe);
@@ -388,11 +380,10 @@ void xe_display_pm_suspend(struct xe_device *xe)
 */
intel_power_domains_disable(xe);
intel_fbdev_set_suspend(&xe->drm, FBINFO_STATE_SUSPENDED, true);
-   if (has_display(xe)) {
-   drm_kms_helper_poll_disable(&xe->drm);
-   intel_display_driver_disable_user_access(xe);
-   intel_display_driver_suspend(xe);
-   }
+
+   drm_kms_helper_poll_disable(&xe->drm);
+   intel_display_driver_disable_user_access(xe);
+   intel_display_driver_suspend(xe);
 
xe_display_flush_cleanup_work(xe);
 
@@ -400,10 +391,8 @@ void xe_display_pm_suspend(struct xe_device *xe)
 
intel_hpd_cancel_work(xe);
 
-   if (has_display(xe)) {
-   intel_display_driver_suspend_access(xe);
-   intel_encoder_suspend_all(&xe->display);
-   }
+   intel_display_driver_suspend_access(xe);
+   intel_encoder_suspend_all(&xe->display);
 
intel_opregion_suspend(display, s2idle ? PCI_D1 : PCI_D3cold);
 
@@ -440,23 +429,19 @@ void xe_display_pm_resume(struct xe_device *xe)
 
intel_dmc_resume(xe);
 
-   if (has_display(xe))
-   drm_mode_config_reset(&xe->drm);
+   drm_mode_config_reset(&xe->drm);
 
intel_display_driver_init_hw(xe);
intel_hpd_init(xe);
 
-   if (has_display(xe))
-   intel_display_driver_resume_access(xe);
+   intel_display_driver_resume_access(xe);
 
/* MST sideband requires HPD interrupts enabled */
intel_dp_mst_resume(xe);
-   if (has_display(xe)) {
-   intel_display_driver_resume(xe);
-   drm_kms_helper_poll_enable(&xe->drm);
-   intel_display_driver_enable_user_access(xe);
-   intel_hpd_poll_disable(xe);
-   }
+   intel_display_driver_resume(xe);
+   drm_kms_helper_poll_enable(&xe->drm);
+   intel_display_driver_enable_user_access(xe);
+   intel_hpd_poll_disable(xe);
 
intel_opregion_resume(display);
 
@@ -485,7 +470,7 @@ int xe_display_probe(struct xe_device *xe)
if (err)
return err;
 
-   if (has_display(xe))
+   if (HAS_DISPLAY(&xe->display))
return 0;
 
 no_display:
-- 
2.46.0



[PATCH 4/4] drm/xe/display: Reduce and streamline d3cold display sequence

2024-09-03 Thread Rodrigo Vivi
When going to d3cold we surely don't need to flush commits,
nor handle fbdev. So, clean this up a bit.

Also move the opregion call to make the function more symmetric.

Cc: Imre Deak 
Signed-off-by: Rodrigo Vivi 
---
 drivers/gpu/drm/xe/display/xe_display.c | 12 +++-
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/xe/display/xe_display.c 
b/drivers/gpu/drm/xe/display/xe_display.c
index daf9b9baa88a..3fd3e74f1310 100644
--- a/drivers/gpu/drm/xe/display/xe_display.c
+++ b/drivers/gpu/drm/xe/display/xe_display.c
@@ -310,9 +310,6 @@ static void xe_display_to_d3cold(struct xe_device *xe)
 * properly.
 */
intel_power_domains_disable(xe);
-   intel_fbdev_set_suspend(&xe->drm, FBINFO_STATE_SUSPENDED, true);
-
-   xe_display_flush_cleanup_work(xe);
 
intel_dp_mst_suspend(xe);
 
@@ -329,18 +326,15 @@ static void xe_display_from_d3cold(struct xe_device *xe)
 
intel_dmc_resume(xe);
 
-   drm_mode_config_reset(&xe->drm);
-
intel_display_driver_init_hw(xe);
+
+   intel_opregion_resume(display);
+
intel_hpd_init(xe);
 
/* MST sideband requires HPD interrupts enabled */
intel_dp_mst_resume(xe);
 
-   intel_opregion_resume(display);
-
-   intel_fbdev_set_suspend(&xe->drm, FBINFO_STATE_RUNNING, false);
-
intel_power_domains_enable(xe);
 }
 
-- 
2.46.0



✗ Fi.CI.BAT: failure for drm/xe/display: Clean-up PM sequences

2024-09-03 Thread Patchwork
== Series Details ==

Series: drm/xe/display: Clean-up PM sequences
URL   : https://patchwork.freedesktop.org/series/138164/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_15355 -> Patchwork_138164v1


Summary
---

  **FAILURE**

  Serious unknown changes coming with Patchwork_138164v1 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_138164v1, please notify your bug team 
(i915-ci-in...@lists.freedesktop.org) to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138164v1/index.html

Participating hosts (39 -> 40)
--

  Additional (2): fi-kbl-8809g fi-pnv-d510 
  Missing(1): fi-snb-2520m 

Possible new issues
---

  Here are the unknown changes that may have been introduced in 
Patchwork_138164v1:

### IGT changes ###

 Possible regressions 

  * igt@i915_selftest@live@perf:
- bat-arls-2: [PASS][1] -> [DMESG-WARN][2]
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15355/bat-arls-2/igt@i915_selftest@l...@perf.html
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138164v1/bat-arls-2/igt@i915_selftest@l...@perf.html

  
Known issues


  Here are the changes found in Patchwork_138164v1 that come from known issues:

### IGT changes ###

 Issues hit 

  * igt@gem_huc_copy@huc-copy:
- fi-kbl-8809g:   NOTRUN -> [SKIP][3] ([i915#2190])
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138164v1/fi-kbl-8809g/igt@gem_huc_c...@huc-copy.html

  * igt@gem_lmem_swapping@basic:
- fi-pnv-d510:NOTRUN -> [SKIP][4] +32 other tests skip
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138164v1/fi-pnv-d510/igt@gem_lmem_swapp...@basic.html
- fi-kbl-8809g:   NOTRUN -> [SKIP][5] ([i915#4613]) +3 other tests skip
   [5]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138164v1/fi-kbl-8809g/igt@gem_lmem_swapp...@basic.html

  * igt@i915_selftest@live@hangcheck:
- bat-arls-2: [PASS][6] -> [DMESG-WARN][7] ([i915#11349])
   [6]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15355/bat-arls-2/igt@i915_selftest@l...@hangcheck.html
   [7]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138164v1/bat-arls-2/igt@i915_selftest@l...@hangcheck.html

  * igt@i915_selftest@live@late_gt_pm:
- bat-arls-2: [PASS][8] -> [DMESG-FAIL][9] ([i915#10262]) +4 other 
tests dmesg-fail
   [8]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15355/bat-arls-2/igt@i915_selftest@live@late_gt_pm.html
   [9]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138164v1/bat-arls-2/igt@i915_selftest@live@late_gt_pm.html

  * igt@kms_force_connector_basic@force-load-detect:
- fi-kbl-8809g:   NOTRUN -> [SKIP][10] +30 other tests skip
   [10]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138164v1/fi-kbl-8809g/igt@kms_force_connector_ba...@force-load-detect.html

  
 Possible fixes 

  * igt@kms_pm_rpm@basic-rte:
- {bat-arlh-3}:   [INCOMPLETE][11] ([i915#10553]) -> [PASS][12]
   [11]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15355/bat-arlh-3/igt@kms_pm_...@basic-rte.html
   [12]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138164v1/bat-arlh-3/igt@kms_pm_...@basic-rte.html

  
  {name}: This element is suppressed. This means it is ignored when computing
  the status of the difference (SUCCESS, WARNING, or FAILURE).

  [i915#10196]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/10196
  [i915#10262]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/10262
  [i915#10553]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/10553
  [i915#11349]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/11349
  [i915#11671]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/11671
  [i915#11681]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/11681
  [i915#11723]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/11723
  [i915#11726]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/11726
  [i915#2190]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/2190
  [i915#4613]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/4613
  [i915#8809]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/8809


Build changes
-

  * Linux: CI_DRM_15355 -> Patchwork_138164v1

  CI-20190529: 20190529
  CI_DRM_15355: e159ed9ab3ec08042286fb8af2560dbc540beccb @ 
git://anongit.freedesktop.org/gfx-ci/linux
  IGT_8002: 8002
  Patchwork_138164v1: e159ed9ab3ec08042286fb8af2560dbc540beccb @ 
git://anongit.freedesktop.org/gfx-ci/linux

== Logs ==

For more details see: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_138164v1/index.html


linux-next: build failure after merge of the drm-misc tree

2024-09-03 Thread Stephen Rothwell
Hi all,

After merging the drm-misc tree, today's linux-next build (x86_64
allmodconfig) failed like this:

drivers/gpu/drm/bridge/ti-tdp158.c: In function 'tdp158_enable':
drivers/gpu/drm/bridge/ti-tdp158.c:31:9: error: implicit declaration of 
function 'gpiod_set_value_cansleep' [-Wimplicit-function-declaration]
   31 | gpiod_set_value_cansleep(tdp158->enable, 1);
  | ^~~~
drivers/gpu/drm/bridge/ti-tdp158.c: In function 'tdp158_probe':
drivers/gpu/drm/bridge/ti-tdp158.c:80:26: error: implicit declaration of 
function 'devm_gpiod_get_optional'; did you mean 'devm_regulator_get_optional'? 
[-Wimplicit-function-declaration]
   80 | tdp158->enable = devm_gpiod_get_optional(dev, "enable", 
GPIOD_OUT_LOW);
  |  ^~~
  |  devm_regulator_get_optional
drivers/gpu/drm/bridge/ti-tdp158.c:80:65: error: 'GPIOD_OUT_LOW' undeclared 
(first use in this function)
   80 | tdp158->enable = devm_gpiod_get_optional(dev, "enable", 
GPIOD_OUT_LOW);
  | 
^
drivers/gpu/drm/bridge/ti-tdp158.c:80:65: note: each undeclared identifier is 
reported only once for each function it appears in

Caused by commit

  a15710027afb ("drm/bridge: add support for TI TDP158")

I have used the drm-misc tree from next-20240903 for today.

-- 
Cheers,
Stephen Rothwell


pgpe99VdAOaFT.pgp
Description: OpenPGP digital signature


RE: [PATCHv2 3/5] Add crtc properties for global histogram

2024-09-03 Thread Murthy, Arun R
> > > +static int
> > > +intel_atomic_replace_property_blob_from_id(struct drm_device *dev,
> > > +struct drm_property_blob **blob,
> > > +u64 blob_id,
> > > +ssize_t expected_size,
> > > +ssize_t expected_elem_size,
> > > +bool *replaced)
> > > +{
> > > + struct drm_property_blob *new_blob = NULL;
> > > +
> > > + if (blob_id != 0) {
> > > + new_blob = drm_property_lookup_blob(dev, blob_id);
> > > + if (!new_blob)
> > > + return -EINVAL;
> > > +
> > > + if (expected_size > 0 &&
> > > + new_blob->length != expected_size) {
> > > + drm_property_blob_put(new_blob);
> > > + return -EINVAL;
> > > + }
> > > + if (expected_elem_size > 0 &&
> > > + new_blob->length % expected_elem_size != 0) {
> > > + drm_property_blob_put(new_blob);
> > > + return -EINVAL;
> > > + }
> > > + }
> > > +
> > > + *replaced |= drm_property_replace_blob(blob, new_blob);
> > > + drm_property_blob_put(new_blob);
> > > +
> > > + return 0;
> > > +}
> > > +
> > Can we align this design to what we have for get property with similar
> > pattern of if else logic and return 0.
Done!

> > > +static int intel_crtc_set_property(struct drm_crtc *crtc,
> > > +struct drm_crtc_state *state,
> > > +struct drm_property *property,
> > > +u64 val)
> > > +{
> > > + struct drm_i915_private *i915 = to_i915(crtc->dev);
> > > + struct intel_crtc_state *intel_crtc_state =
> > > + to_intel_crtc_state(state);
> > > + struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
> > > + bool replaced = false;
> > > +
> > > + if (property == intel_crtc->histogram_en_property) {
> > > + intel_crtc_state->histogram_en = val;
> > > + intel_crtc_state->histogram_en_changed = true;
> > > + return 0;
> > > + }
> > > +
> > > + if (property == intel_crtc->global_iet_property) {
> > > + intel_atomic_replace_property_blob_from_id(crtc->dev,
> > > +&intel_crtc_state-
> > > >global_iet,
> > > +val,
> > > +sizeof(uint32_t) *
> > > HISTOGRAM_IET_LENGTH,
> > > +-1, &replaced);
> > > + if (replaced)
> > > + intel_crtc_state->global_iet_changed = true;
> > > + return 0;
> > > + }
> > > +
> > > + drm_dbg_atomic(&i915->drm, "Unknown property
> > > [PROP:%d:%s]\n",
> > > +property->base.id, property->name);
> > > + return -EINVAL;
> > > +}
> > > +
> > >  #define INTEL_CRTC_FUNCS \
> > >   .set_config = drm_atomic_helper_set_config, \
> > >   .destroy = intel_crtc_destroy, \
> > > @@ -229,7 +326,9 @@ static int intel_crtc_late_register(struct
> > > drm_crtc
> > > *crtc)
> > >   .set_crc_source = intel_crtc_set_crc_source, \
> > >   .verify_crc_source = intel_crtc_verify_crc_source, \
> > >   .get_crc_sources = intel_crtc_get_crc_sources, \
> > > - .late_register = intel_crtc_late_register
> > > + .late_register = intel_crtc_late_register, \
> > > + .atomic_set_property = intel_crtc_set_property, \
> > > + .atomic_get_property = intel_crtc_get_property
> >
> > +dri-devel
> >
> > Can this be made drm crtc property as histogram is generic?
> >
If there are other drivers using this property then this can be made a drm_crtc 
property.

Thanks and Regards,
Arun R Murthy



Re: [PATCH 4/4] drm/xe/display: Reduce and streamline d3cold display sequence

2024-09-03 Thread Anshuman Gupta
On 2024-09-04 at 04:08:03 +0530, Rodrigo Vivi wrote:
> When going to d3cold we surely don't need to flush commits,
> nor handle fbdev. So, clean this up a bit.
> 
> Also move the opregion call to make the function more symmetric.
> 
> Cc: Imre Deak 
> Signed-off-by: Rodrigo Vivi 
> ---
>  drivers/gpu/drm/xe/display/xe_display.c | 12 +++-
>  1 file changed, 3 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/display/xe_display.c 
> b/drivers/gpu/drm/xe/display/xe_display.c
> index daf9b9baa88a..3fd3e74f1310 100644
> --- a/drivers/gpu/drm/xe/display/xe_display.c
> +++ b/drivers/gpu/drm/xe/display/xe_display.c
> @@ -310,9 +310,6 @@ static void xe_display_to_d3cold(struct xe_device *xe)
>* properly.
>*/
>   intel_power_domains_disable(xe);
> - intel_fbdev_set_suspend(&xe->drm, FBINFO_STATE_SUSPENDED, true);
How do we make sure fbconsole doesn't use vram to blink the cursor ?

Thanks,
Anshuman.
> -
> - xe_display_flush_cleanup_work(xe);
>  
>   intel_dp_mst_suspend(xe);
>  
> @@ -329,18 +326,15 @@ static void xe_display_from_d3cold(struct xe_device *xe)
>  
>   intel_dmc_resume(xe);
>  
> - drm_mode_config_reset(&xe->drm);
> -
>   intel_display_driver_init_hw(xe);
> +
> + intel_opregion_resume(display);
> +
>   intel_hpd_init(xe);
>  
>   /* MST sideband requires HPD interrupts enabled */
>   intel_dp_mst_resume(xe);
>  
> - intel_opregion_resume(display);
> -
> - intel_fbdev_set_suspend(&xe->drm, FBINFO_STATE_RUNNING, false);
> -
>   intel_power_domains_enable(xe);
>  }
>  
> -- 
> 2.46.0
> 


linux-next: build warning after merge of the drm-misc-fixes tree

2024-09-03 Thread Stephen Rothwell
Hi all,

After merging the drm-misc-fixes tree, today's linux-next build (htmldocs)
produced this warning:

Error: Cannot open file drivers/gpu/drm/drm_bridge_connector.c

Introduced by commit

  9da7ec9b19d8 ("drm/bridge-connector: move to DRM_DISPLAY_HELPER module")

-- 
Cheers,
Stephen Rothwell


pgpneJfkilbWy.pgp
Description: OpenPGP digital signature