mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] drm/imagination: GPU_ID-related cleanups
@ 2026-02-06  9:56 Matt Coster
  2026-02-06  9:56 ` [PATCH 1/2] drm/imagination: Define packed BVNCs in the uapi Matt Coster
  2026-02-06  9:56 ` [PATCH 2/2] drm/imagination: Add PVR_GPU_ID_FMT to format pvr_gpu_id Matt Coster
  0 siblings, 2 replies; 5+ messages in thread
From: Matt Coster @ 2026-02-06  9:56 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Simona Vetter
  Cc: Frank Binns, Brajesh Gupta, Alessio Belle, Alexandru Dadu,
	dri-devel, linux-kernel, Matt Coster

Just a couple quick QoL improvements around GPU_IDs.

The first patch touches the UAPI, but is not intended to introduce any
functional changes; it simply codifies the existing documented layout of
packed BVNC fields as a series of GENMASKed macros.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
---
Matt Coster (2):
      drm/imagination: Define packed BVNCs in the uapi
      drm/imagination: Add PVR_GPU_ID_FMT to format pvr_gpu_id

 drivers/gpu/drm/imagination/pvr_device.c |  4 +--
 drivers/gpu/drm/imagination/pvr_device.h | 42 +++++++++++++-------------------
 drivers/gpu/drm/imagination/pvr_fw.c     | 12 ++++-----
 include/uapi/drm/pvr_drm.h               | 14 +++++------
 4 files changed, 31 insertions(+), 41 deletions(-)
---
base-commit: 55473b60178060a4fdb4631bd0c91879cc7d18d8
change-id: 20260206-bvnc-cleanup-446e70666747


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] drm/imagination: Define packed BVNCs in the uapi
  2026-02-06  9:56 [PATCH 0/2] drm/imagination: GPU_ID-related cleanups Matt Coster
@ 2026-02-06  9:56 ` Matt Coster
  2026-02-06 18:57   ` kernel test robot
  2026-02-06 21:58   ` kernel test robot
  2026-02-06  9:56 ` [PATCH 2/2] drm/imagination: Add PVR_GPU_ID_FMT to format pvr_gpu_id Matt Coster
  1 sibling, 2 replies; 5+ messages in thread
From: Matt Coster @ 2026-02-06  9:56 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Simona Vetter
  Cc: Frank Binns, Brajesh Gupta, Alessio Belle, Alexandru Dadu,
	dri-devel, linux-kernel, Matt Coster

Using the uapi-safe __GENMASK_ULL(), we can stably define the layout of
64-bit packed BVNCs. These defs replace the replicated doc comment that
appears all over the place.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
---
 drivers/gpu/drm/imagination/pvr_device.h | 36 ++++++++++----------------------
 include/uapi/drm/pvr_drm.h               | 14 ++++++-------
 2 files changed, 18 insertions(+), 32 deletions(-)

diff --git a/drivers/gpu/drm/imagination/pvr_device.h b/drivers/gpu/drm/imagination/pvr_device.h
index cfda215e7428..58f0eae05ad9 100644
--- a/drivers/gpu/drm/imagination/pvr_device.h
+++ b/drivers/gpu/drm/imagination/pvr_device.h
@@ -14,7 +14,7 @@
 #include <drm/drm_file.h>
 #include <drm/drm_mm.h>
 
-#include <linux/bits.h>
+#include <linux/bitfield.h>
 #include <linux/compiler_attributes.h>
 #include <linux/compiler_types.h>
 #include <linux/device.h>
