diff mbox series

[11/16] drm/i915: Drop has_pxp from device info

Message ID 20220507132850.10272-11-jose.souza@intel.com (mailing list archive)
State New, archived
Headers show
Series [01/16] drm/i915: Drop has_llc from device info | expand

Commit Message

Souza, Jose May 7, 2022, 1:28 p.m. UTC
No need to have this parameter in intel_device_info struct
as all integrated platforms with graphics version 12 or newer supports
this feature.

As a side effect of the of removal this flag, it will not be printed
in dmesg during driver load anymore and developers will have to rely
on to check the macro and compare with platform being used and IP
versions of it.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h          | 2 +-
 drivers/gpu/drm/i915/i915_pci.c          | 4 +---
 drivers/gpu/drm/i915/intel_device_info.h | 1 -
 3 files changed, 2 insertions(+), 5 deletions(-)

Comments

kernel test robot May 7, 2022, 6:05 p.m. UTC | #1
Hi "José,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on drm-tip/drm-tip]
[cannot apply to drm-intel/for-linux-next linus/master v5.18-rc5 next-20220506]
[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]

url:    https://github.com/intel-lab-lkp/linux/commits/Jos-Roberto-de-Souza/drm-i915-Drop-has_llc-from-device-info/20220507-213117
base:   git://anongit.freedesktop.org/drm/drm-tip drm-tip
config: i386-randconfig-a011 (https://download.01.org/0day-ci/archive/20220508/202205080138.2kBqKQTb-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project af4cf1c6b8ed0d8102fc5e69acdc2fcbbcdaa9a7)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/c1a7677ed60d6907adf2824e35480433cde736ce
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Jos-Roberto-de-Souza/drm-i915-Drop-has_llc-from-device-info/20220507-213117
        git checkout c1a7677ed60d6907adf2824e35480433cde736ce
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/gpu/drm/i915/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> drivers/gpu/drm/i915/pxp/intel_pxp.c:115:3: error: expected ')'
                   return;
                   ^
   drivers/gpu/drm/i915/pxp/intel_pxp.c:114:2: note: to match this '('
           if (!HAS_PXP(gt->i915))
           ^
   include/linux/compiler.h:56:26: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                            ^
   1 error generated.
--
>> drivers/gpu/drm/i915/pxp/intel_pxp_debugfs.c:73:3: error: expected ')'
                   return;
                   ^
   drivers/gpu/drm/i915/pxp/intel_pxp_debugfs.c:72:2: note: to match this '('
           if (!HAS_PXP((pxp_to_gt(pxp)->i915)))
           ^
   include/linux/compiler.h:56:26: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                            ^
   drivers/gpu/drm/i915/pxp/intel_pxp_debugfs.c:61:6: warning: no previous prototype for function 'intel_pxp_debugfs_register' [-Wmissing-prototypes]
   void intel_pxp_debugfs_register(struct intel_pxp *pxp, struct dentry *gt_root)
        ^
   drivers/gpu/drm/i915/pxp/intel_pxp_debugfs.c:61:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void intel_pxp_debugfs_register(struct intel_pxp *pxp, struct dentry *gt_root)
   ^
   static 
   1 warning and 1 error generated.


vim +115 drivers/gpu/drm/i915/pxp/intel_pxp.c

3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24  108  
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24  109  void intel_pxp_init(struct intel_pxp *pxp)
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24  110  {
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24  111  	struct intel_gt *gt = pxp_to_gt(pxp);
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24  112  	int ret;
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24  113  
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24  114  	if (!HAS_PXP(gt->i915))
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24 @115  		return;
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24  116  
cbbd3764b2399a Huang, Sean Z          2021-09-24  117  	mutex_init(&pxp->tee_mutex);
cbbd3764b2399a Huang, Sean Z          2021-09-24  118  
2ae096872a2c61 Huang, Sean Z          2021-09-24  119  	/*
2ae096872a2c61 Huang, Sean Z          2021-09-24  120  	 * we'll use the completion to check if there is a termination pending,
2ae096872a2c61 Huang, Sean Z          2021-09-24  121  	 * so we start it as completed and we reinit it when a termination
2ae096872a2c61 Huang, Sean Z          2021-09-24  122  	 * is triggered.
2ae096872a2c61 Huang, Sean Z          2021-09-24  123  	 */
2ae096872a2c61 Huang, Sean Z          2021-09-24  124  	init_completion(&pxp->termination);
2ae096872a2c61 Huang, Sean Z          2021-09-24  125  	complete_all(&pxp->termination);
2ae096872a2c61 Huang, Sean Z          2021-09-24  126  
32271ecd6596e6 Daniele Ceraolo Spurio 2021-09-24  127  	mutex_init(&pxp->arb_mutex);
2ae096872a2c61 Huang, Sean Z          2021-09-24  128  	INIT_WORK(&pxp->session_work, intel_pxp_session_work);
2ae096872a2c61 Huang, Sean Z          2021-09-24  129  
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24  130  	ret = create_vcs_context(pxp);
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24  131  	if (ret)
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24  132  		return;
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24  133  
0436ac1b008d48 Huang, Sean Z          2021-09-24  134  	ret = intel_pxp_tee_component_init(pxp);
0436ac1b008d48 Huang, Sean Z          2021-09-24  135  	if (ret)
0436ac1b008d48 Huang, Sean Z          2021-09-24  136  		goto out_context;
0436ac1b008d48 Huang, Sean Z          2021-09-24  137  
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24  138  	drm_info(&gt->i915->drm, "Protected Xe Path (PXP) protected content support initialized\n");
0436ac1b008d48 Huang, Sean Z          2021-09-24  139  
0436ac1b008d48 Huang, Sean Z          2021-09-24  140  	return;
0436ac1b008d48 Huang, Sean Z          2021-09-24  141  
0436ac1b008d48 Huang, Sean Z          2021-09-24  142  out_context:
0436ac1b008d48 Huang, Sean Z          2021-09-24  143  	destroy_vcs_context(pxp);
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24  144  }
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24  145
kernel test robot May 7, 2022, 7:47 p.m. UTC | #2
Hi "José,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on drm-tip/drm-tip]
[cannot apply to drm-intel/for-linux-next linus/master v5.18-rc5 next-20220506]
[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]

url:    https://github.com/intel-lab-lkp/linux/commits/Jos-Roberto-de-Souza/drm-i915-Drop-has_llc-from-device-info/20220507-213117
base:   git://anongit.freedesktop.org/drm/drm-tip drm-tip
config: i386-allyesconfig (https://download.01.org/0day-ci/archive/20220508/202205080306.RJOsIJwU-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.2.0-20) 11.2.0
reproduce (this is a W=1 build):
        # https://github.com/intel-lab-lkp/linux/commit/c1a7677ed60d6907adf2824e35480433cde736ce
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Jos-Roberto-de-Souza/drm-i915-Drop-has_llc-from-device-info/20220507-213117
        git checkout c1a7677ed60d6907adf2824e35480433cde736ce
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   drivers/gpu/drm/i915/pxp/intel_pxp.c: In function 'intel_pxp_init':
>> drivers/gpu/drm/i915/pxp/intel_pxp.c:114:32: error: expected ')' before 'return'
     114 |         if (!HAS_PXP(gt->i915))
         |            ~                   ^
         |                                )
     115 |                 return;
         |                 ~~~~~~          
>> drivers/gpu/drm/i915/pxp/intel_pxp.c:144:1: error: expected expression before '}' token
     144 | }
         | ^
