From af76a5a8dfd3bd28cd17ddb37521fb31cd93f78c Mon Sep 17 00:00:00 2001 From: jsg Date: Fri, 7 Apr 2023 04:06:11 +0000 Subject: [PATCH] drm/i915/dpt: Treat the DPT BO as a framebuffer From Ville Syrjala c781c107731fc09ce4330c8c636b8446d0f72aa4 in linux-6.1.y/6.1.23 3413881e1ecc3cba722a2e87ec099692eed5be28 in mainline linux --- sys/dev/pci/drm/i915/display/intel_dpt.c | 2 ++ sys/dev/pci/drm/i915/gem/i915_gem_object.h | 2 +- sys/dev/pci/drm/i915/gem/i915_gem_object_types.h | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/dev/pci/drm/i915/display/intel_dpt.c b/sys/dev/pci/drm/i915/display/intel_dpt.c index ac587647e1f..a3893aff386 100644 --- a/sys/dev/pci/drm/i915/display/intel_dpt.c +++ b/sys/dev/pci/drm/i915/display/intel_dpt.c @@ -300,6 +300,7 @@ intel_dpt_create(struct intel_framebuffer *fb) vm->pte_encode = gen8_ggtt_pte_encode; dpt->obj = dpt_obj; + dpt->obj->is_dpt = true; return &dpt->vm; } @@ -308,5 +309,6 @@ void intel_dpt_destroy(struct i915_address_space *vm) { struct i915_dpt *dpt = i915_vm_to_dpt(vm); + dpt->obj->is_dpt = false; i915_vm_put(&dpt->vm); } diff --git a/sys/dev/pci/drm/i915/gem/i915_gem_object.h b/sys/dev/pci/drm/i915/gem/i915_gem_object.h index 7f84f118523..e35c58281f6 100644 --- a/sys/dev/pci/drm/i915/gem/i915_gem_object.h +++ b/sys/dev/pci/drm/i915/gem/i915_gem_object.h @@ -319,7 +319,7 @@ i915_gem_object_never_mmap(const struct drm_i915_gem_object *obj) static inline bool i915_gem_object_is_framebuffer(const struct drm_i915_gem_object *obj) { - return READ_ONCE(obj->frontbuffer); + return READ_ONCE(obj->frontbuffer) || obj->is_dpt; } static inline unsigned int diff --git a/sys/dev/pci/drm/i915/gem/i915_gem_object_types.h b/sys/dev/pci/drm/i915/gem/i915_gem_object_types.h index 13effa97e62..26845512880 100644 --- a/sys/dev/pci/drm/i915/gem/i915_gem_object_types.h +++ b/sys/dev/pci/drm/i915/gem/i915_gem_object_types.h @@ -491,6 +491,9 @@ struct drm_i915_gem_object { */ unsigned int cache_dirty:1; + /* @is_dpt: Object houses a display page table (DPT) */ + unsigned int is_dpt:1; + /** * @read_domains: Read memory domains. * -- 2.20.1