summaryrefslogtreecommitdiff
path: root/drivers/gpu/msm/adreno_ringbuffer.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/msm/adreno_ringbuffer.h')
-rw-r--r--drivers/gpu/msm/adreno_ringbuffer.h22
1 files changed, 9 insertions, 13 deletions
diff --git a/drivers/gpu/msm/adreno_ringbuffer.h b/drivers/gpu/msm/adreno_ringbuffer.h
index 7fd28f52db83..3bef6b3e6940 100644
--- a/drivers/gpu/msm/adreno_ringbuffer.h
+++ b/drivers/gpu/msm/adreno_ringbuffer.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2002,2007-2015, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2002,2007-2016, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -16,6 +16,14 @@
#include "kgsl_iommu.h"
#include "adreno_dispatch.h"
+/* Given a ringbuffer, return the adreno device that owns it */
+
+#define _RB_OFFSET(_id) (offsetof(struct adreno_device, ringbuffers) + \
+ ((_id) * sizeof(struct adreno_ringbuffer)))
+
+#define ADRENO_RB_DEVICE(_rb) \
+ ((struct adreno_device *) (((void *) (_rb)) - _RB_OFFSET((_rb)->id)))
+
/* Adreno ringbuffer size in bytes */
#define KGSL_RB_SIZE (32 * 1024)
@@ -66,7 +74,6 @@ struct adreno_ringbuffer_pagetable_info {
/**
* struct adreno_ringbuffer - Definition for an adreno ringbuffer object
- * @device: KGSL device that owns the ringbuffer object
* @flags: Internal control flags for the ringbuffer
* @buffer_desc: Pointer to the ringbuffer memory descriptor
* @wptr: Local copy of the wptr offset
@@ -97,7 +104,6 @@ struct adreno_ringbuffer_pagetable_info {
* @starve_timer_state: Indicates the state of the wait.
*/
struct adreno_ringbuffer {
- struct kgsl_device *device;
uint32_t flags;
struct kgsl_memdesc buffer_desc;
unsigned int sizedwords;
@@ -213,14 +219,4 @@ static inline unsigned int adreno_ringbuffer_dec_wrapped(unsigned int val,
return (val + size - sizeof(unsigned int)) % size;
}
-/* check if timestamp is greater than the current rb timestamp */
-static inline int adreno_ringbuffer_check_timestamp(
- struct adreno_ringbuffer *rb,
- unsigned int timestamp, int type)
-{
- unsigned int ts;
- adreno_rb_readtimestamp(rb->device, rb, type, &ts);
- return (timestamp_cmp(ts, timestamp) >= 0);
-}
-
#endif /* __ADRENO_RINGBUFFER_H */