Skip to content

Commit 5bd5667

Browse files
unerligerodrigovivi
authored andcommitted
drm/xe/oa: Allow oa_exponent value of 0
OA exponent value of 0 is a valid value for periodic reports. Allow user to pass 0 for the OA sampling interval since it gets converted to 2 gt clock ticks. v2: Update the check in xe_oa_stream_init as well (Ashutosh) v3: Fix mi-rpc failure by setting default exponent to -1 (CI) v4: Add the Fixes tag Fixes: b6fd51c ("drm/xe/oa/uapi: Define and parse OA stream properties") Signed-off-by: Umesh Nerlige Ramappa <[email protected]> Reviewed-by: Ashutosh Dixit <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit 30341f0) Signed-off-by: Rodrigo Vivi <[email protected]>
1 parent a9f4fa3 commit 5bd5667

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/gpu/drm/xe/xe_oa.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1689,7 +1689,7 @@ static int xe_oa_stream_init(struct xe_oa_stream *stream,
16891689
stream->oa_buffer.format = &stream->oa->oa_formats[param->oa_format];
16901690

16911691
stream->sample = param->sample;
1692-
stream->periodic = param->period_exponent > 0;
1692+
stream->periodic = param->period_exponent >= 0;
16931693
stream->period_exponent = param->period_exponent;
16941694
stream->no_preempt = param->no_preempt;
16951695
stream->wait_num_reports = param->wait_num_reports;
@@ -1970,6 +1970,7 @@ int xe_oa_stream_open_ioctl(struct drm_device *dev, u64 data, struct drm_file *f
19701970
}
19711971

19721972
param.xef = xef;
1973+
param.period_exponent = -1;
19731974
ret = xe_oa_user_extensions(oa, XE_OA_USER_EXTN_FROM_OPEN, data, 0, &param);
19741975
if (ret)
19751976
return ret;
@@ -2024,7 +2025,7 @@ int xe_oa_stream_open_ioctl(struct drm_device *dev, u64 data, struct drm_file *f
20242025
goto err_exec_q;
20252026
}
20262027

2027-
if (param.period_exponent > 0) {
2028+
if (param.period_exponent >= 0) {
20282029
u64 oa_period, oa_freq_hz;
20292030

20302031
/* Requesting samples from OAG buffer is a privileged operation */

0 commit comments

Comments
 (0)