@@ -479,39 +479,25 @@ struct pvr_file {
  * @n: Number of scalable units.
  * @c: Config ID.
  *
- * The packed layout is as follows:
- *
- *    +--------+--------+--------+-------+
- *    | 63..48 | 47..32 | 31..16 | 15..0 |
- *    +========+========+========+=======+
- *    | B      | V      | N      | C     |
- *    +--------+--------+--------+-------+
+ * The packed layout follows the bitfield defined by the DRM_PVR_BVNC_* macros.
  *
  * pvr_gpu_id_to_packed_bvnc() should be used instead of this macro when a
  * &struct pvr_gpu_id is available in order to ensure proper type checking.
  *
  * Return: Packed BVNC.
  */
-/* clang-format off */
 #define PVR_PACKED_BVNC(b, v, n, c) \
-	((((u64)(b) & GENMASK_ULL(15, 0)) << 48) | \
-	 (((u64)(v) & GENMASK_ULL(15, 0)) << 32) | \
-	 (((u64)(n) & GENMASK_ULL(15, 0)) << 16) | \
-	 (((u64)(c) & GENMASK_ULL(15, 0)) <<  0))
-/* clang-format on */
+	(FIELD_PREP(DRM_PVR_BVNC_B, b) | \
+	 FIELD_PREP(DRM_PVR_BVNC_V, v) | \
+	 FIELD_PREP(DRM_PVR_BVNC_N, n) | \
+	 FIELD_PREP(DRM_PVR_BVNC_C, c))
 
 /**
  * pvr_gpu_id_to_packed_bvnc() - Packs B, V, N and C values into a 64-bit
  * unsigned integer
  * @gpu_id: GPU ID.
  *
- * The packed layout is as follows:
- *
- *    +--------+--------+--------+-------+
- *    | 63..48 | 47..32 | 31..16 | 15..0 |
- *    +========+========+========+=======+
- *    | B      | V      | N      | C     |
- *    +--------+--------+--------+-------+
+ * The packed layout follows the bitfield defined by the DRM_PVR_BVNC_* macros.
  *
  * This should be used in preference to PVR_PACKED_BVNC() when a &struct
  * pvr_gpu_id is available in order to ensure proper type checking.
@@ -527,10 +513,10 @@ pvr_gpu_id_to_packed_bvnc(const struct pvr_gpu_id *gpu_id)
 static __always_inline void
 packed_bvnc_to_pvr_gpu_id(u64 bvnc, struct pvr_gpu_id *gpu_id)
 {
-	gpu_id->b = (bvnc & GENMASK_ULL(63, 48)) >> 48;
-	gpu_id->v = (bvnc & GENMASK_ULL(47, 32)) >> 32;
-	gpu_id->n = (bvnc & GENMASK_ULL(31, 16)) >> 16;
-	gpu_id->c = bvnc & GENMASK_ULL(15, 0);
+	gpu_id->b = FIELD_GET(DRM_PVR_BVNC_B, bvnc);
+	gpu_id->v = FIELD_GET(DRM_PVR_BVNC_V, bvnc);
+	gpu_id->n = FIELD_GET(DRM_PVR_BVNC_N, bvnc);
+	gpu_id->c = FIELD_GET(DRM_PVR_BVNC_C, bvnc);
 }
 
 int pvr_device_init(struct pvr_device *pvr_dev);
diff --git a/include/uapi/drm/pvr_drm.h b/include/uapi/drm/pvr_drm.h
index ccf6c2112468..72f3f90560cf 100644
--- a/include/uapi/drm/pvr_drm.h
+++ b/include/uapi/drm/pvr_drm.h
@@ -6,6 +6,7 @@
 
 #include "drm.h"
 
+#include <linux/bits.h>
 #include <linux/const.h>
 #include <linux/types.h>
 
@@ -113,6 +114,11 @@ struct drm_pvr_obj_array {
  * DOC: PowerVR IOCTL DEV_QUERY interface
  */
 
+#define DRM_PVR_BVNC_B __GENMASK_ULL(63, 48)
+#define DRM_PVR_BVNC_V __GENMASK_ULL(47, 32)
+#define DRM_PVR_BVNC_N __GENMASK_ULL(31, 16)
+#define DRM_PVR_BVNC_C __GENMASK_ULL(15, 0)
+
 /**
  * struct drm_pvr_dev_query_gpu_info - Container used to fetch information about
  * the graphics processor.
@@ -125,13 +131,7 @@ struct drm_pvr_dev_query_gpu_info {
 	 * @gpu_id: GPU identifier.
 	 *
 	 * For all currently supported GPUs this is the BVNC encoded as a 64-bit
-	 * value as follows:
-	 *
-	 *    +--------+--------+--------+-------+
-	 *    | 63..48 | 47..32 | 31..16 | 15..0 |
-	 *    +========+========+========+=======+
-	 *    | B      | V      | N      | C     |
-	 *    +--------+--------+--------+-------+
+	 * value using the DRM_PVR_BVNC_* bitmasks.
 	 */
 	__u64 gpu_id;
 

-- 
2.52.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 2/2] drm/imagination: Add PVR_GPU_ID_FMT to format pvr_gpu_id
  2026-02-06  9:56 [PATCH 0/2] drm/imagination: GPU_ID-related cleanups Matt Coster
  2026-02-06  9:56 ` [PATCH 1/2] drm/imagination: Define packed BVNCs in the uapi Matt Coster
@ 2026-02-06  9:56 ` Matt Coster
  1 sibling, 0 replies; 5+ messages in thread
From: Matt Coster @ 2026-02-06  9:56 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Simona Vetter
  Cc: Frank Binns, Brajesh Gupta, Alessio Belle, Alexandru Dadu,
	dri-devel, linux-kernel, Matt Coster

There are currently two different combinations of format specifiers used to
print a struct pvr_gpu_id, one using %i and one using %d. Both of these
are technically incorrect since the components are stored as u16.

Introduce macros to simplify and correct the formatting of these values:
 - PVR_GPU_ID_FMT: A pre-constructed format string fragment, in the style
   of PRIu32.
 - PVR_GPU_ID_FMT_ARGS(): Accepts a &struct pvr_gpu_id and expands the
   fields into appropriate format arguments to be used with PVR_GPU_ID_FMT.
 - PVR_GPU_ID_FMT_ARGS_PACKED(): Accepts a packed GPUID as a u64 and
   extracts the components directly into appropriate format arguments to
   be used with PVR_GPU_ID_FMT.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
---
 drivers/gpu/drm/imagination/pvr_device.c |  4 ++--
 drivers/gpu/drm/imagination/pvr_device.h |  6 ++++++
 drivers/gpu/drm/imagination/pvr_fw.c     | 12 +++++-------
 3 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/imagination/pvr_device.c b/drivers/gpu/drm/imagination/pvr_device.c
