drm/i915/dsb: DSB context creation.
authorAnimesh Manna <animesh.manna@intel.com>
Fri, 20 Sep 2019 11:59:22 +0000 (17:29 +0530)
committerJani Nikula <jani.nikula@intel.com>
Mon, 23 Sep 2019 07:06:06 +0000 (10:06 +0300)
commit67f3b58f3bac975f35c312fd8876edb599cc24be
tree27d68f82d1089c0358f0ba523cc310cd0178c934
parent18febcb74ed37abd835da0ab5335df67ed40e4b5
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
drivers/gpu/drm/i915/Makefile
drivers/gpu/drm/i915/display/intel_display_types.h
drivers/gpu/drm/i915/display/intel_dsb.c [new file with mode: 0644]
drivers/gpu/drm/i915/display/intel_dsb.h [new file with mode: 0644]
drivers/gpu/drm/i915/i915_drv.h