>> drivers/gpu/drm/i915/pxp/intel_pxp.c:112:13: error: unused variable 'ret' [-Werror=unused-variable]
     112 |         int ret;
         |             ^~~
   At top level:
>> drivers/gpu/drm/i915/pxp/intel_pxp.c:74:12: error: 'create_vcs_context' defined but not used [-Werror=unused-function]
      74 | static int create_vcs_context(struct intel_pxp *pxp)
         |            ^~~~~~~~~~~~~~~~~~
   cc1: all warnings being treated as errors
--
   drivers/gpu/drm/i915/pxp/intel_pxp_debugfs.c:61:6: error: no previous prototype for 'intel_pxp_debugfs_register' [-Werror=missing-prototypes]
      61 | void intel_pxp_debugfs_register(struct intel_pxp *pxp, struct dentry *gt_root)
         |      ^~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/i915/pxp/intel_pxp_debugfs.c: In function 'intel_pxp_debugfs_register':
>> drivers/gpu/drm/i915/pxp/intel_pxp_debugfs.c:72:46: error: expected ')' before 'return'
      72 |         if (!HAS_PXP((pxp_to_gt(pxp)->i915)))
         |            ~                                 ^
         |                                              )
      73 |                 return;
         |                 ~~~~~~                        
>> drivers/gpu/drm/i915/pxp/intel_pxp_debugfs.c:80:1: error: expected expression before '}' token
      80 | }
         | ^
