]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/etnaviv: provide more ID values via GET_PARAM ioctl.
authorChristian Gmeiner <christian.gmeiner@gmail.com>
Wed, 16 Dec 2020 11:42:01 +0000 (12:42 +0100)
committerLucas Stach <l.stach@pengutronix.de>
Fri, 22 Jan 2021 11:33:57 +0000 (12:33 +0100)
Make it possible for the user space to access these ID values.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
drivers/gpu/drm/etnaviv/etnaviv_gpu.c
include/uapi/drm/etnaviv_drm.h

index c6404b8d067f10279221dad7eb925a1650ae7534..ec16991ba8b6db37ca5af831dab7869b7e9f1947 100644 (file)
@@ -156,6 +156,18 @@ int etnaviv_gpu_get_param(struct etnaviv_gpu *gpu, u32 param, u64 *value)
                        *value = ~0ULL;
                break;
 
+       case ETNAVIV_PARAM_GPU_PRODUCT_ID:
+               *value = gpu->identity.product_id;
+               break;
+
+       case ETNAVIV_PARAM_GPU_CUSTOMER_ID:
+               *value = gpu->identity.customer_id;
+               break;
+
+       case ETNAVIV_PARAM_GPU_ECO_ID:
+               *value = gpu->identity.eco_id;
+               break;
+
        default:
                DBG("%s: invalid param: %u", dev_name(gpu->dev), param);
                return -EINVAL;
index 09d0df8b71c5dd5a6347aeafffdafcc554d322fb..af024d90453ddc5376892b13efd8e6c51043e97e 100644 (file)
@@ -74,6 +74,9 @@ struct drm_etnaviv_timespec {
 #define ETNAVIV_PARAM_GPU_NUM_CONSTANTS             0x19
 #define ETNAVIV_PARAM_GPU_NUM_VARYINGS              0x1a
 #define ETNAVIV_PARAM_SOFTPIN_START_ADDR            0x1b
+#define ETNAVIV_PARAM_GPU_PRODUCT_ID                0x1c
+#define ETNAVIV_PARAM_GPU_CUSTOMER_ID               0x1d
+#define ETNAVIV_PARAM_GPU_ECO_ID                    0x1e
 
 #define ETNA_MAX_PIPES 4