From 56d170bc06c3ac69deb697f057c213f7c46d9a68 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Wed, 18 Jun 2014 09:45:23 -0400 Subject: [PATCH] freedreno: add chip-id property Userspace needs to know the patch-revision in addition to just the gpu-id (ie. 320, 305, etc). Signed-off-by: Rob Clark --- freedreno/freedreno_drmif.h | 1 + freedreno/kgsl/kgsl_pipe.c | 3 +++ freedreno/msm/msm_pipe.c | 5 +++++ freedreno/msm/msm_priv.h | 1 + 4 files changed, 10 insertions(+) diff --git a/freedreno/freedreno_drmif.h b/freedreno/freedreno_drmif.h index 41ef609..7c54e04 100644 --- a/freedreno/freedreno_drmif.h +++ b/freedreno/freedreno_drmif.h @@ -49,6 +49,7 @@ enum fd_param_id { FD_DEVICE_ID, FD_GMEM_SIZE, FD_GPU_ID, + FD_CHIP_ID, }; /* bo flags: */ diff --git a/freedreno/kgsl/kgsl_pipe.c b/freedreno/kgsl/kgsl_pipe.c index f7ff7fe..88d9505 100644 --- a/freedreno/kgsl/kgsl_pipe.c +++ b/freedreno/kgsl/kgsl_pipe.c @@ -43,6 +43,9 @@ static int kgsl_pipe_get_param(struct fd_pipe *pipe, case FD_GMEM_SIZE: *value = kgsl_pipe->devinfo.gmem_sizebytes; return 0; + case FD_CHIP_ID: + *value = kgsl_pipe->devinfo.chip_id; + return 0; default: ERROR_MSG("invalid param id: %d", param); return -1; diff --git a/freedreno/msm/msm_pipe.c b/freedreno/msm/msm_pipe.c index ece4de5..5650503 100644 --- a/freedreno/msm/msm_pipe.c +++ b/freedreno/msm/msm_pipe.c @@ -41,6 +41,9 @@ static int msm_pipe_get_param(struct fd_pipe *pipe, case FD_GMEM_SIZE: *value = msm_pipe->gmem; return 0; + case FD_CHIP_ID: + *value = msm_pipe->chip_id; + return 0; default: ERROR_MSG("invalid param id: %d", param); return -1; @@ -117,12 +120,14 @@ struct fd_pipe * msm_pipe_new(struct fd_device *dev, enum fd_pipe_id id) msm_pipe->pipe = pipe_id[id]; msm_pipe->gpu_id = get_param(dev, pipe_id[id], MSM_PARAM_GPU_ID); msm_pipe->gmem = get_param(dev, pipe_id[id], MSM_PARAM_GMEM_SIZE); + msm_pipe->chip_id = get_param(dev, pipe_id[id], MSM_PARAM_CHIP_ID); if (! msm_pipe->gpu_id) goto fail; INFO_MSG("Pipe Info:"); INFO_MSG(" GPU-id: %d", msm_pipe->gpu_id); + INFO_MSG(" Chip-id: 0x%08x", msm_pipe->chip_id); INFO_MSG(" GMEM size: 0x%08x", msm_pipe->gmem); return pipe; diff --git a/freedreno/msm/msm_priv.h b/freedreno/msm/msm_priv.h index 4c5623a..75ae883 100644 --- a/freedreno/msm/msm_priv.h +++ b/freedreno/msm/msm_priv.h @@ -53,6 +53,7 @@ struct msm_pipe { uint32_t pipe; uint32_t gpu_id; uint32_t gmem; + uint32_t chip_id; }; static inline struct msm_pipe * to_msm_pipe(struct fd_pipe *x) -- 2.7.4