Skip to content

Commit e9f076c

Browse files
committed
patched to 5.6, attempt 2
1 parent 79dcdd1 commit e9f076c

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

sys/external/bsd/drm2/dist/drm/i915/i915_perf.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3034,9 +3034,10 @@ static ssize_t i915_perf_read(struct file *file,
30343034
struct i915_perf_stream *stream = file->f_data;
30353035
#else
30363036
struct i915_perf_stream *stream = file->private_data;
3037+
size_t offset = 0;
30373038
#endif
30383039
struct i915_perf *perf = stream->perf;
3039-
size_t offset = 0;
3040+
int ret;
30403041

30413042
/* To ensure it's handled consistently we simply treat all reads of a
30423043
* disabled stream as an error. In particular it might otherwise lead
@@ -3065,12 +3066,20 @@ static ssize_t i915_perf_read(struct file *file,
30653066
return ret;
30663067

30673068
mutex_lock(&perf->lock);
3069+
#ifdef __NetBSD__
3070+
ret = stream->ops->read(stream, buf, count, offset);
3071+
#else
30683072
ret = stream->ops->read(stream, buf, count, &offset);
3073+
#endif
30693074
mutex_unlock(&perf->lock);
30703075
} while (!offset && !ret);
30713076
} else {
30723077
mutex_lock(&perf->lock);
3078+
#ifdef __NetBSD__
3079+
ret = stream->ops->read(stream, buf, count, offset);
3080+
#else
30733081
ret = stream->ops->read(stream, buf, count, &offset);
3082+
#endif
30743083
mutex_unlock(&perf->lock);
30753084
}
30763085

0 commit comments

Comments
 (0)