From 55da7b037d02048282409fe32b79ff08ff10367a Mon Sep 17 00:00:00 2001 From: Flora Cui Date: Tue, 18 Aug 2020 10:16:20 +0800 Subject: drm/amdkcl: refactor kcl wrapper for dma-resv Signed-off-by: Flora Cui Reviewed-by: Yang Xiong --- include/kcl/backport/kcl_reservation_backport.h | 44 --------------------- include/kcl/kcl_dma-resv.h | 51 +++++++++++++++++++++++++ include/kcl/kcl_reservation.h | 12 ++++++ 3 files changed, 63 insertions(+), 44 deletions(-) delete mode 100644 include/kcl/backport/kcl_reservation_backport.h create mode 100644 include/kcl/kcl_dma-resv.h create mode 100644 include/kcl/kcl_reservation.h (limited to 'include') diff --git a/include/kcl/backport/kcl_reservation_backport.h b/include/kcl/backport/kcl_reservation_backport.h deleted file mode 100644 index ee14e6afcfbe..000000000000 --- a/include/kcl/backport/kcl_reservation_backport.h +++ /dev/null @@ -1,44 +0,0 @@ -/* SPDX-License-Identifier: MIT */ -#ifndef AMDKCL_RESERVATION_BACKPORT_H -#define AMDKCL_RESERVATION_BACKPORT_H - -#include -#include -#include -#include -#include -#include - -extern struct ww_class *_kcl_reservation_ww_class; -extern struct lock_class_key *_kcl_reservation_seqcount_class; -extern const char *_kcl_reservation_seqcount_string; - -#define reservation_ww_class (*_kcl_reservation_ww_class) -#define reservation_seqcount_class (*_kcl_reservation_seqcount_class) -#define reservation_seqcount_string (_kcl_reservation_seqcount_string) - -struct dma_resv_list; - -#if defined(HAVE_RESERVATION_OBJECT_STAGED) -struct dma_resv { - struct ww_mutex lock; - seqcount_t seq; - - struct dma_fence __rcu *fence_excl; - struct dma_resv_list __rcu *fence; - struct dma_resv_list *staged; -}; -#else -struct dma_resv { - struct ww_mutex lock; - seqcount_t seq; - - struct dma_fence __rcu *fence_excl; - struct dma_resv_list __rcu *fence; -}; -#endif - -#if !defined(smp_store_mb) -#define smp_store_mb set_mb -#endif -#endif diff --git a/include/kcl/kcl_dma-resv.h b/include/kcl/kcl_dma-resv.h new file mode 100644 index 000000000000..08ea310898ca --- /dev/null +++ b/include/kcl/kcl_dma-resv.h @@ -0,0 +1,51 @@ +/* SPDX-License-Identifier: MIT */ + +/* + * NOTICE: + * THIS HEADER IS FOR DMA-RESV.H ONLY + * DO NOT INCLUDE THIS HEADER ANY OTHER PLACE + * INCLUDE LINUX/DMA-RESV.H OR LINUX/RESERVATION.H INSTEAD + */ +#ifndef KCL_KCL_DMA_RESV_H +#define KCL_KCL_DMA_RESV_H + +#include +#include +#include +#include +#include +#include + +extern struct ww_class *_kcl_reservation_ww_class; +extern struct lock_class_key *_kcl_reservation_seqcount_class; +extern const char *_kcl_reservation_seqcount_string; + +#define reservation_ww_class (*_kcl_reservation_ww_class) +#define reservation_seqcount_class (*_kcl_reservation_seqcount_class) +#define reservation_seqcount_string (_kcl_reservation_seqcount_string) + +struct dma_resv_list; + +#if defined(HAVE_RESERVATION_OBJECT_STAGED) +struct dma_resv { + struct ww_mutex lock; + seqcount_t seq; + + struct dma_fence __rcu *fence_excl; + struct dma_resv_list __rcu *fence; + struct dma_resv_list *staged; +}; +#else +struct dma_resv { + struct ww_mutex lock; + seqcount_t seq; + + struct dma_fence __rcu *fence_excl; + struct dma_resv_list __rcu *fence; +}; +#endif + +#if !defined(smp_store_mb) +#define smp_store_mb set_mb +#endif +#endif diff --git a/include/kcl/kcl_reservation.h b/include/kcl/kcl_reservation.h new file mode 100644 index 000000000000..4429466cd16a --- /dev/null +++ b/include/kcl/kcl_reservation.h @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: MIT */ +#ifndef KCL_KCL_RESERVATION_H +#define KCL_KCL_RESERVATION_H + +#include + +#ifndef HAVE_LINUX_DMA_RESV_H +#define reservation_object dma_resv +#define reservation_object_list dma_resv_list +#endif + +#endif /* AMDKCL_RESERVATION_H */ -- cgit v1.2.3