diff mbox

[WW,08/13] drm/radeon: inline reservations

Message ID 1372333708-29884-9-git-send-email-maarten.lankhorst@canonical.com (mailing list archive)
State Accepted
Headers show

Commit Message

Maarten Lankhorst June 27, 2013, 11:48 a.m. UTC
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
---
 drivers/gpu/drm/radeon/radeon_object.c | 23 -----------------------
 drivers/gpu/drm/radeon/radeon_object.h | 22 +++++++++++++++++++++-
 2 files changed, 21 insertions(+), 24 deletions(-)

Comments

Jerome Glisse June 27, 2013, 10:04 p.m. UTC | #1
On Thu, Jun 27, 2013 at 01:48:23PM +0200, Maarten Lankhorst wrote:
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>

Reviewed-by: Jerome Glisse <jglisse@redhat.com>

> ---
>  drivers/gpu/drm/radeon/radeon_object.c | 23 -----------------------
>  drivers/gpu/drm/radeon/radeon_object.h | 22 +++++++++++++++++++++-
>  2 files changed, 21 insertions(+), 24 deletions(-)
> 
> diff --git a/drivers/gpu/drm/radeon/radeon_object.c b/drivers/gpu/drm/radeon/radeon_object.c
> index 71287bb..d850dc6 100644
> --- a/drivers/gpu/drm/radeon/radeon_object.c
> +++ b/drivers/gpu/drm/radeon/radeon_object.c
> @@ -619,26 +619,3 @@ int radeon_bo_wait(struct radeon_bo *bo, u32 *mem_type, bool no_wait)
>  	ttm_bo_unreserve(&bo->tbo);
>  	return r;
>  }
> -
> -
> -/**
> - * radeon_bo_reserve - reserve bo
> - * @bo:		bo structure
> - * @no_intr:	don't return -ERESTARTSYS on pending signal
> - *
> - * Returns:
> - * -ERESTARTSYS: A wait for the buffer to become unreserved was interrupted by
> - * a signal. Release all buffer reservations and return to user-space.
> - */
> -int radeon_bo_reserve(struct radeon_bo *bo, bool no_intr)
> -{
> -	int r;
> -
> -	r = ttm_bo_reserve(&bo->tbo, !no_intr, false, false, 0);
> -	if (unlikely(r != 0)) {
> -		if (r != -ERESTARTSYS)
> -			dev_err(bo->rdev->dev, "%p reserve failed\n", bo);
> -		return r;
> -	}
> -	return 0;
> -}
> diff --git a/drivers/gpu/drm/radeon/radeon_object.h b/drivers/gpu/drm/radeon/radeon_object.h
> index 3e62a3a..456ad6b 100644
> --- a/drivers/gpu/drm/radeon/radeon_object.h
> +++ b/drivers/gpu/drm/radeon/radeon_object.h
> @@ -52,7 +52,27 @@ static inline unsigned radeon_mem_type_to_domain(u32 mem_type)
>  	return 0;
>  }
>  
> -int radeon_bo_reserve(struct radeon_bo *bo, bool no_intr);
> +/**
> + * radeon_bo_reserve - reserve bo
> + * @bo:		bo structure
> + * @no_intr:	don't return -ERESTARTSYS on pending signal
> + *
> + * Returns:
> + * -ERESTARTSYS: A wait for the buffer to become unreserved was interrupted by
> + * a signal. Release all buffer reservations and return to user-space.
> + */
> +static inline int radeon_bo_reserve(struct radeon_bo *bo, bool no_intr)
> +{
> +	int r;
> +
> +	r = ttm_bo_reserve(&bo->tbo, !no_intr, false, false, 0);
> +	if (unlikely(r != 0)) {
> +		if (r != -ERESTARTSYS)
> +			dev_err(bo->rdev->dev, "%p reserve failed\n", bo);
> +		return r;
> +	}
> +	return 0;
> +}
>  
>  static inline void radeon_bo_unreserve(struct radeon_bo *bo)
>  {
> -- 
> 1.8.3.1
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox

Patch

diff --git a/drivers/gpu/drm/radeon/radeon_object.c b/drivers/gpu/drm/radeon/radeon_object.c
index 71287bb..d850dc6 100644
--- a/drivers/gpu/drm/radeon/radeon_object.c
+++ b/drivers/gpu/drm/radeon/radeon_object.c
@@ -619,26 +619,3 @@  int radeon_bo_wait(struct radeon_bo *bo, u32 *mem_type, bool no_wait)
 	ttm_bo_unreserve(&bo->tbo);
 	return r;
 }
-
-
-/**
- * radeon_bo_reserve - reserve bo
- * @bo:		bo structure
- * @no_intr:	don't return -ERESTARTSYS on pending signal
- *
- * Returns:
- * -ERESTARTSYS: A wait for the buffer to become unreserved was interrupted by
- * a signal. Release all buffer reservations and return to user-space.
- */
-int radeon_bo_reserve(struct radeon_bo *bo, bool no_intr)
-{
-	int r;
-
-	r = ttm_bo_reserve(&bo->tbo, !no_intr, false, false, 0);
-	if (unlikely(r != 0)) {
-		if (r != -ERESTARTSYS)
-			dev_err(bo->rdev->dev, "%p reserve failed\n", bo);
-		return r;
-	}
-	return 0;
-}
diff --git a/drivers/gpu/drm/radeon/radeon_object.h b/drivers/gpu/drm/radeon/radeon_object.h
index 3e62a3a..456ad6b 100644
--- a/drivers/gpu/drm/radeon/radeon_object.h
+++ b/drivers/gpu/drm/radeon/radeon_object.h
@@ -52,7 +52,27 @@  static inline unsigned radeon_mem_type_to_domain(u32 mem_type)
 	return 0;
 }
 
-int radeon_bo_reserve(struct radeon_bo *bo, bool no_intr);
+/**
+ * radeon_bo_reserve - reserve bo
+ * @bo:		bo structure
+ * @no_intr:	don't return -ERESTARTSYS on pending signal
+ *
+ * Returns:
+ * -ERESTARTSYS: A wait for the buffer to become unreserved was interrupted by
+ * a signal. Release all buffer reservations and return to user-space.
+ */
+static inline int radeon_bo_reserve(struct radeon_bo *bo, bool no_intr)
+{
+	int r;
+
+	r = ttm_bo_reserve(&bo->tbo, !no_intr, false, false, 0);
+	if (unlikely(r != 0)) {
+		if (r != -ERESTARTSYS)
+			dev_err(bo->rdev->dev, "%p reserve failed\n", bo);
+		return r;
+	}
+	return 0;
+}
 
 static inline void radeon_bo_unreserve(struct radeon_bo *bo)
 {