Re: [PATCH 16/28] drm/i915/color: Create a transfer function color pipeline

2024-02-18 Thread Dan Carpenter
Hi Uma,

kernel test robot noticed the following build warnings:

https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:
https://github.com/intel-lab-lkp/linux/commits/Uma-Shankar/drm-color-pipeline-base-work/20240213-144544
base:   git://anongit.freedesktop.org/drm/drm-misc drm-misc-next
patch link:
https://lore.kernel.org/r/20240213064835.139464-17-uma.shankar%40intel.com
patch subject: [PATCH 16/28] drm/i915/color: Create a transfer function color 
pipeline
config: i386-randconfig-141-20240217 
(https://download.01.org/0day-ci/archive/20240218/202402180310.gmdixajx-...@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 
6009708b4367171ccdbf4b5905cb6a803753fe18)

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 
| Reported-by: Dan Carpenter 
| Closes: https://lore.kernel.org/r/202402180310.gmdixajx-...@intel.com/

New smatch warnings:
drivers/gpu/drm/i915/display/intel_color.c:3867 intel_plane_tf_pipeline_init() 
error: 'colorop' dereferencing possible ERR_PTR()

vim +/colorop +3867 drivers/gpu/drm/i915/display/intel_color.c

5e1e0f87c9bcae Chaitanya Kumar Borah 2024-02-13  3852  int 
intel_plane_tf_pipeline_init(struct drm_plane *plane, struct drm_prop_enum_list 
*list)
5e1e0f87c9bcae Chaitanya Kumar Borah 2024-02-13  3853  {
5e1e0f87c9bcae Chaitanya Kumar Borah 2024-02-13  3854   struct intel_plane 
*intel_plane = to_intel_plane(plane);
5e1e0f87c9bcae Chaitanya Kumar Borah 2024-02-13  3855   struct 
intel_plane_colorop *colorop;
5e1e0f87c9bcae Chaitanya Kumar Borah 2024-02-13  3856   struct drm_device *dev 
= plane->dev;
5e1e0f87c9bcae Chaitanya Kumar Borah 2024-02-13  3857   struct drm_i915_private 
*i915 = to_i915(dev);
5e1e0f87c9bcae Chaitanya Kumar Borah 2024-02-13  3858   int ret;
5e1e0f87c9bcae Chaitanya Kumar Borah 2024-02-13  3859   struct drm_colorop 
*prev_op;
5e1e0f87c9bcae Chaitanya Kumar Borah 2024-02-13  3860  
5e1e0f87c9bcae Chaitanya Kumar Borah 2024-02-13  3861   colorop = 
intel_plane_colorop_create(CB_PLANE_PRE_CSC_LUT);

No error checking

5e1e0f87c9bcae Chaitanya Kumar Borah 2024-02-13  3862  
5e1e0f87c9bcae Chaitanya Kumar Borah 2024-02-13  3863   ret = 
drm_colorop_init(dev, >base, plane, DRM_COLOROP_1D_LUT);
5e1e0f87c9bcae Chaitanya Kumar Borah 2024-02-13  3864   if (ret)
5e1e0f87c9bcae Chaitanya Kumar Borah 2024-02-13  3865   return ret;
5e1e0f87c9bcae Chaitanya Kumar Borah 2024-02-13  3866  
5e1e0f87c9bcae Chaitanya Kumar Borah 2024-02-13 @3867   list->type = 
colorop->base.base.id;
5e1e0f87c9bcae Chaitanya Kumar Borah 2024-02-13  3868   list->name = 
kasprintf(GFP_KERNEL, "Color Pipeline %d", colorop->base.base.id);
5e1e0f87c9bcae Chaitanya Kumar Borah 2024-02-13  3869  
5e1e0f87c9bcae Chaitanya Kumar Borah 2024-02-13  3870   /* TODO: handle 
failures and clean up*/
5e1e0f87c9bcae Chaitanya Kumar Borah 2024-02-13  3871   prev_op = 
>base;

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



✓ Fi.CI.BAT: success for Program Deep PKG_C_LATENCY register (rev4)

2024-02-18 Thread Patchwork
== Series Details ==

Series: Program Deep PKG_C_LATENCY register (rev4)
URL   : https://patchwork.freedesktop.org/series/129407/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_14288 -> Patchwork_129407v4


Summary
---

  **SUCCESS**

  No regressions found.

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

Participating hosts (34 -> 33)
--

  Additional (1): bat-kbl-2 
  Missing(2): bat-adlp-9 fi-snb-2520m 

Known issues


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

### IGT changes ###

 Issues hit 

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

  * igt@gem_lmem_swapping@parallel-random-engines:
- bat-kbl-2:  NOTRUN -> [SKIP][2] ([fdo#109271]) +35 other tests 
skip
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129407v4/bat-kbl-2/igt@gem_lmem_swapp...@parallel-random-engines.html

  
 Possible fixes 

  * igt@core_hotunplug@unbind-rebind:
- {bat-arls-2}:   [ABORT][3] ([i915#10237]) -> [PASS][4]
   [3]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14288/bat-arls-2/igt@core_hotunp...@unbind-rebind.html
   [4]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_129407v4/bat-arls-2/igt@core_hotunp...@unbind-rebind.html

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

  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [i915#10194]: https://gitlab.freedesktop.org/drm/intel/issues/10194
  [i915#10213]: https://gitlab.freedesktop.org/drm/intel/issues/10213
  [i915#10215]: https://gitlab.freedesktop.org/drm/intel/issues/10215
  [i915#10237]: https://gitlab.freedesktop.org/drm/intel/issues/10237
  [i915#1849]: https://gitlab.freedesktop.org/drm/intel/issues/1849


Build changes
-

  * Linux: CI_DRM_14288 -> Patchwork_129407v4

  CI-20190529: 20190529
  CI_DRM_14288: cb7db7997fcacd6792fd2fd6e9e93309a408587a @ 
git://anongit.freedesktop.org/gfx-ci/linux
  IGT_7716: 7716
  Patchwork_129407v4: cb7db7997fcacd6792fd2fd6e9e93309a408587a @ 
git://anongit.freedesktop.org/gfx-ci/linux


### Linux commits

816207164a57 drm/i915/lnl: Program PKGC_LATENCY register
49b6eaaf2fe6 drm/i915/lnl: Add pkgc related register

== Logs ==

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


✗ Fi.CI.SPARSE: warning for Program Deep PKG_C_LATENCY register (rev4)

2024-02-18 Thread Patchwork
== Series Details ==

Series: Program Deep PKG_C_LATENCY register (rev4)
URL   : https://patchwork.freedesktop.org/series/129407/
State : warning

== Summary ==

Error: dim sparse failed
Sparse version: v0.6.2
Fast mode used, each commit won't be checked separately.
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:116:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:147:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:149:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:153:26: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:155:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:173:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:175:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:175:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:179:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:179:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:181:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:181:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:181:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:181:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:185:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:185:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:187:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:187:9: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:191:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:191:35: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:194:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:194:16: warning: unreplaced symbol 'oldbit'
+./arch/x86/include/asm/bitops.h:194:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:194:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:236:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:236:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:238:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:238:9: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:66:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:66:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:92:1: warning: unreplaced symbol 'return'
+./arch/x86/include/asm/bitops.h:92:1: warning: unreplaced symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:100:17: warning: unreplaced 
symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:100:17: warning: unreplaced 
symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:100:23: warning: unreplaced 
symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:100:23: warning: unreplaced 
symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:100:9: warning: unreplaced 
symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:100:9: warning: unreplaced 
symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:105:1: warning: unreplaced 
symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:105:1: warning: unreplaced 
symbol 'return'
+./include/asm-generic/bitops/generic-non-atomic.h:107:9: warning: unreplaced 
symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:107:9: warning: unreplaced 
symbol 'mask'
+./include/asm-generic/bitops/generic-non-atomic.h:108:9: warning: unreplaced 
symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:108:9: warning: unreplaced 
symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:109:9: warning: unreplaced 
symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:109:9: warning: unreplaced 
symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:111:10: warning: unreplaced 
symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:111:10: warning: unreplaced 
symbol 'p'
+./include/asm-generic/bitops/generic-non-atomic.h:111:14: warning: unreplaced 
symbol 'old'
+./include/asm-generic/bitops/generic-non-atomic.h:111:14: warning: unreplaced 
symbol 'old'

Re: [PATCH 4/6] drm/i915/psr: Silence period and lfps half cycle

2024-02-18 Thread Dan Carpenter
Hi Jouni,

kernel test robot noticed the following build warnings:

https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:
https://github.com/intel-lab-lkp/linux/commits/Jouni-H-gander/drm-display-Add-missing-aux-less-alpm-wake-related-bits/20240215-185209
base:   git://anongit.freedesktop.org/drm-intel for-linux-next
patch link:
https://lore.kernel.org/r/20240215104934.2395239-5-jouni.hogander%40intel.com
patch subject: [PATCH 4/6] drm/i915/psr: Silence period and lfps half cycle
config: i386-randconfig-141-20240217 
(https://download.01.org/0day-ci/archive/20240217/202402171830.n4hwr2id-...@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 
6009708b4367171ccdbf4b5905cb6a803753fe18)

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 
| Reported-by: Dan Carpenter 
| Closes: https://lore.kernel.org/r/202402171830.n4hwr2id-...@intel.com/

smatch warnings:
drivers/gpu/drm/i915/display/intel_psr.c:1253 
_lnl_compute_aux_less_alpm_params() error: uninitialized symbol 
'silence_period'.

vim +/silence_period +1253 drivers/gpu/drm/i915/display/intel_psr.c

e4870a4a3cd051 Jouni Högander 2024-02-15  1235  static int 
_lnl_compute_aux_less_alpm_params(struct intel_dp *intel_dp,
e4870a4a3cd051 Jouni Högander 2024-02-15  1236  
 struct intel_crtc_state *crtc_state)
e4870a4a3cd051 Jouni Högander 2024-02-15  1237  {
e4870a4a3cd051 Jouni Högander 2024-02-15  1238  struct drm_i915_private 
*i915 = dp_to_i915(intel_dp);
410818227325ec Jouni Högander 2024-02-15  1239  int aux_less_wake_time, 
aux_less_wake_lines, switch_to_active_lines,
410818227325ec Jouni Högander 2024-02-15  1240  silence_period, 
lfps_half_cycle;
e4870a4a3cd051 Jouni Högander 2024-02-15  1241  
e4870a4a3cd051 Jouni Högander 2024-02-15  1242  aux_less_wake_time =
e4870a4a3cd051 Jouni Högander 2024-02-15  1243  
_lnl_compute_aux_less_wake_time(crtc_state->port_clock / 1000);
e4870a4a3cd051 Jouni Högander 2024-02-15  1244  aux_less_wake_lines = 
intel_usecs_to_scanlines(_state->hw.adjusted_mode,
e4870a4a3cd051 Jouni Högander 2024-02-15  1245  
   aux_less_wake_time);
e4870a4a3cd051 Jouni Högander 2024-02-15  1246  
e31171d1611687 Jouni Högander 2024-02-15  1247  switch_to_active_lines =
e31171d1611687 Jouni Högander 2024-02-15  1248  
intel_usecs_to_scanlines(
e31171d1611687 Jouni Högander 2024-02-15  1249  
_state->hw.adjusted_mode,
e31171d1611687 Jouni Högander 2024-02-15  1250  
_lnl_compute_switch_to_active_time(crtc_state->port_clock / 1000));
e31171d1611687 Jouni Högander 2024-02-15  1251  
410818227325ec Jouni Högander 2024-02-15  1252  if (aux_less_wake_lines 
> 32 || switch_to_active_lines > 32 ||
410818227325ec Jouni Högander 2024-02-15 @1253  silence_period > 
256 || silence_period < 0 ||
^^  
^^
Uninitialized

410818227325ec Jouni Högander 2024-02-15  1254  
!_lnl_get_silence_period_and_lfps_half_cycle(intel_dp->link_rate,
410818227325ec Jouni Högander 2024-02-15  1255  
 _period,
410818227325ec Jouni Högander 2024-02-15  1256  
 _half_cycle))
e4870a4a3cd051 Jouni Högander 2024-02-15  1257  return false;
e4870a4a3cd051 Jouni Högander 2024-02-15  1258  
e31171d1611687 Jouni Högander 2024-02-15  1259  if 
(i915->display.params.psr_safest_params) {
e4870a4a3cd051 Jouni Högander 2024-02-15  1260  
aux_less_wake_lines = 32;
e31171d1611687 Jouni Högander 2024-02-15  1261  
switch_to_active_lines = 32;
e31171d1611687 Jouni Högander 2024-02-15  1262  }
e4870a4a3cd051 Jouni Högander 2024-02-15  1263  
e4870a4a3cd051 Jouni Högander 2024-02-15  1264  
intel_dp->psr.alpm_parameters.aux_less_wake_lines = aux_less_wake_lines;
e31171d1611687 Jouni Högander 2024-02-15  1265  
intel_dp->psr.alpm_parameters.switch_to_active_lines = switch_to_active_lines;
410818227325ec Jouni Högander 2024-02-15  1266  
intel_dp->psr.alpm_parameters.silence_period_sym_clocks = silence_period;
410818227325ec Jouni Högander 2024-02-15  1267  
intel_dp->psr.alpm_parameters.lfps_half_cycle_num_of_syms = lfps_half_cycle;
e4870a4a3cd051 Jouni Högander 2024-02-15  1268  
e4870a4a3cd051 Jouni Högander 2024-02-15  1269  return true;
e4870a4a3cd051 Jouni Högander 2024-02-15  1270  }

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



✓ Fi.CI.BAT: success for drm/i915/scaler: Update Pipe src size check for DISPLAY_VER >= 12

2024-02-18 Thread Patchwork
== Series Details ==

Series: drm/i915/scaler: Update Pipe src size check for DISPLAY_VER >= 12
URL   : https://patchwork.freedesktop.org/series/130061/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_14288 -> Patchwork_130061v1


Summary
---

  **SUCCESS**

  No regressions found.

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

Participating hosts (34 -> 33)
--

  Missing(1): fi-snb-2520m 

Known issues


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

### CI changes ###


### IGT changes ###

 Issues hit 

  * igt@i915_selftest@live@execlists:
- fi-bsw-nick:[PASS][1] -> [INCOMPLETE][2] ([i915#10137])
   [1]: 
https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_14288/fi-bsw-nick/igt@i915_selftest@l...@execlists.html
   [2]: 
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_130061v1/fi-bsw-nick/igt@i915_selftest@l...@execlists.html

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

  [i915#10137]: https://gitlab.freedesktop.org/drm/intel/issues/10137
  [i915#10234]: https://gitlab.freedesktop.org/drm/intel/issues/10234


Build changes
-

  * Linux: CI_DRM_14288 -> Patchwork_130061v1

  CI-20190529: 20190529
  CI_DRM_14288: cb7db7997fcacd6792fd2fd6e9e93309a408587a @ 
git://anongit.freedesktop.org/gfx-ci/linux
  IGT_7716: 7716
  Patchwork_130061v1: cb7db7997fcacd6792fd2fd6e9e93309a408587a @ 
git://anongit.freedesktop.org/gfx-ci/linux


### Linux commits

cc6f631b76c6 drm/i915/scaler: Update Pipe src size check for DISPLAY_VER >= 12

== Logs ==

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


[PATCH 2/2] drm/i915/lnl: Program PKGC_LATENCY register

2024-02-18 Thread Suraj Kandpal
If fixed refresh rate program the PKGC_LATENCY register
with the highest latency from level 1 and above LP registers
and program ADDED_WAKE_TIME = DSB execution time.
else program PKGC_LATENCY with all 1's and ADDED_WAKE_TIME as 0.
This is used to improve package C residency by sending the highest
latency tolerance requirement (LTR) when the planes are done with the
frame until the next frame programming window (set context latency,
window 2) starts.
Bspec: 68986

--v2
-Fix indentation [Chaitanya]

--v3
-Take into account if fixed refrersh rate or not [Vinod]
-Added wake time dependengt on DSB execution time [Vinod]
-Use REG_FIELD_PREP [Jani]
-Call program_pkgc_latency from appropriate place [Jani]
-no need for the ~0 while setting max latency [Jani]
-change commit message to add the new changes made in.

--v4
-Remove extra blank line [Vinod]
-move the vrr.enable check to previous loop [Vinod]

Signed-off-by: Suraj Kandpal 
Reviewed-by: Chaitanya Kumar Borah 
---
 drivers/gpu/drm/i915/display/intel_dsb.c |  2 +-
 drivers/gpu/drm/i915/display/skl_watermark.c | 54 +++-
 drivers/gpu/drm/i915/display/skl_watermark.h |  4 +-
 3 files changed, 55 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dsb.c 
b/drivers/gpu/drm/i915/display/intel_dsb.c
index a6c7122fd671..d62e050185e7 100644
--- a/drivers/gpu/drm/i915/display/intel_dsb.c
+++ b/drivers/gpu/drm/i915/display/intel_dsb.c
@@ -325,7 +325,7 @@ static int intel_dsb_dewake_scanline(const struct 
intel_crtc_state *crtc_state)
 {
struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev);
const struct drm_display_mode *adjusted_mode = 
_state->hw.adjusted_mode;
-   unsigned int latency = skl_watermark_max_latency(i915);
+   unsigned int latency = skl_watermark_max_latency(i915, 0);
int vblank_start;
 
if (crtc_state->vrr.enable) {
diff --git a/drivers/gpu/drm/i915/display/skl_watermark.c 
b/drivers/gpu/drm/i915/display/skl_watermark.c
index 614f319d754e..c6b9be80d83c 100644
--- a/drivers/gpu/drm/i915/display/skl_watermark.c
+++ b/drivers/gpu/drm/i915/display/skl_watermark.c
@@ -23,6 +23,12 @@
 #include "skl_watermark.h"
 #include "skl_watermark_regs.h"
 
+/*It is expected that DSB can do posted writes to every register in
+ * the pipe and planes within 100us. For flip queue use case, the
+ * recommended DSB execution time is 100us + one SAGV block time.
+ */
+#define DSB_EXE_TIME 100
+
 static void skl_sagv_disable(struct drm_i915_private *i915);
 
 /* Stores plane specific WM parameters */
@@ -2904,12 +2910,51 @@ static int skl_wm_add_affected_planes(struct 
intel_atomic_state *state,
return 0;
 }
 
+/*
+ * If Fixed Refresh Rate:
+ * Program DEEP PKG_C_LATENCY Pkg C with highest valid latency from
+ * watermark level1 and up and above. If watermark level 1 is
+ * invalid program it with all 1's.
+ * Program PKG_C_LATENCY Added Wake Time = DSB execution time
+ * If Variable Refresh Rate:
+ * Program DEEP PKG_C_LATENCY Pkg C with all 1's.
+ * Program PKG_C_LATENCY Added Wake Time = 0
+ */
+static void
+skl_program_dpkgc_latency(struct drm_i915_private *i915, bool vrr_enabled)
+{
+   u32 max_latency = 0;
+   u32 clear = 0, val = 0;
+   u32 added_wake_time = 0;
+
+   if (DISPLAY_VER(i915) < 20)
+   return;
+
+   if (vrr_enabled) {
+   max_latency = LNL_PKG_C_LATENCY_MASK;
+   added_wake_time = 0;
+   } else {
+   max_latency = skl_watermark_max_latency(i915, 1);
+   if (max_latency == 0)
+   max_latency = LNL_PKG_C_LATENCY_MASK;
+   added_wake_time = DSB_EXE_TIME +
+   i915->display.sagv.block_time_us;
+   }
+
+   clear |= LNL_ADDED_WAKE_TIME_MASK | LNL_PKG_C_LATENCY_MASK;
+   val |= REG_FIELD_PREP(LNL_PKG_C_LATENCY_MASK, max_latency);
+   val |= REG_FIELD_PREP(LNL_ADDED_WAKE_TIME_MASK, added_wake_time);
+
+   intel_uncore_rmw(>uncore, LNL_PKG_C_LATENCY, clear, val);
+}
+
 static int
 skl_compute_wm(struct intel_atomic_state *state)
 {
struct intel_crtc *crtc;
struct intel_crtc_state __maybe_unused *new_crtc_state;
int ret, i;
+   bool vrr_enabled = false;
 
for_each_new_intel_crtc_in_state(state, crtc, new_crtc_state, i) {
ret = skl_build_pipe_wm(state, crtc);
@@ -2934,8 +2979,13 @@ skl_compute_wm(struct intel_atomic_state *state)
ret = skl_wm_add_affected_planes(state, crtc);
if (ret)
return ret;
+
+   if (new_crtc_state->vrr.enable)
+   vrr_enabled = true;
}
 
+   skl_program_dpkgc_latency(to_i915(state->base.dev), vrr_enabled);
+
skl_print_wm_changes(state);
 
return 0;
@@ -3731,11 +3781,11 @@ void skl_watermark_debugfs_register(struct 
drm_i915_private *i915)
_sagv_status_fops);
 }
 
-unsigned int 

[PATCH] drm/i915/scaler: Update Pipe src size check for DISPLAY_VER >= 12

2024-02-18 Thread Ankit Nautiyal
For Earlier platforms, the Pipe source size is 12-bits so
max pipe source width and height is 4096. For newer platforms it is
13-bits so theoretically max height is 8192, but maximum width
supported on a single pipe is 5120, beyond which we need to use
bigjoiner.

Currently we are using max scaler source size to make sure that the
pipe source size is programmed within limits, before using scaler.
This creates a problem, for MTL where scaler source size is 4096, but
max pipe source width can be 5120.

Update the check to use the aforementioned limits.

Signed-off-by: Ankit Nautiyal 
---
 drivers/gpu/drm/i915/display/skl_scaler.c | 19 +++
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/skl_scaler.c 
b/drivers/gpu/drm/i915/display/skl_scaler.c
index 8a934bada624..36342142efaa 100644
--- a/drivers/gpu/drm/i915/display/skl_scaler.c
+++ b/drivers/gpu/drm/i915/display/skl_scaler.c
@@ -115,6 +115,7 @@ skl_update_scaler(struct intel_crtc_state *crtc_state, bool 
force_detach,
int pipe_src_h = drm_rect_height(_state->pipe_src);
int min_src_w, min_src_h, min_dst_w, min_dst_h;
int max_src_w, max_src_h, max_dst_w, max_dst_h;
+   int max_pipe_src_w, max_pipe_src_h;
 
/*
 * Src coordinates are already rotated by 270 degrees for
@@ -212,11 +213,21 @@ skl_update_scaler(struct intel_crtc_state *crtc_state, 
bool force_detach,
/*
 * The pipe scaler does not use all the bits of PIPESRC, at least
 * on the earlier platforms. So even when we're scaling a plane
-* the *pipe* source size must not be too large. For simplicity
-* we assume the limits match the scaler source size limits. Might
-* not be 100% accurate on all platforms, but good enough for now.
+* the *pipe* source size must not be too large.
+*
+* For Earlier platforms, the Pipe source size is 12-bits so
+* max pipe src width and height is 4096. For newer platforms it is 
13-bits.
+* Theoretically maximum pipe src height supported on a single pipe is 
8192,
+* but maximum pipe src width supported on a single pipe is 5120.
 */
-   if (pipe_src_w > max_src_w || pipe_src_h > max_src_h) {
+   if (DISPLAY_VER(dev_priv) < 12) {
+   max_pipe_src_w = 4096;
+   max_pipe_src_h = 4096;
+   } else {
+   max_pipe_src_w = 5120;
+   max_pipe_src_h = 8192;
+   }
+   if (pipe_src_w > max_pipe_src_w || pipe_src_h > max_pipe_src_h) {
drm_dbg_kms(_priv->drm,
"scaler_user index %u.%u: pipe src size %ux%u "
"is out of scaler range\n",
-- 
2.40.1



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

2024-02-18 Thread Stephen Rothwell
Hi all,

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

Documentation/gpu/i915:222: drivers/gpu/drm/i915/display/intel_cdclk.c:69: 
ERROR: Unexpected indentation.

Introduced by commit

  79e2ea2eaaa6 ("drm/i915/cdclk: Document CDCLK update methods")

-- 
Cheers,
Stephen Rothwell


pgpSiSHHKSJm5.pgp
Description: OpenPGP digital signature


RE: [PATCH 5/5] drm/xe/hdcp: Add intel_hdcp_gsc_message to Makefile

2024-02-18 Thread Kandpal, Suraj
> 
> Hey,
> 
> Where is xe_hdcp_gsc_message.c defined in this series?
> 
> I would move this part there.
> 

Hi Maarten
So there is no xe_hdcp_gsc_message.c but just intel_hdcp_gsc_message.c which\
Was separated from intel_hdcp_gsc.c for the purpose of code sharing and this
Patch just build the intel_hdcp_gsc_message.c here.
Also as I mentioned in comments of patch 4 I separated this here just for 
review purposes.
And will squash this patch with last one before getting this merged.

> On 2024-02-09 11:14, Suraj Kandpal wrote:
> > Add intel_hdcp_gsc_message to Makefile and add corresponding changes
> > to xe_hdcp_gsc.c to make it build.
> >
> > Signed-off-by: Suraj Kandpal 
> > ---
> >   drivers/gpu/drm/xe/Makefile  |  1 +
> >   drivers/gpu/drm/xe/display/xe_hdcp_gsc.c | 18 ++
> >   2 files changed, 19 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/xe/Makefile b/drivers/gpu/drm/xe/Makefile
> > index c531210695db..2b654c908ff3 100644
> > --- a/drivers/gpu/drm/xe/Makefile
> > +++ b/drivers/gpu/drm/xe/Makefile
> > @@ -254,6 +254,7 @@ xe-$(CONFIG_DRM_XE_DISPLAY) += \
> > i915-display/intel_global_state.o \
> > i915-display/intel_gmbus.o \
> > i915-display/intel_hdcp.o \
> > +   i915-display/intel_hdcp_gsc_message.o \
> > i915-display/intel_hdmi.o \
> > i915-display/intel_hotplug.o \
> > i915-display/intel_hotplug_irq.o \
> > diff --git a/drivers/gpu/drm/xe/display/xe_hdcp_gsc.c
> > b/drivers/gpu/drm/xe/display/xe_hdcp_gsc.c
> > index aa8c13916bb6..f185465d5682 100644
> > --- a/drivers/gpu/drm/xe/display/xe_hdcp_gsc.c
> > +++ b/drivers/gpu/drm/xe/display/xe_hdcp_gsc.c
> > @@ -5,9 +5,11 @@
> >
> >   #include 
> >   #include 
> > +#include 
> >
> >   #include "abi/gsc_command_header_abi.h"
> >   #include "intel_hdcp_gsc.h"
> > +#include "intel_hdcp_gsc_message.h"
> >   #include "xe_device_types.h"
> >   #include "xe_gt.h"
> >   #include "xe_gsc_proxy.h"
> > @@ -113,6 +115,22 @@ static int intel_hdcp_gsc_hdcp2_init(struct
> xe_device *xe)
> > return ret;
> >   }
> >
> > +static const struct i915_hdcp_ops gsc_hdcp_ops = {
> > +   .initiate_hdcp2_session = intel_hdcp_gsc_initiate_session,
> > +   .verify_receiver_cert_prepare_km =
> > +
>   intel_hdcp_gsc_verify_receiver_cert_prepare_km,
> > +   .verify_hprime = intel_hdcp_gsc_verify_hprime,
> > +   .store_pairing_info = intel_hdcp_gsc_store_pairing_info,
> > +   .initiate_locality_check = intel_hdcp_gsc_initiate_locality_check,
> > +   .verify_lprime = intel_hdcp_gsc_verify_lprime,
> > +   .get_session_key = intel_hdcp_gsc_get_session_key,
> > +   .repeater_check_flow_prepare_ack =
> > +
>   intel_hdcp_gsc_repeater_check_flow_prepare_ack,
> > +   .verify_mprime = intel_hdcp_gsc_verify_mprime,
> > +   .enable_hdcp_authentication =
> intel_hdcp_gsc_enable_authentication,
> > +   .close_hdcp_session = intel_hdcp_gsc_close_session, };
> The changes to xe_hdcp_gsc seems like it should be part of the previous
> commit?
> 
> Presumably also useful to reorder the Makefile change to before 4/5.
> 

Find my reply for this above

Regards,
Suraj Kandpal

> Cheers,
> Maarten


Re: [PATCH] drm/buddy: Modify duplicate list_splice_tail call

2024-02-18 Thread Arunpravin Paneer Selvam

Hi Christian,

On 2/16/2024 5:29 PM, Christian König wrote:



Am 16.02.24 um 12:46 schrieb Arunpravin Paneer Selvam:



On 2/16/2024 4:41 PM, Matthew Auld wrote:

On 16/02/2024 10:00, Arunpravin Paneer Selvam wrote:

Remove the duplicate list_splice_tail call when the
total_allocated < size condition is true.

Cc:  # 6.7+
Fixes: 8746c6c9dfa3 ("drm/buddy: Fix alloc_range() error handling 
code")

Reported-by: Bert Karwatzki 
Signed-off-by: Arunpravin Paneer Selvam 


---
  drivers/gpu/drm/drm_buddy.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_buddy.c b/drivers/gpu/drm/drm_buddy.c
index c1a99bf4dffd..c4222b886db7 100644
--- a/drivers/gpu/drm/drm_buddy.c
+++ b/drivers/gpu/drm/drm_buddy.c
@@ -538,13 +538,13 @@ static int __alloc_range(struct drm_buddy *mm,
  list_add(>left->tmp_link, dfs);
  } while (1);
  -    list_splice_tail(, blocks);
-
  if (total_allocated < size) {
  err = -ENOSPC;
  goto err_free;
  }
  +    list_splice_tail(, blocks);


Sigh. Can we extend the unit test(s) to catch this?

Sure, Let me check.


In the meantime I'm going to push this one to drm-misc-fixes.

Thank you!


Regards,
Christian.



Regards,
Arun.


Reviewed-by: Matthew Auld 


+
  return 0;
    err_undo:

base-commit: a64056bb5a3215bd31c8ce17d609ba0f4d5c55ea