From 0ad40e83dbcf0f3f6e936f573c8e7878803ab37f Mon Sep 17 00:00:00 2001 From: Sourab Gupta Date: Fri, 20 Apr 2018 10:25:16 +0530 Subject: gpu: nvgpu: add conversion function for gpu alarm events In order to enable the movement of clk arbitrator to common code, we need to remove the NVGPU_GPU_EVENT_* defines (which are present in uapi) and instead use the common code defines. Add a conversion function for the same. With this the uapi header is no longer required to be included inside clk_arb.c Jira VQRM-3741 Change-Id: If01614b01733876046f98b97e70285c52bc33e45 Signed-off-by: Sourab Gupta Reviewed-on: https://git-master.nvidia.com/r/1699241 Reviewed-by: svc-mobile-coverity Reviewed-by: Alex Waterman GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/include/nvgpu/clk_arb.h | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/include') diff --git a/drivers/gpu/nvgpu/include/nvgpu/clk_arb.h b/drivers/gpu/nvgpu/include/nvgpu/clk_arb.h index a2f8135e..45561e31 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/clk_arb.h +++ b/drivers/gpu/nvgpu/include/nvgpu/clk_arb.h @@ -57,8 +57,36 @@ struct nvgpu_clk_session; __fls((a)->pstates & (b)->pstates) :\ VF_POINT_INVALID_PSTATE) +/* + * These events, defined in common code are the counterparts of the uapi + * events. There should be a conversion function to take care to convert + * these to the uapi events. + */ +/* Event associated to a VF update */ +#define NVGPU_EVENT_VF_UPDATE 0 + +/* Recoverable alarms (POLLPRI) */ +/* Alarm when target frequency on any session is not possible */ +#define NVGPU_EVENT_ALARM_TARGET_VF_NOT_POSSIBLE 1 +/* Alarm when target frequency on current session is not possible */ +#define NVGPU_EVENT_ALARM_LOCAL_TARGET_VF_NOT_POSSIBLE 2 +/* Alarm when Clock Arbiter failed */ +#define NVGPU_EVENT_ALARM_CLOCK_ARBITER_FAILED 3 +/* Alarm when VF table update failed */ +#define NVGPU_EVENT_ALARM_VF_TABLE_UPDATE_FAILED 4 +/* Alarm on thermal condition */ +#define NVGPU_EVENT_ALARM_THERMAL_ABOVE_THRESHOLD 5 +/* Alarm on power condition */ +#define NVGPU_EVENT_ALARM_POWER_ABOVE_THRESHOLD 6 + +/* Non recoverable alarm (POLLHUP) */ +/* Alarm on GPU shutdown/fall from bus */ +#define NVGPU_EVENT_ALARM_GPU_LOST 7 + +#define NVGPU_EVENT_LAST NVGPU_EVENT_ALARM_GPU_LOST + /* Local Alarms */ -#define EVENT(alarm) (0x1UL << NVGPU_GPU_EVENT_##alarm) +#define EVENT(alarm) (0x1UL << NVGPU_EVENT_##alarm) #define LOCAL_ALARM_MASK (EVENT(ALARM_LOCAL_TARGET_VF_NOT_POSSIBLE) | \ EVENT(VF_UPDATE)) -- cgit v1.2.2