From: Dave Airlie Date: Wed, 9 Dec 2020 23:42:34 +0000 (+1000) Subject: Merge tag 'drm-msm-next-2020-12-07' of https://gitlab.freedesktop.org/drm/msm into... X-Git-Tag: accepted/tizen/unified/20230118.172025~8358^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=60f2f74978e69fdb63e7a26179cbd5c50d4845c2;p=platform%2Fkernel%2Flinux-rpi.git Merge tag 'drm-msm-next-2020-12-07' of https://gitlab.freedesktop.org/drm/msm into drm-next * Shutdown hook for GPU (to ensure GPU is idle before iommu goes away) * GPU cooling device support * DSI 7nm and 10nm phy/pll updates * Additional sm8150/sm8250 DPU support (merge_3d and DSPP color processing) * Various DP fixes * A whole bunch of W=1 fixes from Lee Jones * GEM locking re-work (no more trylock_recursive in shrinker!) * LLCC (system cache) support * Various other fixes/cleanups Signed-off-by: Dave Airlie From: Rob Clark Link: https://patchwork.freedesktop.org/patch/msgid/CAF6AEGt0G=H3_RbF_GAQv838z5uujSmFd+7fYhL6Yg=23LwZ=g@mail.gmail.com --- 60f2f74978e69fdb63e7a26179cbd5c50d4845c2 diff --cc drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c index e55be29,d4662e8..56eb225 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c @@@ -844,12 -838,12 +844,12 @@@ static int dpu_crtc_atomic_check(struc goto end; } - mode = &state->adjusted_mode; + mode = &crtc_state->adjusted_mode; - DPU_DEBUG("%s: check", dpu_crtc->name); + DPU_DEBUG("%s: check\n", dpu_crtc->name); /* force a full mode set if active state changed */ - if (state->active_changed) - state->mode_changed = true; + if (crtc_state->active_changed) + crtc_state->mode_changed = true; memset(pipe_staged, 0, sizeof(pipe_staged)); diff --cc drivers/gpu/drm/msm/msm_drv.h index a6aef68,a51515f..591c47a --- a/drivers/gpu/drm/msm/msm_drv.h +++ b/drivers/gpu/drm/msm/msm_drv.h @@@ -273,30 -282,9 +282,9 @@@ int msm_ioctl_gem_submit(struct drm_dev void msm_gem_shrinker_init(struct drm_device *dev); void msm_gem_shrinker_cleanup(struct drm_device *dev); - int msm_gem_mmap_obj(struct drm_gem_object *obj, - struct vm_area_struct *vma); - int msm_gem_mmap(struct file *filp, struct vm_area_struct *vma); - uint64_t msm_gem_mmap_offset(struct drm_gem_object *obj); - int msm_gem_get_iova(struct drm_gem_object *obj, - struct msm_gem_address_space *aspace, uint64_t *iova); - int msm_gem_get_and_pin_iova_range(struct drm_gem_object *obj, - struct msm_gem_address_space *aspace, uint64_t *iova, - u64 range_start, u64 range_end); - int msm_gem_get_and_pin_iova(struct drm_gem_object *obj, - struct msm_gem_address_space *aspace, uint64_t *iova); - uint64_t msm_gem_iova(struct drm_gem_object *obj, - struct msm_gem_address_space *aspace); - void msm_gem_unpin_iova(struct drm_gem_object *obj, - struct msm_gem_address_space *aspace); - struct page **msm_gem_get_pages(struct drm_gem_object *obj); - void msm_gem_put_pages(struct drm_gem_object *obj); - int msm_gem_dumb_create(struct drm_file *file, struct drm_device *dev, - struct drm_mode_create_dumb *args); - int msm_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev, - uint32_t handle, uint64_t *offset); struct sg_table *msm_gem_prime_get_sg_table(struct drm_gem_object *obj); -void *msm_gem_prime_vmap(struct drm_gem_object *obj); -void msm_gem_prime_vunmap(struct drm_gem_object *obj, void *vaddr); +int msm_gem_prime_vmap(struct drm_gem_object *obj, struct dma_buf_map *map); +void msm_gem_prime_vunmap(struct drm_gem_object *obj, struct dma_buf_map *map); int msm_gem_prime_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma); struct drm_gem_object *msm_gem_prime_import_sg_table(struct drm_device *dev, struct dma_buf_attachment *attach, struct sg_table *sg); diff --cc drivers/gpu/drm/msm/msm_gem.h index a1bf741,3355a48..b3a0a88 --- a/drivers/gpu/drm/msm/msm_gem.h +++ b/drivers/gpu/drm/msm/msm_gem.h @@@ -93,9 -91,102 +91,101 @@@ struct msm_gem_object }; #define to_msm_bo(x) container_of(x, struct msm_gem_object, base) + int msm_gem_mmap_obj(struct drm_gem_object *obj, + struct vm_area_struct *vma); + int msm_gem_mmap(struct file *filp, struct vm_area_struct *vma); -vm_fault_t msm_gem_fault(struct vm_fault *vmf); + uint64_t msm_gem_mmap_offset(struct drm_gem_object *obj); + int msm_gem_get_iova(struct drm_gem_object *obj, + struct msm_gem_address_space *aspace, uint64_t *iova); + int msm_gem_get_and_pin_iova_range(struct drm_gem_object *obj, + struct msm_gem_address_space *aspace, uint64_t *iova, + u64 range_start, u64 range_end); + int msm_gem_get_and_pin_iova_locked(struct drm_gem_object *obj, + struct msm_gem_address_space *aspace, uint64_t *iova); + int msm_gem_get_and_pin_iova(struct drm_gem_object *obj, + struct msm_gem_address_space *aspace, uint64_t *iova); + uint64_t msm_gem_iova(struct drm_gem_object *obj, + struct msm_gem_address_space *aspace); + void msm_gem_unpin_iova_locked(struct drm_gem_object *obj, + struct msm_gem_address_space *aspace); + void msm_gem_unpin_iova(struct drm_gem_object *obj, + struct msm_gem_address_space *aspace); + struct page **msm_gem_get_pages(struct drm_gem_object *obj); + void msm_gem_put_pages(struct drm_gem_object *obj); + int msm_gem_dumb_create(struct drm_file *file, struct drm_device *dev, + struct drm_mode_create_dumb *args); + int msm_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev, + uint32_t handle, uint64_t *offset); + void *msm_gem_get_vaddr_locked(struct drm_gem_object *obj); + void *msm_gem_get_vaddr(struct drm_gem_object *obj); + void *msm_gem_get_vaddr_active(struct drm_gem_object *obj); + void msm_gem_put_vaddr_locked(struct drm_gem_object *obj); + void msm_gem_put_vaddr(struct drm_gem_object *obj); + int msm_gem_madvise(struct drm_gem_object *obj, unsigned madv); + int msm_gem_sync_object(struct drm_gem_object *obj, + struct msm_fence_context *fctx, bool exclusive); + void msm_gem_active_get(struct drm_gem_object *obj, struct msm_gpu *gpu); + void msm_gem_active_put(struct drm_gem_object *obj); + int msm_gem_cpu_prep(struct drm_gem_object *obj, uint32_t op, ktime_t *timeout); + int msm_gem_cpu_fini(struct drm_gem_object *obj); + void msm_gem_free_object(struct drm_gem_object *obj); + int msm_gem_new_handle(struct drm_device *dev, struct drm_file *file, + uint32_t size, uint32_t flags, uint32_t *handle, char *name); + struct drm_gem_object *msm_gem_new(struct drm_device *dev, + uint32_t size, uint32_t flags); + struct drm_gem_object *msm_gem_new_locked(struct drm_device *dev, + uint32_t size, uint32_t flags); + void *msm_gem_kernel_new(struct drm_device *dev, uint32_t size, + uint32_t flags, struct msm_gem_address_space *aspace, + struct drm_gem_object **bo, uint64_t *iova); + void *msm_gem_kernel_new_locked(struct drm_device *dev, uint32_t size, + uint32_t flags, struct msm_gem_address_space *aspace, + struct drm_gem_object **bo, uint64_t *iova); + void msm_gem_kernel_put(struct drm_gem_object *bo, + struct msm_gem_address_space *aspace, bool locked); + struct drm_gem_object *msm_gem_import(struct drm_device *dev, + struct dma_buf *dmabuf, struct sg_table *sgt); + __printf(2, 3) + void msm_gem_object_set_name(struct drm_gem_object *bo, const char *fmt, ...); + #ifdef CONFIG_DEBUG_FS + void msm_gem_describe(struct drm_gem_object *obj, struct seq_file *m); + void msm_gem_describe_objects(struct list_head *list, struct seq_file *m); + #endif + + static inline void + msm_gem_lock(struct drm_gem_object *obj) + { + dma_resv_lock(obj->resv, NULL); + } + + static inline bool __must_check + msm_gem_trylock(struct drm_gem_object *obj) + { + return dma_resv_trylock(obj->resv); + } + + static inline int + msm_gem_lock_interruptible(struct drm_gem_object *obj) + { + return dma_resv_lock_interruptible(obj->resv, NULL); + } + + static inline void + msm_gem_unlock(struct drm_gem_object *obj) + { + dma_resv_unlock(obj->resv); + } + + static inline bool + msm_gem_is_locked(struct drm_gem_object *obj) + { + return dma_resv_is_locked(obj->resv); + } + static inline bool is_active(struct msm_gem_object *msm_obj) { - return atomic_read(&msm_obj->active_count); + WARN_ON(!msm_gem_is_locked(&msm_obj->base)); + return msm_obj->active_count; } static inline bool is_purgeable(struct msm_gem_object *msm_obj) diff --cc include/drm/drm_crtc.h index ba839e5,cd42f79..5f43d64 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h @@@ -1279,7 -1266,14 +1279,17 @@@ static inline struct drm_crtc *drm_crtc #define drm_for_each_crtc(crtc, dev) \ list_for_each_entry(crtc, &(dev)->mode_config.crtc_list, head) + /** + * drm_for_each_crtc_reverse - iterate over all CRTCs in reverse order + * @crtc: a &struct drm_crtc as the loop cursor + * @dev: the &struct drm_device + * + * Iterate over all CRTCs of @dev. + */ + #define drm_for_each_crtc_reverse(crtc, dev) \ + list_for_each_entry_reverse(crtc, &(dev)->mode_config.crtc_list, head) + +int drm_crtc_create_scaling_filter_property(struct drm_crtc *crtc, + unsigned int supported_filters); + #endif /* __DRM_CRTC_H__ */