drm/amdgpu/virtual_dce: No need to pin the fb's bo
Subsystems (2)
PATCH 1/2 drm/amdgpu/virtual_dce: No need to pin the fb's bo
For virtual display, no need to pin the fb's bo.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 20 ++++++++++++-------- drivers/gpu/drm/amd/amdgpu/dce_virtual.c | 17 +++-------------- 2 files changed, 15 insertions(+), 22 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +12 -8
@@ -188,10 +188,12 @@ int amdgpu_display_crtc_page_flip_target(struct drm_crtc *crtc, goto cleanup; } - r =amdgpu_bo_pin (new_abo,amdgpu_display_supported_domains (adev)); -if (unlikely (r !=0 )) { -DRM_ERROR ("failed to pin new abo buffer before flip\n" ); - goto unreserve; +if (!adev->enable_virtual_display) { + r =amdgpu_bo_pin (new_abo,amdgpu_display_supported_domains (adev)); +if (unlikely (r !=0 )) { +DRM_ERROR ("failed to pin new abo buffer before flip\n" ); + goto unreserve; + } } r =amdgpu_ttm_alloc_gart (&new_abo->tbo);
@@ -211,7 +213,8 @@ int amdgpu_display_crtc_page_flip_target(struct drm_crtc *crtc,amdgpu_bo_get_tiling_flags (new_abo, &tiling_flags);amdgpu_bo_unreserve (new_abo); - work->base =amdgpu_bo_gpu_offset (new_abo); +if (!adev->enable_virtual_display) + work->base =amdgpu_bo_gpu_offset (new_abo); work->target_vblank = target - (uint32_t )drm_crtc_vblank_count (crtc) +amdgpu_get_vblank_counter_kms (dev, work->crtc_id);
@@ -242,9 +245,10 @@ int amdgpu_display_crtc_page_flip_target(struct drm_crtc *crtc, goto cleanup; } unpin: -if (unlikely (amdgpu_bo_unpin (new_abo) !=0 )) { -DRM_ERROR ("failed to unpin new abo in error path\n" ); - } +if (!adev->enable_virtual_display) +if (unlikely (amdgpu_bo_unpin (new_abo) !=0 )) +DRM_ERROR ("failed to unpin new abo in error path\n" ); + unreserve:amdgpu_bo_unreserve (new_abo);
drivers/gpu/drm/amd/amdgpu/dce_virtual.c +3 -14
@@ -167,19 +167,6 @@ static void dce_virtual_crtc_disable(struct drm_crtc *crtc)struct amdgpu_crtc *amdgpu_crtc =to_amdgpu_crtc (crtc);dce_virtual_crtc_dpms (crtc,DRM_MODE_DPMS_OFF ); -if (crtc->primary->fb) { -int r; -struct amdgpu_bo *abo; - - abo =gem_to_amdgpu_bo (crtc->primary->fb->obj[0 ]); - r =amdgpu_bo_reserve (abo, true); -if (unlikely (r)) -DRM_ERROR ("failed to reserve abo before unpin\n" ); -else { -amdgpu_bo_unpin (abo); -amdgpu_bo_unreserve (abo); - } - } amdgpu_crtc->pll_id =ATOM_PPLL_INVALID ; amdgpu_crtc->encoder =NULL ;
@@ -692,7 +679,9 @@ static int dce_virtual_pageflip(struct amdgpu_device *adev,spin_unlock_irqrestore (&adev->ddev->event_lock, flags);drm_crtc_vblank_put (&amdgpu_crtc->base); -schedule_work (&works->unpin_work); +amdgpu_bo_unref (&works->old_abo); +kfree (works->shared); +kfree (works);return 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): 1545631716-19360-1-git-send-email-Emily.Deng-5C7GfCeVMHo@public.gmane.org
PATCH 2/2 drm/amdgpu/virtual_dce: No need to pin the cursor bo
For virtual display feature, no need to pin cursor bo.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -2
@@ -2798,7 +2798,7 @@ int amdgpu_device_suspend(struct drm_device *dev, bool suspend, bool fbcon)struct drm_framebuffer *fb = crtc->primary->fb;struct amdgpu_bo *robj; -if (amdgpu_crtc->cursor_bo) { +if (amdgpu_crtc->cursor_bo && !adev->enable_virtual_display) {struct amdgpu_bo *aobj =gem_to_amdgpu_bo (amdgpu_crtc->cursor_bo); r =amdgpu_bo_reserve (aobj, true);if (r ==0 ) {
@@ -2906,7 +2906,7 @@ int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon)list_for_each_entry (crtc, &dev->mode_config.crtc_list, head) {struct amdgpu_crtc *amdgpu_crtc =to_amdgpu_crtc (crtc); -if (amdgpu_crtc->cursor_bo) { +if (amdgpu_crtc->cursor_bo && !adev->enable_virtual_display) {struct amdgpu_bo *aobj =gem_to_amdgpu_bo (amdgpu_crtc->cursor_bo); r =amdgpu_bo_reserve (aobj, true);if (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): 1545631716-19360-2-git-send-email-Emily.Deng-5C7GfCeVMHo@public.gmane.org
RE: [PATCH 2/2] drm/amdgpu/virtual_dce: No need to pin the cursor bo
Ping......
Please help to review. This issue will gate promotion to mainline, as startx will have call trace when use virtual display.
Quoted 45 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Emily Deng
Sent: Monday, December 24, 2018 2:09 PM
To: [email protected]
Cc: Deng, Emily <[email protected]>
Subject: [PATCH 2/2] drm/amdgpu/virtual_dce: No need to pin the cursor boFor virtual display feature, no need to pin cursor bo.
Signed-off-by Emily Deng <[email protected]>---
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c| 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1
-1@@ -2798,7 +2798,7 @@ int amdgpu_device_suspend(struct drm_device *dev, bool suspend, bool fbcon)struct drm_framebuffer *fb = crtc->primary->fb;struct amdgpu_bo *robj; -if (amdgpu_crtc->cursor_bo) { +if (amdgpu_crtc->cursor_bo && !adev- >enable_virtual_display) { struct amdgpu_bo *aobj =gem_to_amdgpu_bo(amdgpu_crtc->cursor_bo); r = amdgpu_bo_reserve(aobj, true); if (r == 0) {drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1
-1@@ -2906,7 +2906,7 @@ int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon) list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {struct amdgpu_crtc *amdgpu_crtc =to_amdgpu_crtc (crtc); -if (amdgpu_crtc->cursor_bo) { +if (amdgpu_crtc->cursor_bo && !adev- >enable_virtual_display) {struct
amdgpu_bo*aobj =gem_to_amdgpu_bo(amdgpu_crtc->cursor_bo); r = amdgpu_bo_reserve(aobj, true); if (r == 0) {
Quoted 7 lines
--
2.7.4_______________________________________________
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
A message that is not in the archive (sent off-list or not yet received): BN7PR12MB264451E95C2BB6A96800F0B38FB40-Zx/IyJUqfGKoYeSiBV3SvgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org
RE: [PATCH 2/2] drm/amdgpu/virtual_dce: No need to pin the cursor bo
Ping......
Best wishes
Emily Deng
Quoted 6 lines
-----Original Message-----
From: Deng, Emily <[email protected]>
Sent: Tuesday, December 25, 2018 11:53 AM
To: Deng, Emily <[email protected]>; [email protected]
Subject: RE: [PATCH 2/2] drm/amdgpu/virtual_dce: No need to pin the cursor bo
Quoted 57 lines
Ping......
Please help to review. This issue will gate promotion to mainline, as startx will have call trace when use virtual display.Quoted 53 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Emily Deng
Sent: Monday, December 24, 2018 2:09 PM
To: [email protected]
Cc: Deng, Emily <[email protected]>
Subject: [PATCH 2/2] drm/amdgpu/virtual_dce: No need to pin the cursor boFor virtual display feature, no need to pin cursor bo.
Signed-off-by Emily Deng <[email protected]>---
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c| 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1
-1@@ -2798,7 +2798,7 @@ int amdgpu_device_suspend(struct drm_device *dev, bool suspend, bool fbcon)struct drm_framebuffer *fb = crtc->primary->fb;struct amdgpu_bo *robj; -if (amdgpu_crtc->cursor_bo) { +if (amdgpu_crtc->cursor_bo && !adev- >enable_virtual_display) { struct amdgpu_bo *aobj =gem_to_amdgpu_bo(amdgpu_crtc->cursor_bo); r = amdgpu_bo_reserve(aobj, true); if (r == 0) {drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1
-1@@ -2906,7 +2906,7 @@ int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon) list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {struct amdgpu_crtc *amdgpu_crtc =to_amdgpu_crtc (crtc); -if (amdgpu_crtc->cursor_bo) { +if (amdgpu_crtc->cursor_bo && !adev- >enable_virtual_display) {struct
amdgpu_bo*aobj =gem_to_amdgpu_bo(amdgpu_crtc->cursor_bo); r = amdgpu_bo_reserve(aobj, true); if (r == 0) {--
2.7.4_______________________________________________
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
A message that is not in the archive (sent off-list or not yet received): BYAPR12MB264570B80C935D7E8298D22E8FB50-ZGDeBxoHBPkZrU9u8P1UhAdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org
Huang, Ray
Reviewed-by Huang RuiRE: [PATCH 2/2] drm/amdgpu/virtual_dce: No need to pin the cursor bo
Quoted 77 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Deng, Emily
Sent: Wednesday, December 26, 2018 10:27 AM
To: [email protected]
Subject: RE: [PATCH 2/2] drm/amdgpu/virtual_dce: No need to pin the cursor boPing......
Best wishes
Emily DengQuoted 37 lines
-----Original Message-----
From: Deng, Emily <[email protected]>
Sent: Tuesday, December 25, 2018 11:53 AM
To: Deng, Emily <[email protected]>; [email protected]
Subject: RE: [PATCH 2/2] drm/amdgpu/virtual_dce: No need to pin the cursor boPing......
Please help to review. This issue will gate promotion to mainline, as startx will have call trace when use virtual display.Quoted 26 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Emily Deng
Sent: Monday, December 24, 2018 2:09 PM
To: [email protected]
Cc: Deng, Emily <[email protected]>
Subject: [PATCH 2/2] drm/amdgpu/virtual_dce: No need to pin the cursor boFor virtual display feature, no need to pin cursor bo.
Signed-off-by Emily Deng <[email protected]>---
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c| 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0
-0@@ -2798,7 +2798,7 @@ int amdgpu_device_suspend(struct drm_device *dev, bool suspend, bool fbcon)struct drm_framebuffer *fb = crtc->primary->fb;struct amdgpu_bo *robj;Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c int amdgpu_device_resume(struct drm_device
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1
-1-if (amdgpu_crtc->cursor_bo) { +if (amdgpu_crtc->cursor_bo && !adev- >enable_virtual_display) { struct amdgpu_bo *aobj =gem_to_amdgpu_bo(amdgpu_crtc->cursor_bo); r = amdgpu_bo_reserve(aobj, true); if (r == 0) {drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0
-0@@ -2906,7 +2906,7 @@ int amdgpu_device_resume(struct drm_device*dev,
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c int amdgpu_device_resume(struct drm_device · line 2907
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0
-0bool resume, bool fbcon) list_for_each_entry(crtc, &dev->mode_config.crtc_list, head){
Quoted 13 lines
Quoted 13 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1
-1struct amdgpu_crtc *amdgpu_crtc =to_amdgpu_crtc (crtc); -if (amdgpu_crtc->cursor_bo) { +if (amdgpu_crtc->cursor_bo && !adev- >enable_virtual_display) {struct
amdgpu_bo*aobj =gem_to_amdgpu_bo(amdgpu_crtc->cursor_bo); r = amdgpu_bo_reserve(aobj, true); if (r == 0) {--
2.7.4
Quoted 8 lines
Quoted 4 lines
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
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Michel Dänzer
Reviewed-byRe: [PATCH 2/2] drm/amdgpu/virtual_dce: No need to pin the cursor bo
In reply to a message not in the archiveQuoted 22 lines · Emily Deng
For virtual display feature, no need to pin cursor bo.
Signed-off-by Emily Deng <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1
-1@@ -2798,7 +2798,7 @@ int amdgpu_device_suspend(struct drm_device *dev, bool suspend, bool fbcon)struct drm_framebuffer *fb = crtc->primary->fb;struct amdgpu_bo *robj; -if (amdgpu_crtc->cursor_bo) { +if (amdgpu_crtc->cursor_bo && !adev->enable_virtual_display) {struct amdgpu_bo *aobj =gem_to_amdgpu_bo (amdgpu_crtc->cursor_bo); r =amdgpu_bo_reserve (aobj, true);if (r ==0 ) {
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon) · line 2912
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1
-1@@ -2906,7 +2906,7 @@ int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon)list_for_each_entry (crtc, &dev->mode_config.crtc_list, head) {struct amdgpu_crtc *amdgpu_crtc =to_amdgpu_crtc (crtc); -if (amdgpu_crtc->cursor_bo) { +if (amdgpu_crtc->cursor_bo && !adev->enable_virtual_display) {struct amdgpu_bo *aobj =gem_to_amdgpu_bo (amdgpu_crtc->cursor_bo); r =amdgpu_bo_reserve (aobj, true);if (r ==0 ) {
Signature · 6 lines
Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 17 lines · Emily Deng
For virtual display, no need to pin the fb's bo.
Signed-off-by Emily Deng <[email protected]>[...]
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +0
-3@@ -188,10 +188,12 @@ int amdgpu_display_crtc_page_flip_target(struct drm_crtc *crtc, goto cleanup; } - r =amdgpu_bo_pin (new_abo,amdgpu_display_supported_domains (adev)); -if (unlikely (r !=0 )) { -DRM_ERROR ("failed to pin new abo buffer before flip\n" );
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c int amdgpu_display_crtc_page_flip_target(struct drm_crtc *crtc, · line 199
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +6
-1- goto unreserve; +if (!adev->enable_virtual_display) { + r =amdgpu_bo_pin (new_abo,amdgpu_display_supported_domains (adev)); +if (unlikely (r !=0 )) { +DRM_ERROR ("failed to pin new abo buffer before flip\n" ); + goto unreserve; + } } r =amdgpu_ttm_alloc_gart (&new_abo->tbo);
I think the amdgpu_ttm_alloc_gart call could be skipped as well?
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c int amdgpu_display_crtc_page_flip_target(struct drm_crtc *crtc, · line 250
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +3
-3@@ -242,9 +245,10 @@ int amdgpu_display_crtc_page_flip_target(struct drm_crtc *crtc, goto cleanup; } unpin: -if (unlikely (amdgpu_bo_unpin (new_abo) !=0 )) { -DRM_ERROR ("failed to unpin new abo in error path\n" ); - } +if (!adev->enable_virtual_display) +if (unlikely (amdgpu_bo_unpin (new_abo) !=0 )) +DRM_ERROR ("failed to unpin new abo in error path\n" );
This should be written as either
if (!adev->enable_virtual_display &&
unlikely(amdgpu_bo_unpin(new_abo) != 0))
DRM_ERROR("failed to unpin new abo in error path\n");or
if (!adev->enable_virtual_display) {
if (unlikely(amdgpu_bo_unpin(new_abo) != 0))
DRM_ERROR("failed to unpin new abo in error path\n");
}P.S. A lot of people are out for Christmas and New Year's.
Signature · 6 lines
Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer _______________________________________________ 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): 48efc34b-40ac-5bf9-7098-e5c0e8d4edd3-otUistvHUpPR7s880joybQ@public.gmane.org
Am 27.12.18 um 15:30 schrieb Michel Dänzer:
Quoted 27 lines · Emily Deng
Quoted 26 lines
For virtual display, no need to pin the fb's bo.
Signed-off-by Emily Deng <[email protected]>[...]
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +6
-4@@ -188,10 +188,12 @@ int amdgpu_display_crtc_page_flip_target(struct drm_crtc *crtc, goto cleanup; } - r =amdgpu_bo_pin (new_abo,amdgpu_display_supported_domains (adev)); -if (unlikely (r !=0 )) { -DRM_ERROR ("failed to pin new abo buffer before flip\n" ); - goto unreserve; +if (!adev->enable_virtual_display) { + r =amdgpu_bo_pin (new_abo,amdgpu_display_supported_domains (adev)); +if (unlikely (r !=0 )) { +DRM_ERROR ("failed to pin new abo buffer before flip\n" ); + goto unreserve; + } }
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c int amdgpu_display_crtc_page_flip_target(struct drm_crtc *crtc, · line 199
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +0
-0r =amdgpu_ttm_alloc_gart (&new_abo->tbo);I think the
amdgpu_ttm_alloc_gartcall could be skipped as well?
Yup agree.
Quoted 20 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c int amdgpu_display_crtc_page_flip_target(struct drm_crtc *crtc, · line 250
Quoted 12 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +3
-3@@ -242,9 +245,10 @@ int amdgpu_display_crtc_page_flip_target(struct drm_crtc *crtc, goto cleanup; } unpin: -if (unlikely (amdgpu_bo_unpin (new_abo) !=0 )) { -DRM_ERROR ("failed to unpin new abo in error path\n" ); - } +if (!adev->enable_virtual_display) +if (unlikely (amdgpu_bo_unpin (new_abo) !=0 )) +DRM_ERROR ("failed to unpin new abo in error path\n" );This should be written as either
if (!adev->enable_virtual_display && unlikely(amdgpu_bo_unpin(new_abo) != 0)) DRM_ERROR("failed to unpin new abo in error path\n");or
Quoted 7 lines
if (!adev->enable_virtual_display) { if (unlikely(amdgpu_bo_unpin(new_abo) != 0)) DRM_ERROR("failed to unpin new abo in error path\n"); }
P.S. A lot of people are out for Christmas and New Year's.
Indeed and thanks for the good explanation of the background in the other mail. I didn't realized that this was actually a bug fix for a pin imbalance.
BTW: It's good practice to note information like that in the commit message.
Anyway with the comment above fixed the series is Acked-by: Christian König <[email protected]>
Christian.
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx