summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/display/intel_dsb.h
diff options
context:
space:
mode:
authorAnimesh Manna <animesh.manna@intel.com>2019-09-20 17:29:22 +0530
committerJani Nikula <jani.nikula@intel.com>2019-09-23 10:06:06 +0300
commit67f3b58f3bac975f35c312fd8876edb599cc24be (patch)
tree27d68f82d1089c0358f0ba523cc310cd0178c934 /drivers/gpu/drm/i915/display/intel_dsb.h
parent18febcb74ed37abd835da0ab5335df67ed40e4b5 (diff)
downloadlwn-67f3b58f3bac975f35c312fd8876edb599cc24be.tar.gz
lwn-67f3b58f3bac975f35c312fd8876edb599cc24be.zip
drm/i915/dsb: DSB context creation.
This patch adds a function, which will internally get the gem buffer for DSB engine. The GEM buffer is from global GTT, and is mapped into CPU domain, contains the data + opcode to be feed to DSB engine. v1: Initial version. v2: - removed some unwanted code. (Chris) - Used i915_gem_object_create_internal instead of _shmem. (Chris) - cmd_buf_tail removed and can be derived through vma object. (Chris) v3: vma realeased if i915_gem_object_pin_map() failed. (Shashank) v4: for simplification and based on current usage added single dsb object in intel_crtc. (Shashank) v5: seting NULL to cmd_buf moved outside of mutex in dsb-put(). (Shashank) v6: - refcount machanism added. - Used atomic_add_return and atomic_dec_and_test instead of atomic_inc and atomic_dec. (Jani) Cc: Imre Deak <imre.deak@intel.com> Cc: Michel Thierry <michel.thierry@intel.com> Cc: Jani Nikula <jani.nikula@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Shashank Sharma <shashank.sharma@intel.com> Signed-off-by: Animesh Manna <animesh.manna@intel.com> [Jani: added #include <linux/types.h> while pushing] Signed-off-by: Jani Nikula <jani.nikula@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190920115930.27829-3-animesh.manna@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/display/intel_dsb.h')
-rw-r--r--drivers/gpu/drm/i915/display/intel_dsb.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_dsb.h b/drivers/gpu/drm/i915/display/intel_dsb.h
new file mode 100644
index 000000000000..b8639864df50
--- /dev/null
+++ b/drivers/gpu/drm/i915/display/intel_dsb.h
@@ -0,0 +1,33 @@
+/* SPDX-License-Identifier: MIT
+ *
+ * Copyright © 2019 Intel Corporation
+ */
+
+#ifndef _INTEL_DSB_H
+#define _INTEL_DSB_H
+
+#include <linux/types.h>
+
+struct intel_crtc;
+struct i915_vma;
+
+enum dsb_id {
+ INVALID_DSB = -1,
+ DSB1,
+ DSB2,
+ DSB3,
+ MAX_DSB_PER_PIPE
+};
+
+struct intel_dsb {
+ atomic_t refcount;
+ enum dsb_id id;
+ u32 *cmd_buf;
+ struct i915_vma *vma;
+};
+
+struct intel_dsb *
+intel_dsb_get(struct intel_crtc *crtc);
+void intel_dsb_put(struct intel_dsb *dsb);
+
+#endif