diff options
author | Deepak Nibade <dnibade@nvidia.com> | 2015-10-28 06:43:14 -0400 |
---|---|---|
committer | Terje Bergstrom <tbergstrom@nvidia.com> | 2015-11-03 17:20:08 -0500 |
commit | 9592a4e6fce8204e9ada54ba00902e792199fec5 (patch) | |
tree | 37cc1bffce5ea48555a1ed88865e5f545627b546 /drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | |
parent | 8d279dbac10b8521aa7eaeb7640c01d21ce044f2 (diff) |
gpu: nvgpu: IOCTL to set TSG timeslice
Add new IOCTL NVGPU_IOCTL_TSG_SET_PRIORITY to allow
setting timeslice for entire TSG
Return error from channel specific IOCTL_CHANNEL_SET_PRIORITY
if the channel is part of TSG
Separate out API gk20a_channel_get_timescale_from_timeslice()
to get timeslice_timeout and scale from timeslice period
Use this API to get timeslice_timeout and scale for TSG and
store it in tsg_gk20a structure
Then trigger runlist update so that new timeslice values
will be re-written to runlist for TSG
Bug 200146615
Change-Id: I555467d034f81b372b31372f0835d72b1c159508
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/824206
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/fifo_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c index 39cb1174..5eba9f12 100644 --- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | |||
@@ -2115,6 +2115,32 @@ static int gk20a_fifo_runlist_wait_pending(struct gk20a *g, u32 runlist_id) | |||
2115 | return ret; | 2115 | return ret; |
2116 | } | 2116 | } |
2117 | 2117 | ||
2118 | static inline u32 gk20a_get_tsg_runlist_entry_0(struct tsg_gk20a *tsg) | ||
2119 | { | ||
2120 | u32 runlist_entry_0 = 0; | ||
2121 | |||
2122 | if (tsg->timeslice_timeout) | ||
2123 | runlist_entry_0 = ram_rl_entry_id_f(tsg->tsgid) | | ||
2124 | ram_rl_entry_type_f(ram_rl_entry_type_tsg_f()) | | ||
2125 | ram_rl_entry_timeslice_scale_f( | ||
2126 | tsg->timeslice_scale) | | ||
2127 | ram_rl_entry_timeslice_timeout_f( | ||
2128 | tsg->timeslice_timeout) | | ||
2129 | ram_rl_entry_tsg_length_f( | ||
2130 | tsg->num_active_channels); | ||
2131 | else | ||
2132 | runlist_entry_0 = ram_rl_entry_id_f(tsg->tsgid) | | ||
2133 | ram_rl_entry_type_f(ram_rl_entry_type_tsg_f()) | | ||
2134 | ram_rl_entry_timeslice_scale_f( | ||
2135 | ram_rl_entry_timeslice_scale_3_f()) | | ||
2136 | ram_rl_entry_timeslice_timeout_f( | ||
2137 | ram_rl_entry_timeslice_timeout_128_f()) | | ||
2138 | ram_rl_entry_tsg_length_f( | ||
2139 | tsg->num_active_channels); | ||
2140 | |||
2141 | return runlist_entry_0; | ||
2142 | } | ||
2143 | |||
2118 | static int gk20a_fifo_update_runlist_locked(struct gk20a *g, u32 runlist_id, | 2144 | static int gk20a_fifo_update_runlist_locked(struct gk20a *g, u32 runlist_id, |
2119 | u32 hw_chid, bool add, | 2145 | u32 hw_chid, bool add, |
2120 | bool wait_for_finish) | 2146 | bool wait_for_finish) |
@@ -2201,14 +2227,7 @@ static int gk20a_fifo_update_runlist_locked(struct gk20a *g, u32 runlist_id, | |||
2201 | tsg = &f->tsg[tsgid]; | 2227 | tsg = &f->tsg[tsgid]; |
2202 | /* add TSG entry */ | 2228 | /* add TSG entry */ |
2203 | gk20a_dbg_info("add TSG %d to runlist", tsg->tsgid); | 2229 | gk20a_dbg_info("add TSG %d to runlist", tsg->tsgid); |
2204 | runlist_entry[0] = ram_rl_entry_id_f(tsg->tsgid) | | 2230 | runlist_entry[0] = gk20a_get_tsg_runlist_entry_0(tsg); |
2205 | ram_rl_entry_type_f(ram_rl_entry_type_tsg_f()) | | ||
2206 | ram_rl_entry_timeslice_scale_f( | ||
2207 | ram_rl_entry_timeslice_scale_3_f()) | | ||
2208 | ram_rl_entry_timeslice_timeout_f( | ||
2209 | ram_rl_entry_timeslice_timeout_128_f()) | | ||
2210 | ram_rl_entry_tsg_length_f( | ||
2211 | tsg->num_active_channels); | ||
2212 | runlist_entry[1] = 0; | 2231 | runlist_entry[1] = 0; |
2213 | runlist_entry += 2; | 2232 | runlist_entry += 2; |
2214 | count++; | 2233 | count++; |