summaryrefslogtreecommitdiff
path: root/include/video
diff options
context:
space:
mode:
authorGreg Hackmann <ghackmann@google.com>2014-04-08 12:36:41 -0700
committerGreg Hackmann <ghackmann@google.com>2014-04-08 23:41:17 +0000
commitadbe864576c5e5ac848d7e6009f760efdd00b44d (patch)
tree30e5c44f1cf0d821fb104abf0629a195863360fb /include/video
parent5ce32209e76f933062cd667b4cff51ac0c400c32 (diff)
video: adf: add buffer padding quirk
Quirks specify common behaviors that vary slightly among devices, and which ADF must account for. The buffer padding quirk captures the way different devices fetch the last scanline in a buffer: some devices fetch an entire line (including padding to the pitch) while others only fetch up to the visible width. ADF's buffer size validation now takes this quirk into account. Change-Id: I828b13316e27621d8a9efd9d5fffa6ce12a525ff Signed-off-by: Greg Hackmann <ghackmann@google.com>
Diffstat (limited to 'include/video')
-rw-r--r--include/video/adf.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/video/adf.h b/include/video/adf.h
index 2b742ab463dd..34f10e538f9e 100644
--- a/include/video/adf.h
+++ b/include/video/adf.h
@@ -193,10 +193,26 @@ struct adf_obj {
};
/**
+ * struct adf_device_quirks - common display device quirks
+ *
+ * @buffer_padding: whether the last scanline of a buffer extends to the
+ * buffer's pitch (@ADF_BUFFER_PADDED_TO_PITCH) or just to the visible
+ * width (@ADF_BUFFER_UNPADDED)
+ */
+struct adf_device_quirks {
+ /* optional, defaults to ADF_BUFFER_PADDED_TO_PITCH */
+ enum {
+ ADF_BUFFER_PADDED_TO_PITCH = 0,
+ ADF_BUFFER_UNPADDED = 1,
+ } buffer_padding;
+};
+
+/**
* struct adf_device_ops - display device implementation ops
*
* @owner: device's module
* @base: common operations (see &struct adf_obj_ops)
+ * @quirks: device's quirks (see &struct adf_device_quirks)
*
* @attach: attach overlay engine @eng to interface @intf. Return 0 on success
* or error code (<0) on failure.
@@ -228,6 +244,8 @@ struct adf_device_ops {
/* required */
struct module *owner;
const struct adf_obj_ops base;
+ /* optional */
+ const struct adf_device_quirks quirks;
/* optional */
int (*attach)(struct adf_device *dev, struct adf_overlay_engine *eng,