index f58bb66a6327..e032ebe1e505 100644
--- a/drivers/gpu/drm/imagination/pvr_device.c
+++ b/drivers/gpu/drm/imagination/pvr_device.c
@@ -362,8 +362,8 @@ pvr_build_firmware_filename(struct pvr_device *pvr_dev, const char *base,
 {
 	struct pvr_gpu_id *gpu_id = &pvr_dev->gpu_id;
 
-	return kasprintf(GFP_KERNEL, "%s_%d.%d.%d.%d_v%d.fw", base, gpu_id->b,
-			 gpu_id->v, gpu_id->n, gpu_id->c, major);
+	return kasprintf(GFP_KERNEL, "%s_" PVR_GPU_ID_FMT "_v%d.fw", base,
+			 PVR_GPU_ID_FMT_ARGS(gpu_id), major);
 }
 
 static void
diff --git a/drivers/gpu/drm/imagination/pvr_device.h b/drivers/gpu/drm/imagination/pvr_device.h
index 58f0eae05ad9..4213eb8dd7cd 100644
--- a/drivers/gpu/drm/imagination/pvr_device.h
+++ b/drivers/gpu/drm/imagination/pvr_device.h
@@ -53,6 +53,12 @@ struct pvr_gpu_id {
 	u16 b, v, n, c;
 };
 
+#define PVR_GPU_ID_FMT "%u.%u.%u.%u"
+#define PVR_GPU_ID_FMT_ARGS(gpu_id) (gpu_id)->b, (gpu_id)->v, (gpu_id)->n, (gpu_id)->c
+#define PVR_GPU_ID_FMT_ARGS_PACKED(gpu_id) \
+	(u32)FIELD_GET(DRM_PVR_BVNC_B, gpu_id), (u32)FIELD_GET(DRM_PVR_BVNC_V, gpu_id), \
+	(u32)FIELD_GET(DRM_PVR_BVNC_N, gpu_id), (u32)FIELD_GET(DRM_PVR_BVNC_C, gpu_id)
+
 /**
  * struct pvr_fw_version - Firmware version information
  * @major: Major version number.
diff --git a/drivers/gpu/drm/imagination/pvr_fw.c b/drivers/gpu/drm/imagination/pvr_fw.c
index 779a58fe6ee8..b258c5a4f433 100644
--- a/drivers/gpu/drm/imagination/pvr_fw.c
+++ b/drivers/gpu/drm/imagination/pvr_fw.c
@@ -125,13 +125,11 @@ pvr_fw_validate(struct pvr_device *pvr_dev)
 		return -EINVAL;
 	}
 
-	if (pvr_gpu_id_to_packed_bvnc(&pvr_dev->gpu_id) != header->bvnc) {
-		struct pvr_gpu_id fw_gpu_id;
-
-		packed_bvnc_to_pvr_gpu_id(header->bvnc, &fw_gpu_id);
-		drm_err(drm_dev, "FW built for incorrect GPU ID %i.%i.%i.%i (expected %i.%i.%i.%i)\n",
-			fw_gpu_id.b, fw_gpu_id.v, fw_gpu_id.n, fw_gpu_id.c,
-			pvr_dev->gpu_id.b, pvr_dev->gpu_id.v, pvr_dev->gpu_id.n, pvr_dev->gpu_id.c);
+	u64 device_gpu_id_packed = pvr_gpu_id_to_packed_bvnc(&pvr_dev->gpu_id);
+	if (device_gpu_id_packed != header->bvnc) {
+		drm_err(drm_dev, "FW built for incorrect GPU ID " PVR_GPU_ID_FMT " (expected " PVR_GPU_ID_FMT ")\n",
+			PVR_GPU_ID_FMT_ARGS_PACKED(header->bvnc),
+			PVR_GPU_ID_FMT_ARGS_PACKED(device_gpu_id_packed));
 		return -EINVAL;
 	}
 

-- 
2.52.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] drm/imagination: Define packed BVNCs in the uapi
  2026-02-06  9:56 ` [PATCH 1/2] drm/imagination: Define packed BVNCs in the uapi Matt Coster
@ 2026-02-06 18:57   ` kernel test robot
  2026-02-06 21:58   ` kernel test robot
  1 sibling, 0 replies; 5+ messages in thread
From: kernel test robot @ 2026-02-06 18:57 UTC (permalink / raw)
  To: Matt Coster, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Simona Vetter
  Cc: oe-kbuild-all, Frank Binns, Brajesh Gupta, Alessio Belle,
	Alexandru Dadu, dri-devel, linux-kernel, Matt Coster

Hi Matt,

kernel test robot noticed the following build errors:

[auto build test ERROR on 55473b60178060a4fdb4631bd0c91879cc7d18d8]

url:    https://github.com/intel-lab-lkp/linux/commits/Matt-Coster/drm-imagination-Define-packed-BVNCs-in-the-uapi/20260206-175844
base:   55473b60178060a4fdb4631bd0c91879cc7d18d8
patch link:    https://lore.kernel.org/r/20260206-bvnc-cleanup-v1-1-f3c818541fbe%40imgtec.com
patch subject: [PATCH 1/2] drm/imagination: Define packed BVNCs in the uapi
config: riscv-randconfig-r112-20260206 (https://download.01.org/0day-ci/archive/20260207/202602070204.PjaKNSpZ-lkp@intel.com/config)
compiler: riscv64-linux-gcc (GCC) 10.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260207/202602070204.PjaKNSpZ-lkp@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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202602070204.PjaKNSpZ-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/gpu/drm/imagination/pvr_device.c: In function 'pvr_gpu_support_level':
>> drivers/gpu/drm/imagination/pvr_device.c:550:2: error: case label does not reduce to an integer constant
     550 |  case PVR_PACKED_BVNC(33, 15, 11, 3):
         |  ^~~~
   drivers/gpu/drm/imagination/pvr_device.c:551:2: error: case label does not reduce to an integer constant
     551 |  case PVR_PACKED_BVNC(36, 53, 104, 796):
         |  ^~~~
   drivers/gpu/drm/imagination/pvr_device.c:554:2: error: case label does not reduce to an integer constant
     554 |  case PVR_PACKED_BVNC(36, 52, 104, 182):
         |  ^~~~


vim +550 drivers/gpu/drm/imagination/pvr_device.c

1c21f240fbc1e4 Matt Coster 2026-01-13  545  
1c21f240fbc1e4 Matt Coster 2026-01-13  546  static enum pvr_gpu_support_level
1c21f240fbc1e4 Matt Coster 2026-01-13  547  pvr_gpu_support_level(const struct pvr_gpu_id *gpu_id)
1c21f240fbc1e4 Matt Coster 2026-01-13  548  {
1c21f240fbc1e4 Matt Coster 2026-01-13  549  	switch (pvr_gpu_id_to_packed_bvnc(gpu_id)) {
1c21f240fbc1e4 Matt Coster 2026-01-13 @550  	case PVR_PACKED_BVNC(33, 15, 11, 3):
1c21f240fbc1e4 Matt Coster 2026-01-13  551  	case PVR_PACKED_BVNC(36, 53, 104, 796):
1c21f240fbc1e4 Matt Coster 2026-01-13  552  		return PVR_GPU_SUPPORTED;
1c21f240fbc1e4 Matt Coster 2026-01-13  553  
1c21f240fbc1e4 Matt Coster 2026-01-13  554  	case PVR_PACKED_BVNC(36, 52, 104, 182):
1c21f240fbc1e4 Matt Coster 2026-01-13  555  		return PVR_GPU_EXPERIMENTAL;
1c21f240fbc1e4 Matt Coster 2026-01-13  556  
1c21f240fbc1e4 Matt Coster 2026-01-13  557  	default:
1c21f240fbc1e4 Matt Coster 2026-01-13  558  		return PVR_GPU_UNKNOWN;
1c21f240fbc1e4 Matt Coster 2026-01-13  559  	}
1c21f240fbc1e4 Matt Coster 2026-01-13  560  }
1c21f240fbc1e4 Matt Coster 2026-01-13  561  

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] drm/imagination: Define packed BVNCs in the uapi
  2026-02-06  9:56 ` [PATCH 1/2] drm/imagination: Define packed BVNCs in the uapi Matt Coster
  2026-02-06 18:57   ` kernel test robot
@ 2026-02-06 21:58   ` kernel test robot
  1 sibling, 0 replies; 5+ messages in thread
From: kernel test robot @ 2026-02-06 21:58 UTC (permalink / raw)
  To: Matt Coster, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Simona Vetter
  Cc: llvm, oe-kbuild-all, Frank Binns, Brajesh Gupta, Alessio Belle,
	Alexandru Dadu, dri-devel, linux-kernel, Matt Coster

Hi Matt,

kernel test robot noticed the following build errors:

[auto build test ERROR on 55473b60178060a4fdb4631bd0c91879cc7d18d8]

url:    https://github.com/intel-lab-lkp/linux/commits/Matt-Coster/drm-imagination-Define-packed-BVNCs-in-the-uapi/20260206-175844
base:   55473b60178060a4fdb4631bd0c91879cc7d18d8
patch link:    https://lore.kernel.org/r/20260206-bvnc-cleanup-v1-1-f3c818541fbe%40imgtec.com
patch subject: [PATCH 1/2] drm/imagination: Define packed BVNCs in the uapi
config: riscv-randconfig-001-20260206 (https://download.01.org/0day-ci/archive/20260207/202602070500.zo0DrH6U-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 9b8addffa70cee5b2acc5454712d9cf78ce45710)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260207/202602070500.zo0DrH6U-lkp@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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202602070500.zo0DrH6U-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/gpu/drm/imagination/pvr_device.c:550:7: error: expression is not an integer constant expression
     550 |         case PVR_PACKED_BVNC(33, 15, 11, 3):
         |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/imagination/pvr_device.h:490:2: note: expanded from macro 'PVR_PACKED_BVNC'
     490 |         (FIELD_PREP(DRM_PVR_BVNC_B, b) | \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     491 |          FIELD_PREP(DRM_PVR_BVNC_V, v) | \
         |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     492 |          FIELD_PREP(DRM_PVR_BVNC_N, n) | \
         |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     493 |          FIELD_PREP(DRM_PVR_BVNC_C, c))
         |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/imagination/pvr_device.c:550:7: note: this use of statement expressions is not supported in a constant expression
   drivers/gpu/drm/imagination/pvr_device.h:490:3: note: expanded from macro 'PVR_PACKED_BVNC'
     490 |         (FIELD_PREP(DRM_PVR_BVNC_B, b) | \
         |          ^
   include/linux/bitfield.h:137:3: note: expanded from macro 'FIELD_PREP'
     137 |                 __FIELD_PREP(_mask, _val, "FIELD_PREP: ");              \
         |                 ^
   include/linux/bitfield.h:90:3: note: expanded from macro '__FIELD_PREP'
      90 |                 __BF_FIELD_CHECK_MASK(mask, val, pfx);                  \
         |                 ^
   note: (skipping 4 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/compiler_types.h:631:2: note: expanded from macro 'compiletime_assert'
     631 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
         |         ^
   include/linux/compiler_types.h:619:2: note: expanded from macro '_compiletime_assert'
     619 |         __compiletime_assert(condition, msg, prefix, suffix)
         |         ^
   include/linux/compiler_types.h:603:2: note: expanded from macro '__compiletime_assert'
     603 |         do {                                                            \
         |         ^
   drivers/gpu/drm/imagination/pvr_device.c:551:7: error: expression is not an integer constant expression
     551 |         case PVR_PACKED_BVNC(36, 53, 104, 796):
         |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/imagination/pvr_device.h:490:2: note: expanded from macro 'PVR_PACKED_BVNC'
     490 |         (FIELD_PREP(DRM_PVR_BVNC_B, b) | \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     491 |          FIELD_PREP(DRM_PVR_BVNC_V, v) | \
         |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     492 |          FIELD_PREP(DRM_PVR_BVNC_N, n) | \
         |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     493 |          FIELD_PREP(DRM_PVR_BVNC_C, c))
         |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/imagination/pvr_device.c:551:7: note: this use of statement expressions is not supported in a constant expression
   drivers/gpu/drm/imagination/pvr_device.h:490:3: note: expanded from macro 'PVR_PACKED_BVNC'
     490 |         (FIELD_PREP(DRM_PVR_BVNC_B, b) | \
         |          ^
   include/linux/bitfield.h:137:3: note: expanded from macro 'FIELD_PREP'
     137 |                 __FIELD_PREP(_mask, _val, "FIELD_PREP: ");              \
         |                 ^
   include/linux/bitfield.h:90:3: note: expanded from macro '__FIELD_PREP'
      90 |                 __BF_FIELD_CHECK_MASK(mask, val, pfx);                  \
         |                 ^
   note: (skipping 4 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/compiler_types.h:631:2: note: expanded from macro 'compiletime_assert'
     631 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
         |         ^
   include/linux/compiler_types.h:619:2: note: expanded from macro '_compiletime_assert'
     619 |         __compiletime_assert(condition, msg, prefix, suffix)
         |         ^
   include/linux/compiler_types.h:603:2: note: expanded from macro '__compiletime_assert'
     603 |         do {                                                            \
         |         ^
   drivers/gpu/drm/imagination/pvr_device.c:554:7: error: expression is not an integer constant expression
     554 |         case PVR_PACKED_BVNC(36, 52, 104, 182):
         |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/imagination/pvr_device.h:490:2: note: expanded from macro 'PVR_PACKED_BVNC'
     490 |         (FIELD_PREP(DRM_PVR_BVNC_B, b) | \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     491 |          FIELD_PREP(DRM_PVR_BVNC_V, v) | \
         |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     492 |          FIELD_PREP(DRM_PVR_BVNC_N, n) | \
         |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     493 |          FIELD_PREP(DRM_PVR_BVNC_C, c))
         |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/imagination/pvr_device.c:554:7: note: this use of statement expressions is not supported in a constant expression
   drivers/gpu/drm/imagination/pvr_device.h:490:3: note: expanded from macro 'PVR_PACKED_BVNC'
     490 |         (FIELD_PREP(DRM_PVR_BVNC_B, b) | \
         |          ^
   include/linux/bitfield.h:137:3: note: expanded from macro 'FIELD_PREP'
     137 |                 __FIELD_PREP(_mask, _val, "FIELD_PREP: ");              \
         |                 ^
   include/linux/bitfield.h:90:3: note: expanded from macro '__FIELD_PREP'
      90 |                 __BF_FIELD_CHECK_MASK(mask, val, pfx);                  \
         |                 ^
   note: (skipping 4 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/compiler_types.h:631:2: note: expanded from macro 'compiletime_assert'
     631 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
         |         ^
   include/linux/compiler_types.h:619:2: note: expanded from macro '_compiletime_assert'
     619 |         __compiletime_assert(condition, msg, prefix, suffix)
         |         ^
   include/linux/compiler_types.h:603:2: note: expanded from macro '__compiletime_assert'
     603 |         do {                                                            \
         |         ^
   3 errors generated.


vim +550 drivers/gpu/drm/imagination/pvr_device.c

1c21f240fbc1e47 Matt Coster 2026-01-13  545  
1c21f240fbc1e47 Matt Coster 2026-01-13  546  static enum pvr_gpu_support_level
1c21f240fbc1e47 Matt Coster 2026-01-13  547  pvr_gpu_support_level(const struct pvr_gpu_id *gpu_id)
1c21f240fbc1e47 Matt Coster 2026-01-13  548  {
1c21f240fbc1e47 Matt Coster 2026-01-13  549  	switch (pvr_gpu_id_to_packed_bvnc(gpu_id)) {
1c21f240fbc1e47 Matt Coster 2026-01-13 @550  	case PVR_PACKED_BVNC(33, 15, 11, 3):
1c21f240fbc1e47 Matt Coster 2026-01-13  551  	case PVR_PACKED_BVNC(36, 53, 104, 796):
1c21f240fbc1e47 Matt Coster 2026-01-13  552  		return PVR_GPU_SUPPORTED;
1c21f240fbc1e47 Matt Coster 2026-01-13  553  
1c21f240fbc1e47 Matt Coster 2026-01-13  554  	case PVR_PACKED_BVNC(36, 52, 104, 182):
1c21f240fbc1e47 Matt Coster 2026-01-13  555  		return PVR_GPU_EXPERIMENTAL;
1c21f240fbc1e47 Matt Coster 2026-01-13  556  
1c21f240fbc1e47 Matt Coster 2026-01-13  557  	default:
1c21f240fbc1e47 Matt Coster 2026-01-13  558  		return PVR_GPU_UNKNOWN;
1c21f240fbc1e47 Matt Coster 2026-01-13  559  	}
1c21f240fbc1e47 Matt Coster 2026-01-13  560  }
1c21f240fbc1e47 Matt Coster 2026-01-13  561  

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-02-06 21:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-06  9:56 [PATCH 0/2] drm/imagination: GPU_ID-related cleanups Matt Coster
2026-02-06  9:56 ` [PATCH 1/2] drm/imagination: Define packed BVNCs in the uapi Matt Coster
2026-02-06 18:57   ` kernel test robot
2026-02-06 21:58   ` kernel test robot
2026-02-06  9:56 ` [PATCH 2/2] drm/imagination: Add PVR_GPU_ID_FMT to format pvr_gpu_id Matt Coster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®