>> drivers/gpu/drm/i915/pxp/intel_pxp_debugfs.c:67:24: error: unused variable 'root' [-Werror=unused-variable]
      67 |         struct dentry *root;
         |                        ^~~~
>> drivers/gpu/drm/i915/pxp/intel_pxp_debugfs.c:63:51: error: unused variable 'files' [-Werror=unused-variable]
      63 |         static const struct intel_gt_debugfs_file files[] = {
         |                                                   ^~~~~
   At top level:
>> drivers/gpu/drm/i915/pxp/intel_pxp_debugfs.c:63:51: error: 'files' defined but not used [-Werror=unused-const-variable=]
   cc1: all warnings being treated as errors


vim +114 drivers/gpu/drm/i915/pxp/intel_pxp.c

e0111ce0f5cbd2 Daniele Ceraolo Spurio 2021-09-24   73  
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24  @74  static int create_vcs_context(struct intel_pxp *pxp)
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24   75  {
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24   76  	static struct lock_class_key pxp_lock;
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24   77  	struct intel_gt *gt = pxp_to_gt(pxp);
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24   78  	struct intel_engine_cs *engine;
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24   79  	struct intel_context *ce;
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24   80  	int i;
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24   81  
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24   82  	/*
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24   83  	 * Find the first VCS engine present. We're guaranteed there is one
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24   84  	 * if we're in this function due to the check in has_pxp
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24   85  	 */
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24   86  	for (i = 0, engine = NULL; !engine; i++)
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24   87  		engine = gt->engine_class[VIDEO_DECODE_CLASS][i];
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24   88  
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24   89  	GEM_BUG_ON(!engine || engine->class != VIDEO_DECODE_CLASS);
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24   90  
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24   91  	ce = intel_engine_create_pinned_context(engine, engine->gt->vm, SZ_4K,
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24   92  						I915_GEM_HWS_PXP_ADDR,
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24   93  						&pxp_lock, "pxp_context");
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24   94  	if (IS_ERR(ce)) {
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24   95  		drm_err(&gt->i915->drm, "failed to create VCS ctx for PXP\n");
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24   96  		return PTR_ERR(ce);
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24   97  	}
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24   98  
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24   99  	pxp->ce = ce;
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24  100  
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24  101  	return 0;
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24  102  }
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24  103  
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24  104  static void destroy_vcs_context(struct intel_pxp *pxp)
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24  105  {
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24  106  	intel_engine_destroy_pinned_context(fetch_and_zero(&pxp->ce));
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24  107  }
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24  108  
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24  109  void intel_pxp_init(struct intel_pxp *pxp)
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24  110  {
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24  111  	struct intel_gt *gt = pxp_to_gt(pxp);
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24 @112  	int ret;
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24  113  
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24 @114  	if (!HAS_PXP(gt->i915))
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24  115  		return;
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24  116  
cbbd3764b2399a Huang, Sean Z          2021-09-24  117  	mutex_init(&pxp->tee_mutex);
cbbd3764b2399a Huang, Sean Z          2021-09-24  118  
2ae096872a2c61 Huang, Sean Z          2021-09-24  119  	/*
2ae096872a2c61 Huang, Sean Z          2021-09-24  120  	 * we'll use the completion to check if there is a termination pending,
2ae096872a2c61 Huang, Sean Z          2021-09-24  121  	 * so we start it as completed and we reinit it when a termination
2ae096872a2c61 Huang, Sean Z          2021-09-24  122  	 * is triggered.
2ae096872a2c61 Huang, Sean Z          2021-09-24  123  	 */
2ae096872a2c61 Huang, Sean Z          2021-09-24  124  	init_completion(&pxp->termination);
2ae096872a2c61 Huang, Sean Z          2021-09-24  125  	complete_all(&pxp->termination);
2ae096872a2c61 Huang, Sean Z          2021-09-24  126  
32271ecd6596e6 Daniele Ceraolo Spurio 2021-09-24  127  	mutex_init(&pxp->arb_mutex);
2ae096872a2c61 Huang, Sean Z          2021-09-24  128  	INIT_WORK(&pxp->session_work, intel_pxp_session_work);
2ae096872a2c61 Huang, Sean Z          2021-09-24  129  
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24  130  	ret = create_vcs_context(pxp);
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24  131  	if (ret)
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24  132  		return;
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24  133  
0436ac1b008d48 Huang, Sean Z          2021-09-24  134  	ret = intel_pxp_tee_component_init(pxp);
0436ac1b008d48 Huang, Sean Z          2021-09-24  135  	if (ret)
0436ac1b008d48 Huang, Sean Z          2021-09-24  136  		goto out_context;
0436ac1b008d48 Huang, Sean Z          2021-09-24  137  
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24  138  	drm_info(&gt->i915->drm, "Protected Xe Path (PXP) protected content support initialized\n");
0436ac1b008d48 Huang, Sean Z          2021-09-24  139  
0436ac1b008d48 Huang, Sean Z          2021-09-24  140  	return;
0436ac1b008d48 Huang, Sean Z          2021-09-24  141  
0436ac1b008d48 Huang, Sean Z          2021-09-24  142  out_context:
0436ac1b008d48 Huang, Sean Z          2021-09-24  143  	destroy_vcs_context(pxp);
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24 @144  }
3ad2dd9c4caa73 Daniele Ceraolo Spurio 2021-09-24  145
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 6daf4b82c131f..29e5017e64d70 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1368,7 +1368,7 @@  IS_SUBPLATFORM(const struct drm_i915_private *i915,
 #define HAS_GLOBAL_MOCS_REGISTERS(dev_priv)	(GRAPHICS_VER(dev_priv) >= 12)
 
 #define HAS_PXP(dev_priv)  ((IS_ENABLED(CONFIG_DRM_I915_PXP) && \
-			    INTEL_INFO(dev_priv)->has_pxp) && \
+			    (!IS_DGFX(dev_priv) && GRAPHICS_VER(dev_priv) >= 12) && \
 			    VDBOX_MASK(to_gt(dev_priv)))
 
 #define HAS_GMCH(dev_priv) (INTEL_INFO(dev_priv)->display.has_gmch)
diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
index 48cfb0ee56bf3..e8afaa0344134 100644
--- a/drivers/gpu/drm/i915/i915_pci.c
+++ b/drivers/gpu/drm/i915/i915_pci.c
@@ -834,8 +834,7 @@  static const struct intel_device_info jsl_info = {
 		[TRANSCODER_DSI_0] = TRANSCODER_DSI0_OFFSET, \
 		[TRANSCODER_DSI_1] = TRANSCODER_DSI1_OFFSET, \
 	}, \
-	TGL_CURSOR_OFFSETS, \
-	.has_pxp = 1
+	TGL_CURSOR_OFFSETS
 
 static const struct intel_device_info tgl_info = {
 	GEN12_FEATURES,
@@ -859,7 +858,6 @@  static const struct intel_device_info rkl_info = {
 
 #define DGFX_FEATURES \
 	.memory_regions = REGION_SMEM | REGION_LMEM | REGION_STOLEN_LMEM, \
-	.has_pxp = 0, \
 	.has_snoop = 1, \
 	.is_dgfx = 1, \
 	.has_heci_gscfi = 1
diff --git a/drivers/gpu/drm/i915/intel_device_info.h b/drivers/gpu/drm/i915/intel_device_info.h
index a199031b5a6ec..edbd76aa31a9c 100644
--- a/drivers/gpu/drm/i915/intel_device_info.h
+++ b/drivers/gpu/drm/i915/intel_device_info.h
@@ -148,7 +148,6 @@  enum intel_ppgtt_type {
 	func(has_logical_ring_contexts); \
 	func(has_mslices); \
 	func(has_pooled_eu); \
-	func(has_pxp); \
 	func(has_rps); \
 	func(has_runtime_pm); \
 	func(has_snoop); \