Skip to contentSkip to conversation

drm/amdgpu: Rename amdgpu_display_framebuffer_domains()

PATCH In review Samuel Li 3 participants 3 messages Apr 18, 2018 – Apr 19, 2018 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

Samuel Li

author
#0 lore raw

PATCH 1/3 drm/amdgpu: Rename amdgpu_display_framebuffer_domains()

It returns supported domains, and domains actually used are to be decided later.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c       | 4 ++--
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.h       | 2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c            | 2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c         | 2 +-
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +--
 5 files changed, 6 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +2 -2
index 50f98df..0caa3d2 100644
@@ -189,7 +189,7 @@ int amdgpu_display_crtc_page_flip_target(struct drm_crtc *crtc,
 		goto cleanup;
 	}
 
-	r = amdgpu_bo_pin(new_abo, amdgpu_display_framebuffer_domains(adev), &base);
+	r = amdgpu_bo_pin(new_abo, amdgpu_display_supported_domains(adev), &base);
 	if (unlikely(r != 0)) {
 		DRM_ERROR("failed to pin new abo buffer before flip\n");
 		goto unreserve;
@@ -484,7 +484,7 @@ static const struct drm_framebuffer_funcs amdgpu_fb_funcs = {
 	.create_handle = drm_gem_fb_create_handle,
 };
 
-uint32_t amdgpu_display_framebuffer_domains(struct amdgpu_device *adev)
+uint32_t amdgpu_display_supported_domains(struct amdgpu_device *adev)
 {
 	uint32_t domain = AMDGPU_GEM_DOMAIN_VRAM;
 
drivers/gpu/drm/amd/amdgpu/amdgpu_display.h +1 -1
index 2b11d80..f66e3e3 100644
@@ -23,7 +23,7 @@
 #ifndef __AMDGPU_DISPLAY_H__
 #define __AMDGPU_DISPLAY_H__
 
-uint32_t amdgpu_display_framebuffer_domains(struct amdgpu_device *adev);
+uint32_t amdgpu_display_supported_domains(struct amdgpu_device *adev);
 struct drm_framebuffer *
 amdgpu_display_user_framebuffer_create(struct drm_device *dev,
 				       struct drm_file *file_priv,
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +1 -1
index ff89e84..bc5fd8e 100644
@@ -137,7 +137,7 @@ static int amdgpufb_create_pinned_object(struct amdgpu_fbdev *rfbdev,
 	/* need to align pitch with crtc limits */
 	mode_cmd->pitches[0] = amdgpu_align_pitch(adev, mode_cmd->width, cpp,
 						  fb_tiled);
-	domain = amdgpu_display_framebuffer_domains(adev);
+	domain = amdgpu_display_supported_domains(adev);
 
 	height = ALIGN(mode_cmd->height, 8);
 	size = mode_cmd->pitches[0] * height;
drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c +1 -1
index 4b584cb7..cf0749f 100644
@@ -209,7 +209,7 @@ static int amdgpu_gem_begin_cpu_access(struct dma_buf *dma_buf,
 	struct amdgpu_bo *bo = gem_to_amdgpu_bo(dma_buf->priv);
 	struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev);
 	struct ttm_operation_ctx ctx = { true, false };
-	u32 domain = amdgpu_display_framebuffer_domains(adev);
+	u32 domain = amdgpu_display_supported_domains(adev);
 	int ret;
 	bool reads = (direction == DMA_BIDIRECTIONAL ||
 		      direction == DMA_FROM_DEVICE);
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -2
index 6f92a19..1f5603a 100644
@@ -3109,12 +3109,11 @@ static int dm_plane_helper_prepare_fb(struct drm_plane *plane,
 		return r;
 
 	if (plane->type != DRM_PLANE_TYPE_CURSOR)
-		domain = amdgpu_display_framebuffer_domains(adev);
+		domain = amdgpu_display_supported_domains(adev);
 	else
 		domain = AMDGPU_GEM_DOMAIN_VRAM;
 
 	r = amdgpu_bo_pin(rbo, domain, &afb->address);
-
 	amdgpu_bo_unreserve(rbo);
 
 	if (unlikely(r != 0)) {
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1524088242-9233-1-git-send-email-Samuel.Li-5C7GfCeVMHo@public.gmane.org

Reviewed-by
#2 lore raw
Quoted 2 lines · Samuel Li

It returns supported domains, and domains actually used are to be decided later.

maybe clarify the commit message a bit. E.g.,
It returns supported domains for display, and domains actually used are to be decided later when we pin them.

Either way:

Quoted 92 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c       | 4 ++--
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.h       | 2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c            | 2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c         | 2 +-
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +--
 5 files changed, 6 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +2 -2
index 50f98df..0caa3d2 100644
@@ -189,7 +189,7 @@ int amdgpu_display_crtc_page_flip_target(struct drm_crtc *crtc,
                goto cleanup;
        }
 
-       r = amdgpu_bo_pin(new_abo, amdgpu_display_framebuffer_domains(adev), &base);
+       r = amdgpu_bo_pin(new_abo, amdgpu_display_supported_domains(adev), &base);
        if (unlikely(r != 0)) {
                DRM_ERROR("failed to pin new abo buffer before flip\n");
                goto unreserve;
@@ -484,7 +484,7 @@ static const struct drm_framebuffer_funcs amdgpu_fb_funcs = {
        .create_handle = drm_gem_fb_create_handle,
 };
 
-uint32_t amdgpu_display_framebuffer_domains(struct amdgpu_device *adev)
+uint32_t amdgpu_display_supported_domains(struct amdgpu_device *adev)
 {
        uint32_t domain = AMDGPU_GEM_DOMAIN_VRAM;
 
drivers/gpu/drm/amd/amdgpu/amdgpu_display.h +1 -1
index 2b11d80..f66e3e3 100644
@@ -23,7 +23,7 @@
 #ifndef __AMDGPU_DISPLAY_H__
 #define __AMDGPU_DISPLAY_H__
 
-uint32_t amdgpu_display_framebuffer_domains(struct amdgpu_device *adev);
+uint32_t amdgpu_display_supported_domains(struct amdgpu_device *adev);
 struct drm_framebuffer *
 amdgpu_display_user_framebuffer_create(struct drm_device *dev,
                                       struct drm_file *file_priv,
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +1 -1
index ff89e84..bc5fd8e 100644
@@ -137,7 +137,7 @@ static int amdgpufb_create_pinned_object(struct amdgpu_fbdev *rfbdev,
        /* need to align pitch with crtc limits */
        mode_cmd->pitches[0] = amdgpu_align_pitch(adev, mode_cmd->width, cpp,
                                                  fb_tiled);
-       domain = amdgpu_display_framebuffer_domains(adev);
+       domain = amdgpu_display_supported_domains(adev);
 
        height = ALIGN(mode_cmd->height, 8);
        size = mode_cmd->pitches[0] * height;
drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c +1 -1
index 4b584cb7..cf0749f 100644
@@ -209,7 +209,7 @@ static int amdgpu_gem_begin_cpu_access(struct dma_buf *dma_buf,
        struct amdgpu_bo *bo = gem_to_amdgpu_bo(dma_buf->priv);
        struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev);
        struct ttm_operation_ctx ctx = { true, false };
-       u32 domain = amdgpu_display_framebuffer_domains(adev);
+       u32 domain = amdgpu_display_supported_domains(adev);
        int ret;
        bool reads = (direction == DMA_BIDIRECTIONAL ||
                      direction == DMA_FROM_DEVICE);
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -3
index 6f92a19..1f5603a 100644
@@ -3109,12 +3109,11 @@ static int dm_plane_helper_prepare_fb(struct drm_plane *plane,
                return r;
 
        if (plane->type != DRM_PLANE_TYPE_CURSOR)
-               domain = amdgpu_display_framebuffer_domains(adev);
+               domain = amdgpu_display_supported_domains(adev);
        else
                domain = AMDGPU_GEM_DOMAIN_VRAM;
 
        r = amdgpu_bo_pin(rbo, domain, &afb->address);
-
        amdgpu_bo_unreserve(rbo);
 
        if (unlikely(r != 0)) {
--

2.7.4

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#3 lore raw
In reply to a message not in the archive

With Alex note addressed patch #1 & #2 are Reviewed-by: Christian König <[email protected]>

Regards,
Christian.

Am 18.04.2018 um 23:50 schrieb Samuel Li:

Quoted 81 lines

It returns supported domains, and domains actually used are to be decided later.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_display.c       | 4 ++--
  drivers/gpu/drm/amd/amdgpu/amdgpu_display.h       | 2 +-
  drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c            | 2 +-
  drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c         | 2 +-
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +--
  5 files changed, 6 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +2 -2
index 50f98df..0caa3d2 100644
@@ -189,7 +189,7 @@ int amdgpu_display_crtc_page_flip_target(struct drm_crtc *crtc,
  		goto cleanup;
  	}
 
-	r = amdgpu_bo_pin(new_abo, amdgpu_display_framebuffer_domains(adev), &base);
+	r = amdgpu_bo_pin(new_abo, amdgpu_display_supported_domains(adev), &base);
  	if (unlikely(r != 0)) {
  		DRM_ERROR("failed to pin new abo buffer before flip\n");
  		goto unreserve;
@@ -484,7 +484,7 @@ static const struct drm_framebuffer_funcs amdgpu_fb_funcs = {
  	.create_handle = drm_gem_fb_create_handle,
  };
 
-uint32_t amdgpu_display_framebuffer_domains(struct amdgpu_device *adev)
+uint32_t amdgpu_display_supported_domains(struct amdgpu_device *adev)
  {
  	uint32_t domain = AMDGPU_GEM_DOMAIN_VRAM;
 
drivers/gpu/drm/amd/amdgpu/amdgpu_display.h +1 -1
index 2b11d80..f66e3e3 100644
@@ -23,7 +23,7 @@
  #ifndef __AMDGPU_DISPLAY_H__
  #define __AMDGPU_DISPLAY_H__
 
-uint32_t amdgpu_display_framebuffer_domains(struct amdgpu_device *adev);
+uint32_t amdgpu_display_supported_domains(struct amdgpu_device *adev);
  struct drm_framebuffer *
  amdgpu_display_user_framebuffer_create(struct drm_device *dev,
  				       struct drm_file *file_priv,
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +1 -1
index ff89e84..bc5fd8e 100644
@@ -137,7 +137,7 @@ static int amdgpufb_create_pinned_object(struct amdgpu_fbdev *rfbdev,
  	/* need to align pitch with crtc limits */
  	mode_cmd->pitches[0] = amdgpu_align_pitch(adev, mode_cmd->width, cpp,
  						  fb_tiled);
-	domain = amdgpu_display_framebuffer_domains(adev);
+	domain = amdgpu_display_supported_domains(adev);
 
  	height = ALIGN(mode_cmd->height, 8);
  	size = mode_cmd->pitches[0] * height;
drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c +1 -1
index 4b584cb7..cf0749f 100644
@@ -209,7 +209,7 @@ static int amdgpu_gem_begin_cpu_access(struct dma_buf *dma_buf,
  	struct amdgpu_bo *bo = gem_to_amdgpu_bo(dma_buf->priv);
  	struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev);
  	struct ttm_operation_ctx ctx = { true, false };
-	u32 domain = amdgpu_display_framebuffer_domains(adev);
+	u32 domain = amdgpu_display_supported_domains(adev);
  	int ret;
  	bool reads = (direction == DMA_BIDIRECTIONAL ||
  		      direction == DMA_FROM_DEVICE);
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
index 6f92a19..1f5603a 100644
@@ -3109,12 +3109,11 @@ static int dm_plane_helper_prepare_fb(struct drm_plane *plane,
  		return r;
 
  	if (plane->type != DRM_PLANE_TYPE_CURSOR)

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int dm_plane_helper_prepare_fb(struct drm_plane *plane, · line 3119

Quoted 10 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -2
-		domain = amdgpu_display_framebuffer_domains(adev);
+		domain = amdgpu_display_supported_domains(adev);
  	else
  		domain = AMDGPU_GEM_DOMAIN_VRAM;
 
  	r = amdgpu_bo_pin(rbo, domain, &afb->address);
-
  	amdgpu_bo_unreserve(rbo);
 
  	if (unlikely(r != 0)) {

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx