summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/include/nvgpu/clk_arb.h
diff options
context:
space:
mode:
authorSourab Gupta <sourabg@nvidia.com>2018-04-20 00:55:16 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-05-07 07:42:06 -0400
commit0ad40e83dbcf0f3f6e936f573c8e7878803ab37f (patch)
treeca149277fc9287ac49a071b98f72ba9cb65fcc5a /drivers/gpu/nvgpu/include/nvgpu/clk_arb.h
parentc92afad630f0539dfd2d28369d493715648b4ace (diff)
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 <sourabg@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1699241 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: Alex Waterman <alexw@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/include/nvgpu/clk_arb.h')
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/clk_arb.h30
1 files changed, 29 insertions, 1 deletions
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;
57 __fls((a)->pstates & (b)->pstates) :\ 57 __fls((a)->pstates & (b)->pstates) :\
58 VF_POINT_INVALID_PSTATE) 58 VF_POINT_INVALID_PSTATE)
59 59
60/*
61 * These events, defined in common code are the counterparts of the uapi
62 * events. There should be a conversion function to take care to convert
63 * these to the uapi events.
64 */
65/* Event associated to a VF update */
66#define NVGPU_EVENT_VF_UPDATE 0
67
68/* Recoverable alarms (POLLPRI) */
69/* Alarm when target frequency on any session is not possible */
70#define NVGPU_EVENT_ALARM_TARGET_VF_NOT_POSSIBLE 1
71/* Alarm when target frequency on current session is not possible */
72#define NVGPU_EVENT_ALARM_LOCAL_TARGET_VF_NOT_POSSIBLE 2
73/* Alarm when Clock Arbiter failed */
74#define NVGPU_EVENT_ALARM_CLOCK_ARBITER_FAILED 3
75/* Alarm when VF table update failed */
76#define NVGPU_EVENT_ALARM_VF_TABLE_UPDATE_FAILED 4
77/* Alarm on thermal condition */
78#define NVGPU_EVENT_ALARM_THERMAL_ABOVE_THRESHOLD 5
79/* Alarm on power condition */
80#define NVGPU_EVENT_ALARM_POWER_ABOVE_THRESHOLD 6
81
82/* Non recoverable alarm (POLLHUP) */
83/* Alarm on GPU shutdown/fall from bus */
84#define NVGPU_EVENT_ALARM_GPU_LOST 7
85
86#define NVGPU_EVENT_LAST NVGPU_EVENT_ALARM_GPU_LOST
87
60/* Local Alarms */ 88/* Local Alarms */
61#define EVENT(alarm) (0x1UL << NVGPU_GPU_EVENT_##alarm) 89#define EVENT(alarm) (0x1UL << NVGPU_EVENT_##alarm)
62 90
63#define LOCAL_ALARM_MASK (EVENT(ALARM_LOCAL_TARGET_VF_NOT_POSSIBLE) | \ 91#define LOCAL_ALARM_MASK (EVENT(ALARM_LOCAL_TARGET_VF_NOT_POSSIBLE) | \
64 EVENT(VF_UPDATE)) 92 EVENT(VF_UPDATE))