drm/amdgpu/virtual_dce: Need to pin the fb's bo
Subsystems (2)
PATCH 1/1 drm/amdgpu/virtual_dce: Need to pin the fb's bo
When the bo is used to set mode, the bo need to be pinned.
--- drivers/gpu/drm/amd/amdgpu/dce_virtual.c | 54 ++++++++++++++++++++++++-------- 1 file changed, 41 insertions(+), 13 deletions(-)
drivers/gpu/drm/amd/amdgpu/dce_virtual.c +41 -13
@@ -211,19 +211,6 @@ static void dce_virtual_crtc_disable(struct drm_crtc *crtc) amdgpu_crtc->connector =NULL ; } -static int dce_virtual_crtc_mode_set (struct drm_crtc *crtc, -struct drm_display_mode *mode, -struct drm_display_mode *adjusted_mode, -int x,int y,struct drm_framebuffer *old_fb) -{ -struct amdgpu_crtc *amdgpu_crtc =to_amdgpu_crtc (crtc); - -/* update the hw version fpr dpm */ - amdgpu_crtc->hw_mode = *adjusted_mode; - -return 0 ; -} -static bool dce_virtual_crtc_mode_fixup (struct drm_crtc *crtc,const struct drm_display_mode *mode,struct drm_display_mode *adjusted_mode)
@@ -235,6 +222,47 @@ static bool dce_virtual_crtc_mode_fixup(struct drm_crtc *crtc,static int dce_virtual_crtc_set_base (struct drm_crtc *crtc,int x,int y,struct drm_framebuffer *old_fb) { +struct drm_framebuffer *target_fb; +struct drm_gem_object *obj; +struct amdgpu_bo *abo; +int r; + +/* no fb bound */ +if (!crtc->primary->fb) { +DRM_DEBUG_KMS ("No FB bound\n" ); +return 0 ; + } + + target_fb = crtc->primary->fb; + + obj =kcl_drm_fb_get_gem_obj (target_fb,0 ); + abo =gem_to_amdgpu_bo (obj); + r =amdgpu_bo_reserve (abo, false); +if (unlikely (r !=0 )) +return r; + + r =amdgpu_bo_pin (abo,AMDGPU_GEM_DOMAIN_VRAM ); +if (unlikely (r !=0 )) { +amdgpu_bo_unreserve (abo); +return -EINVAL ; + } + +amdgpu_bo_unreserve (abo); +return 0 ; +} + +static int dce_virtual_crtc_mode_set (struct drm_crtc *crtc, +struct drm_display_mode *mode, +struct drm_display_mode *adjusted_mode, +int x,int y,struct drm_framebuffer *old_fb) +{ +struct amdgpu_crtc *amdgpu_crtc =to_amdgpu_crtc (crtc); + +dce_virtual_crtc_set_base (crtc, x, y, old_fb); + +/* update the hw version fpr dpm */ + amdgpu_crtc->hw_mode = *adjusted_mode; +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): 1545377209-10718-1-git-send-email-Emily.Deng-5C7GfCeVMHo@public.gmane.org
Quoted 28 lines · Emily Deng
When the bo is used to set mode, the bo need to be pinned.
Signed-off-by Emily Deng <[email protected]>[...]
drivers/gpu/drm/amd/amdgpu/dce_virtual.c +18
-0@@ -235,6 +222,47 @@ static bool dce_virtual_crtc_mode_fixup(struct drm_crtc *crtc,static int dce_virtual_crtc_set_base (struct drm_crtc *crtc,int x,int y,struct drm_framebuffer *old_fb) { +struct drm_framebuffer *target_fb; +struct drm_gem_object *obj; +struct amdgpu_bo *abo; +int r; + +/* no fb bound */ +if (!crtc->primary->fb) { +DRM_DEBUG_KMS ("No FB bound\n" ); +return 0 ; + } + + target_fb = crtc->primary->fb; + + obj =kcl_drm_fb_get_gem_obj (target_fb,0 ); + abo =gem_to_amdgpu_bo (obj); + r =amdgpu_bo_reserve (abo, false); +if (unlikely (r !=0 )) +return r;
drivers/gpu/drm/amd/amdgpu/dce_virtual.c static bool dce_virtual_crtc_mode_fixup(struct drm_crtc *crtc, · line 252
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/dce_virtual.c +10
-0+ + r =amdgpu_bo_pin (abo,AMDGPU_GEM_DOMAIN_VRAM ); +if (unlikely (r !=0 )) { +amdgpu_bo_unreserve (abo); +return -EINVAL ; + } + +amdgpu_bo_unreserve (abo); +return 0 ; +}
Good catch, but old_fb also needs to be unpinned, otherwise the pinning is unbalanced and a BO will always be pinned after it's scanned out once.
drivers/gpu/drm/amd/amdgpu/dce_virtual.c static bool dce_virtual_crtc_mode_fixup(struct drm_crtc *crtc, · line 257
Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/dce_virtual.c +4
-0+static int dce_virtual_crtc_mode_set (struct drm_crtc *crtc, +struct drm_display_mode *mode, +struct drm_display_mode *adjusted_mode, +int x,int y,struct drm_framebuffer *old_fb)
Indentation of the continuation lines here looks wrong (needs 3 more spaces if I'm counting correctly). Would be good to fix that up while you're moving the function. :)
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 1 line · Emily Deng
When the bo is used to set mode, the bo need to be pinned.
On second thought, why does the BO need to be pinned? When using the display hardware, the BO needs to be pinned to prevent it from being moved while the hardware is scanning out from it, but that shouldn't be necessary here.
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): 3d75c11d-1172-1d0e-17a6-b5931660fe61-otUistvHUpPR7s880joybQ@public.gmane.org
Quoted 7 lines
-----Original Message-----
From: Michel Dänzer <[email protected]>
Sent: Friday, December 21, 2018 4:38 PM
To: Deng, Emily <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/amdgpu/virtual_dce: Need to pin the fb's bo
Quoted 6 lines
Quoted 1 line · Emily Deng
When the bo is used to set mode, the bo need to be pinned.
On second thought, why does the BO need to be pinned? When using the display hardware, the BO needs to be pinned to prevent it from being moved while the hardware is scanning out from it, but that shouldn't be necessary here.
The pin here is used for scan out the buffer by remote display app.
Best wishes
Emily Deng
Quoted 4 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): BN7PR12MB26449E825462ADBC0AC0A2E68FB80-Zx/IyJUqfGKoYeSiBV3SvgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org
Quoted 7 lines · Emily
Quoted 7 lines
-----Original Message-----
From: Michel Dänzer <[email protected]>
Sent: Friday, December 21, 2018 4:38 PM
To: Deng, Emily <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/amdgpu/virtual_dce: Need to pin the fb's bo
Quoted 7 lines
Quoted 6 lines · Emily Deng
Quoted 1 line
When the bo is used to set mode, the bo need to be pinned.
On second thought, why does the BO need to be pinned? When using the display hardware, the BO needs to be pinned to prevent it from being moved while the hardware is scanning out from it, but that shouldn't be necessary here.
The pin here is used for scan out the buffer by remote display app.
I still don't understand why pinning is needed. What mechanism does the remote display app use to access the BO contents?
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): 34e8133d-c462-f836-5d95-db3119fd311d-otUistvHUpPR7s880joybQ@public.gmane.org
Quoted 18 lines
-----Original Message-----
From: Michel Dänzer <[email protected]>
Sent: Friday, December 21, 2018 4:52 PM
To: Deng, Emily <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/amdgpu/virtual_dce: Need to pin the fb's boQuoted 10 lines · Emily
Quoted 10 lines
-----Original Message-----
From: Michel Dänzer <[email protected]>
Sent: Friday, December 21, 2018 4:38 PM
To: Deng, Emily <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/amdgpu/virtual_dce: Need to pin the fb's boQuoted 1 line · Emily Deng
When the bo is used to set mode, the bo need to be pinned.
Quoted 8 lines
Quoted 3 lines
Quoted 3 lines
On second thought, why does the BO need to be pinned? When using the display hardware, the BO needs to be pinned to prevent it from being moved while the hardware is scanning out from it, but that shouldn't be
necessary here.
Quoted 1 line
The pin here is used for scan out the buffer by remote display app.
I still don't understand why pinning is needed. What mechanism does the remote display app use to access the BO contents?
Sorry, I am not familiar with the remote display app. Maybe it will use drm ioctl function to get the current crtc's fb's information, and get the content in the fb's buffer object by mmap or translate the bo to an OpenGL texture for next rendering. Maybe don't need to pin the bo here, as the use has no different with other normal bos. So please ignore the patch, and will send another patch to remove the unpin the fb's bo code.
Quoted 5 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): BN7PR12MB2644EEFF06A0CCBC499C7C388FB80-Zx/IyJUqfGKoYeSiBV3SvgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org
Quoted 33 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Deng, Emily
Sent: Friday, December 21, 2018 5:10 PM
To: Michel Dänzer <[email protected]>
Cc: [email protected]
Subject: RE: [PATCH] drm/amdgpu/virtual_dce: Need to pin the fb's boQuoted 25 lines
-----Original Message-----
From: Michel Dänzer <[email protected]>
Sent: Friday, December 21, 2018 4:52 PM
To: Deng, Emily <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/amdgpu/virtual_dce: Need to pin the fb's boQuoted 7 lines · Emily
Quoted 7 lines
-----Original Message-----
From: Michel Dänzer <[email protected]>
Sent: Friday, December 21, 2018 4:38 PM
To: Deng, Emily <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/amdgpu/virtual_dce: Need to pin the fb's boQuoted 7 lines
Quoted 7 lines · Emily Deng
Quoted 1 line
When the bo is used to set mode, the bo need to be pinned.
On second thought, why does the BO need to be pinned? When using the display hardware, the BO needs to be pinned to prevent it from being moved while the hardware is scanning out from it, but that shouldn't be
necessary here.
Quoted 1 line
The pin here is used for scan out the buffer by remote display app.
Quoted 8 lines
Quoted 2 lines
I still don't understand why pinning is needed. What mechanism does the remote display app use to access the BO contents?
Sorry, I am not familiar with the remote display app. Maybe it will use drm ioctl function to get the current crtc's fb's information, and get the content in the fb's buffer object by mmap or translate the bo to an OpenGL texture for next rendering. Maybe don't need to pin the bo here, as the use has no different with other normal bos. So please ignore the patch, and will send another patch to remove the unpin the fb's bo code.
It seems to be hard to remove all the pin for virtual_dce, as it uses some common code in amdgpu_display.c. So for code consistency, maybe still need to add the pin here.
Best wishes
Emily Deng
Quoted 9 lines
Quoted 5 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
_______________________________________________
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): BN7PR12MB2644A1EA60FCFF6EAF4D1EA68FB80-Zx/IyJUqfGKoYeSiBV3SvgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org
Quoted 17 lines · Emily
Quoted 17 lines
From: amd-gfx <[email protected]> On Behalf Of Deng, Emily
Quoted 15 lines
From: Michel Dänzer <[email protected]>
Quoted 8 lines · Emily
Quoted 8 lines
From: Michel Dänzer <[email protected]>
Quoted 1 line · Emily Deng
When the bo is used to set mode, the bo need to be pinned.
On second thought, why does the BO need to be pinned? When using the display hardware, the BO needs to be pinned to prevent it from being moved while the hardware is scanning out from it, but that shouldn't be
necessary here.
Quoted 1 line
The pin here is used for scan out the buffer by remote display app.
I still don't understand why pinning is needed. What mechanism does the remote display app use to access the BO contents?
Quoted 7 lines
Quoted 6 lines
Sorry, I am not familiar with the remote display app. Maybe it will use drm ioctl function to get the current crtc's fb's information, and get the content in the fb's buffer object by mmap or translate the bo to an OpenGL texture for next rendering. Maybe don't need to pin the bo here, as the use has no different with other normal bos. So please ignore the patch, and will send another patch to remove the unpin the fb's bo code.
It seems to be hard to remove all the pin for
virtual_dce, as it uses some common code inamdgpu_display.c.
Because of amdgpu_display_unpin_work_func? That might be as simple as replacing
schedule_work(&works->unpin_work);
with
kfree(works->shared); kfree(works);
in dce_virtual_pageflip.
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): fdf3f8d0-a7f1-7508-064e-68582fda83d0-otUistvHUpPR7s880joybQ@public.gmane.org
Quoted 38 lines
-----Original Message-----
From: Michel Dänzer <[email protected]>
Sent: Friday, December 21, 2018 5:28 PM
To: Deng, Emily <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/amdgpu/virtual_dce: Need to pin the fb's boQuoted 15 lines · Emily
Quoted 15 lines
From: amd-gfx <[email protected]> On Behalf Of Deng, Emily
Quoted 13 lines
From: Michel Dänzer <[email protected]> On 2018-12-21 9:45 a.m.,
Quoted 8 lines · Emily
Quoted 8 lines
From: Michel Dänzer <[email protected]> On 2018-12-21 8:26 a.m.,
Quoted 1 line · Emily Deng
When the bo is used to set mode, the bo need to be pinned.
On second thought, why does the BO need to be pinned? When using the display hardware, the BO needs to be pinned to prevent it from being moved while the hardware is scanning out from it, but that shouldn't be
necessary here.
Quoted 1 line
The pin here is used for scan out the buffer by remote display app.
Quoted 8 lines
Quoted 8 lines
Quoted 2 lines
I still don't understand why pinning is needed. What mechanism does the remote display app use to access the BO contents?
Sorry, I am not familiar with the remote display app. Maybe it will use drm ioctl function to get the current crtc's fb's information, and get the content in the fb's buffer object by mmap or translate the bo to an OpenGL texture for next rendering. Maybe don't need to pin the bo here, as the use has no different with other normal bos. So please ignore the patch, and will send another patch to remove the unpin
the fb's bo code.
Quoted 1 line
It seems to be hard to remove all the pin for
virtual_dce, as it uses somecommon code in
amdgpu_display.c.Because of
amdgpu_display_unpin_work_func? That might be as simple as replacing
Quoted 8 lines
schedule_work(&works->unpin_work);with
kfree(works->shared); kfree(works);in
dce_virtual_pageflip.
But the amdgpu_display_crtc_page_flip_target will pin the new_bo, then we don't need to unpin it?
Best wishes
Emily Deng
Quoted 5 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): BN7PR12MB2644E13CE38FA66E11E87D148FB80-Zx/IyJUqfGKoYeSiBV3SvgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org
Quoted 40 lines · Emily
Quoted 40 lines
-----Original Message-----
From: Michel Dänzer <[email protected]>
Sent: Friday, December 21, 2018 5:28 PM
To: Deng, Emily <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/amdgpu/virtual_dce: Need to pin the fb's boQuoted 15 lines · Emily
Quoted 15 lines
From: amd-gfx <[email protected]> On Behalf Of Deng, Emily
Quoted 13 lines
From: Michel Dänzer <[email protected]> On 2018-12-21 9:45 a.m.,
Quoted 8 lines · Emily
Quoted 8 lines
From: Michel Dänzer <[email protected]> On 2018-12-21 8:26 a.m.,
Quoted 1 line · Emily Deng
When the bo is used to set mode, the bo need to be pinned.
On second thought, why does the BO need to be pinned? When using the display hardware, the BO needs to be pinned to prevent it from being moved while the hardware is scanning out from it, but that shouldn't be
necessary here.
Quoted 1 line
The pin here is used for scan out the buffer by remote display app.
Quoted 8 lines
Quoted 8 lines
Quoted 2 lines
I still don't understand why pinning is needed. What mechanism does the remote display app use to access the BO contents?
Sorry, I am not familiar with the remote display app. Maybe it will use drm ioctl function to get the current crtc's fb's information, and get the content in the fb's buffer object by mmap or translate the bo to an OpenGL texture for next rendering. Maybe don't need to pin the bo here, as the use has no different with other normal bos. So please ignore the patch, and will send another patch to remove the unpin
the fb's bo code.
Quoted 1 line
It seems to be hard to remove all the pin for
virtual_dce, as it uses somecommon code in
amdgpu_display.c.Because of
amdgpu_display_unpin_work_func? That might be as simple as replacingschedule_work(&works->unpin_work);
Quoted 8 lines
Quoted 6 lines
with
kfree(works->shared); kfree(works);in
dce_virtual_pageflip.But the
amdgpu_display_crtc_page_flip_targetwill pin thenew_bo, then we don't need to unpin it?
Ah, right, but then dce_virtual_pageflip could just unpin it? Not ideal, but better than leaving it pinned unnecessarily.
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): 1d1f4244-da71-5228-998c-50757269f883-otUistvHUpPR7s880joybQ@public.gmane.org
Quoted 55 lines
-----Original Message-----
From: Michel Dänzer <[email protected]>
Sent: Friday, December 21, 2018 5:37 PM
To: Deng, Emily <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/amdgpu/virtual_dce: Need to pin the fb's boQuoted 47 lines · Emily
Quoted 47 lines
-----Original Message-----
From: Michel Dänzer <[email protected]>
Sent: Friday, December 21, 2018 5:28 PM
To: Deng, Emily <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/amdgpu/virtual_dce: Need to pin the fb's boQuoted 17 lines · Emily
Quoted 17 lines
From: amd-gfx <[email protected]> On Behalf Of Deng, Emily
Quoted 15 lines
From: Michel Dänzer <[email protected]> On 2018-12-21 9:45 a.m.,
Quoted 8 lines · Emily
Quoted 8 lines
From: Michel Dänzer <[email protected]> On 2018-12-21 8:26
Quoted 1 line · Emily Deng
When the bo is used to set mode, the bo need to be pinned.
On second thought, why does the BO need to be pinned? When using the display hardware, the BO needs to be pinned to prevent it from being moved while the hardware is scanning out from it, but that shouldn't be
necessary here.
Quoted 1 line
The pin here is used for scan out the buffer by remote display app.
I still don't understand why pinning is needed. What mechanism does the remote display app use to access the BO contents?
Quoted 7 lines
Quoted 7 lines
Sorry, I am not familiar with the remote display app. Maybe it will use drm ioctl function to get the current crtc's fb's information, and get the content in the fb's buffer object by mmap or translate the bo to an OpenGL texture for next rendering. Maybe don't need to pin the bo here, as the use has no different with other normal bos. So please ignore the patch, and will send another patch to remove the unpin
the fb's bo code.
Quoted 2 lines
It seems to be hard to remove all the pin for
virtual_dce, as it uses somecommon code in
amdgpu_display.c.Because of
amdgpu_display_unpin_work_func? That might be as simple as replacingschedule_work(&works->unpin_work);with
kfree(works->shared); kfree(works);
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
in
dce_virtual_pageflip.But the
amdgpu_display_crtc_page_flip_targetwill pin thenew_bo, then we don't need to unpin it?Ah, right, but then
dce_virtual_pageflipcould just unpin it? Not ideal, but better than leaving it pinned unnecessarily.
Yes, it is not a good idea to leave it pinned. Then will need lots of "if (amdgpu_virtual_display)", don't know whether it could be accept?
Quoted 5 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): BN7PR12MB2644A624B2C85FD9C2301F248FB80-Zx/IyJUqfGKoYeSiBV3SvgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org
Quoted 64 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Deng, Emily
Sent: Friday, December 21, 2018 5:41 PM
To: Michel Dänzer <[email protected]>
Cc: [email protected]
Subject: RE: [PATCH] drm/amdgpu/virtual_dce: Need to pin the fb's boQuoted 7 lines
-----Original Message-----
From: Michel Dänzer <[email protected]>
Sent: Friday, December 21, 2018 5:37 PM
To: Deng, Emily <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/amdgpu/virtual_dce: Need to pin the fb's boQuoted 31 lines
Quoted 30 lines · Emily
Quoted 30 lines
-----Original Message-----
From: Michel Dänzer <[email protected]>
Sent: Friday, December 21, 2018 5:28 PM
To: Deng, Emily <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/amdgpu/virtual_dce: Need to pin the fb's boQuoted 22 lines · Emily
Quoted 22 lines
From: amd-gfx <[email protected]> On Behalf Of Deng, Emily
Quoted 10 lines
From: Michel Dänzer <[email protected]> On 2018-12-21 9:45 a.m.,
Quoted 8 lines · Emily
Quoted 8 lines
From: Michel Dänzer <[email protected]> On 2018-12-21 8:26
Quoted 1 line · Emily Deng
When the bo is used to set mode, the bo need to be pinned.
On second thought, why does the BO need to be pinned? When using the display hardware, the BO needs to be pinned to prevent it from being moved while the hardware is scanning out from it, but that shouldn't be
Quoted 5 lines
necessary here.
Quoted 1 line
The pin here is used for scan out the buffer by remote display app.
I still don't understand why pinning is needed. What mechanism does the remote display app use to access the BO contents?
Sorry, I am not familiar with the remote display app. Maybe it will use drm ioctl function to get the current crtc's fb's information, and get the content in the fb's buffer object by mmap or translate the bo to an OpenGL texture for next rendering. Maybe don't need to pin the bo here, as the use has no different with other
normal bos.
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 2 lines
Quoted 2 lines
So please ignore the patch, and will send another patch to remove the unpin
the fb's bo code.
Quoted 2 lines
It seems to be hard to remove all the pin for
virtual_dce, as it uses somecommon code in
amdgpu_display.c.Because of
amdgpu_display_unpin_work_func? That might be as simple as replacingschedule_work(&works->unpin_work);with
kfree(works->shared); kfree(works);
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
in
dce_virtual_pageflip.But the
amdgpu_display_crtc_page_flip_targetwill pin thenew_bo, then we don't need to unpin it?Ah, right, but then
dce_virtual_pageflipcould just unpin it? Not ideal, but better than leaving it pinned unnecessarily.Yes, it is not a good idea to leave it pinned. Then will need lots of "if (
amdgpu_virtual_display)", don't know whether it could be accept?
Another method is let the logical stay no change, just use if (!amdgpu_virtual_display) before WARN_ON_ONCE of amdgpu_bo_unpin to remove the virtual_dce's call trace. Which method do you think is better?
Quoted 9 lines
Quoted 5 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
_______________________________________________
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): BN7PR12MB2644288A07D80ED1C48A2FF18FB80-Zx/IyJUqfGKoYeSiBV3SvgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org
Quoted 64 lines · Emily
Quoted 64 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Deng, Emily
Sent: Friday, December 21, 2018 5:41 PM
To: Michel Dänzer <[email protected]>
Cc: [email protected]
Subject: RE: [PATCH] drm/amdgpu/virtual_dce: Need to pin the fb's boQuoted 7 lines
-----Original Message-----
From: Michel Dänzer <[email protected]>
Sent: Friday, December 21, 2018 5:37 PM
To: Deng, Emily <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/amdgpu/virtual_dce: Need to pin the fb's boQuoted 31 lines
Quoted 30 lines · Emily
Quoted 30 lines
-----Original Message-----
From: Michel Dänzer <[email protected]>
Sent: Friday, December 21, 2018 5:28 PM
To: Deng, Emily <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/amdgpu/virtual_dce: Need to pin the fb's boQuoted 22 lines · Emily
Quoted 22 lines
From: amd-gfx <[email protected]> On Behalf Of Deng, Emily
Quoted 10 lines
From: Michel Dänzer <[email protected]> On 2018-12-21 9:45 a.m.,
Quoted 8 lines · Emily
Quoted 8 lines
From: Michel Dänzer <[email protected]> On 2018-12-21 8:26
Quoted 1 line · Emily Deng
When the bo is used to set mode, the bo need to be pinned.
On second thought, why does the BO need to be pinned? When using the display hardware, the BO needs to be pinned to prevent it from being moved while the hardware is scanning out from it, but that shouldn't be
Quoted 5 lines
necessary here.
Quoted 1 line
The pin here is used for scan out the buffer by remote display app.
I still don't understand why pinning is needed. What mechanism does the remote display app use to access the BO contents?
Sorry, I am not familiar with the remote display app. Maybe it will use drm ioctl function to get the current crtc's fb's information, and get the content in the fb's buffer object by mmap or translate the bo to an OpenGL texture for next rendering. Maybe don't need to pin the bo here, as the use has no different with other
normal bos.
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 2 lines
Quoted 2 lines
So please ignore the patch, and will send another patch to remove the unpin
the fb's bo code.
Quoted 2 lines
It seems to be hard to remove all the pin for
virtual_dce, as it uses somecommon code in
amdgpu_display.c.Because of
amdgpu_display_unpin_work_func? That might be as simple as replacingschedule_work(&works->unpin_work);with
kfree(works->shared); kfree(works);
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
in
dce_virtual_pageflip.But the
amdgpu_display_crtc_page_flip_targetwill pin thenew_bo, then we don't need to unpin it?Ah, right, but then
dce_virtual_pageflipcould just unpin it? Not ideal, but better than leaving it pinned unnecessarily.Yes, it is not a good idea to leave it pinned. Then will need lots of "if (
amdgpu_virtual_display)", don't know whether it could be accept?
Should rather be if (adev->enable_virtual_display). If you want to never pin, it's probably worth giving this a shot and seeing how bad it gets. BTW, amdgpu_ttm_alloc_gart can probably also be skipped for virtual display, maybe more.
Quoted 2 lines
Another method is let the logical stay no change, just use if (!amdgpu_virtual_display) before
WARN_ON_ONCEofamdgpu_bo_unpinto remove the virtual_dce's call trace.
That would be ugly IMHO.
But none of that is necessary if dce_virtual_pageflip simply unpins the BO and skips unpin_work.
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): 597fa95d-1e05-ef71-5f5b-53ad1ae932ad-otUistvHUpPR7s880joybQ@public.gmane.org
Quoted 80 lines
-----Original Message-----
From: Michel Dänzer <[email protected]>
Sent: Friday, December 21, 2018 6:08 PM
To: Deng, Emily <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/amdgpu/virtual_dce: Need to pin the fb's boQuoted 72 lines · Emily
Quoted 72 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Deng, Emily
Sent: Friday, December 21, 2018 5:41 PM
To: Michel Dänzer <[email protected]>
Cc: [email protected]
Subject: RE: [PATCH] drm/amdgpu/virtual_dce: Need to pin the fb's boQuoted 7 lines
-----Original Message-----
From: Michel Dänzer <[email protected]>
Sent: Friday, December 21, 2018 5:37 PM
To: Deng, Emily <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/amdgpu/virtual_dce: Need to pin the fb's boQuoted 33 lines
Quoted 32 lines · Emily
Quoted 32 lines
-----Original Message-----
From: Michel Dänzer <[email protected]>
Sent: Friday, December 21, 2018 5:28 PM
To: Deng, Emily <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/amdgpu/virtual_dce: Need to pin the fb's boQuoted 23 lines · Emily
Quoted 23 lines
From: amd-gfx <[email protected]> On Behalf Of Deng, Emily
Quoted 10 lines
From: Michel Dänzer <[email protected]> On 2018-12-21 9:45
Quoted 8 lines · Emily
Quoted 8 lines
From: Michel Dänzer <[email protected]> On 2018-12-21 8:26
Quoted 1 line · Emily Deng
When the bo is used to set mode, the bo need to be pinned.
On second thought, why does the BO need to be pinned? When using the display hardware, the BO needs to be pinned to prevent it from being moved while the hardware is scanning out from it, but that shouldn't be
Quoted 5 lines
necessary here.
Quoted 1 line
The pin here is used for scan out the buffer by remote display app.
I still don't understand why pinning is needed. What mechanism does the remote display app use to access the BO contents?
Sorry, I am not familiar with the remote display app. Maybe it will use drm ioctl function to get the current crtc's fb's information, and get the content in the fb's buffer object by mmap or translate the bo to an OpenGL texture for next rendering. Maybe don't need to pin the bo here, as the use has no different with other
normal bos.
Quoted 23 lines
Quoted 12 lines
Quoted 12 lines
Quoted 2 lines
Quoted 2 lines
So please ignore the patch, and will send another patch to remove the unpin
the fb's bo code.
Quoted 2 lines
It seems to be hard to remove all the pin for
virtual_dce, as it uses somecommon code in
amdgpu_display.c.Because of
amdgpu_display_unpin_work_func? That might be as simple as replacingschedule_work(&works->unpin_work);Quoted 8 lines
Quoted 6 lines
with
kfree(works->shared); kfree(works);in
dce_virtual_pageflip.But the
amdgpu_display_crtc_page_flip_targetwill pin thenew_bo, then we don't need to unpin it?Ah, right, but then
dce_virtual_pageflipcould just unpin it? Not ideal, but better than leaving it pinned unnecessarily.
Quoted 7 lines
Quoted 2 lines
Quoted 2 lines
Yes, it is not a good idea to leave it pinned. Then will need lots of "if (
amdgpu_virtual_display)", don't know whether it could be accept?Should rather be if (
adev->enable_virtual_display). If you want to never pin, it's probably worth giving this a shot and seeing how bad it gets.
BTW,amdgpu_ttm_alloc_gartcan probably also be skipped for virtual display, maybe more.
Ok, then I will try, but the code may be ugly.
Quoted 10 lines
Quoted 3 lines
Another method is let the logical stay no change, just use if (!amdgpu_virtual_display) before
WARN_ON_ONCEofamdgpu_bo_unpintoremove the virtual_dce's call trace.
That would be ugly IMHO.
But none of that is necessary if
dce_virtual_pageflipsimply unpins the BO and skipsunpin_work.
Yes, but it will still have the issue that it won't unpin the bo which is pinned by amdgpu_display_crtc_page_flip_target.
Best wishes
Emily Deng
Quoted 5 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): BN7PR12MB26447436E8D6A0C1441391DC8FB80-Zx/IyJUqfGKoYeSiBV3SvgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org
Quoted 87 lines · Emily
Quoted 80 lines
-----Original Message-----
From: Michel Dänzer <[email protected]>
Sent: Friday, December 21, 2018 6:08 PM
To: Deng, Emily <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/amdgpu/virtual_dce: Need to pin the fb's boQuoted 72 lines · Emily
Quoted 72 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Deng, Emily
Sent: Friday, December 21, 2018 5:41 PM
To: Michel Dänzer <[email protected]>
Cc: [email protected]
Subject: RE: [PATCH] drm/amdgpu/virtual_dce: Need to pin the fb's boQuoted 7 lines
-----Original Message-----
From: Michel Dänzer <[email protected]>
Sent: Friday, December 21, 2018 5:37 PM
To: Deng, Emily <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/amdgpu/virtual_dce: Need to pin the fb's boQuoted 33 lines
Quoted 32 lines · Emily
Quoted 32 lines
-----Original Message-----
From: Michel Dänzer <[email protected]>
Sent: Friday, December 21, 2018 5:28 PM
To: Deng, Emily <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/amdgpu/virtual_dce: Need to pin the fb's boQuoted 23 lines · Emily
Quoted 23 lines
From: amd-gfx <[email protected]> On Behalf Of Deng, Emily
Quoted 10 lines
From: Michel Dänzer <[email protected]> On 2018-12-21 9:45
Quoted 8 lines · Emily
Quoted 8 lines
From: Michel Dänzer <[email protected]> On 2018-12-21 8:26
Quoted 1 line · Emily Deng
When the bo is used to set mode, the bo need to be pinned.
On second thought, why does the BO need to be pinned? When using the display hardware, the BO needs to be pinned to prevent it from being moved while the hardware is scanning out from it, but that shouldn't be
Quoted 5 lines
necessary here.
Quoted 1 line
The pin here is used for scan out the buffer by remote display app.
I still don't understand why pinning is needed. What mechanism does the remote display app use to access the BO contents?
Sorry, I am not familiar with the remote display app. Maybe it will use drm ioctl function to get the current crtc's fb's information, and get the content in the fb's buffer object by mmap or translate the bo to an OpenGL texture for next rendering. Maybe don't need to pin the bo here, as the use has no different with other
normal bos.
Quoted 23 lines
Quoted 12 lines
Quoted 12 lines
Quoted 2 lines
Quoted 2 lines
So please ignore the patch, and will send another patch to remove the unpin
the fb's bo code.
Quoted 2 lines
It seems to be hard to remove all the pin for
virtual_dce, as it uses somecommon code in
amdgpu_display.c.Because of
amdgpu_display_unpin_work_func? That might be as simple as replacingschedule_work(&works->unpin_work);Quoted 8 lines
Quoted 6 lines
with
kfree(works->shared); kfree(works);in
dce_virtual_pageflip.But the
amdgpu_display_crtc_page_flip_targetwill pin thenew_bo, then we don't need to unpin it?Ah, right, but then
dce_virtual_pageflipcould just unpin it? Not ideal, but better than leaving it pinned unnecessarily.Quoted 7 lines
Quoted 2 lines
Quoted 2 lines
Yes, it is not a good idea to leave it pinned. Then will need lots of "if (
amdgpu_virtual_display)", don't know whether it could be accept?Should rather be if (
adev->enable_virtual_display). If you want to never pin, it's probably worth giving this a shot and seeing how bad it gets.
BTW,amdgpu_ttm_alloc_gartcan probably also be skipped for virtual display, maybe more.
Quoted 7 lines
Ok, then I will try, but the code may be ugly.
[...]
Quoted 2 lines
But none of that is necessary if
dce_virtual_pageflipsimply unpins the BO and skipsunpin_work.Yes, but it will still have the issue that it won't unpin the bo which is pinned by
amdgpu_display_crtc_page_flip_target.
I mean dce_virtual_pageflip unpinning precisely the BO pinned by amdgpu_display_crtc_page_flip_target.
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
Am 21.12.18 um 10:09 schrieb Deng, Emily:
Quoted 20 lines
Quoted 20 lines
-----Original Message-----
From: Michel Dänzer <[email protected]>
Sent: Friday, December 21, 2018 4:52 PM
To: Deng, Emily <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/amdgpu/virtual_dce: Need to pin the fb's boQuoted 12 lines · Emily
Quoted 12 lines
-----Original Message-----
From: Michel Dänzer <[email protected]>
Sent: Friday, December 21, 2018 4:38 PM
To: Deng, Emily <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/amdgpu/virtual_dce: Need to pin the fb's boQuoted 1 line · Emily Deng
When the bo is used to set mode, the bo need to be pinned.
On second thought, why does the BO need to be pinned? When using the display hardware, the BO needs to be pinned to prevent it from being moved while the hardware is scanning out from it, but that shouldn't be
Quoted 8 lines
Quoted 4 lines
necessary here.
Quoted 1 line
The pin here is used for scan out the buffer by remote display app.
I still don't understand why pinning is needed. What mechanism does the remote display app use to access the BO contents?
Sorry, I am not familiar with the remote display app. Maybe it will use drm ioctl function to get the current crtc's fb's information, and get the content in the fb's buffer object by mmap or translate the bo to an OpenGL texture for next rendering. Maybe don't need to pin the bo here, as the use has no different with other normal bos. So please ignore the patch, and will send another patch to remove the unpin the fb's bo code.
Opening the BO and doing something with it in OpenGL should result in proper fencing of the BO, so this sounds like a workaround for a bug somewhere else.
As long as this isn't explained further this patch is certainly a NAK.
Pinning for physical displays is allowed because they are limited in number, but this is not necessary the case with a virtual output.
Regards,
Christian.
Quoted 8 lines
Quoted 4 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
_______________________________________________
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): 8cfb30a1-1b06-85e9-e738-f3b5041547a3-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Quoted 31 lines · Christian König
Am 21.12.18 um 10:09 schrieb Deng, Emily:
Quoted 20 lines
Quoted 20 lines
-----Original Message-----
From: Michel Dänzer <[email protected]>
Sent: Friday, December 21, 2018 4:52 PM
To: Deng, Emily <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/amdgpu/virtual_dce: Need to pin the fb's boQuoted 12 lines · Emily
Quoted 12 lines
-----Original Message-----
From: Michel Dänzer <[email protected]>
Sent: Friday, December 21, 2018 4:38 PM
To: Deng, Emily <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/amdgpu/virtual_dce: Need to pin the fb's boQuoted 1 line · Emily Deng
When the bo is used to set mode, the bo need to be pinned.
On second thought, why does the BO need to be pinned? When using the display hardware, the BO needs to be pinned to prevent it from being moved while the hardware is scanning out from it, but that shouldn't be
Quoted 8 lines
Quoted 4 lines
necessary here.
Quoted 1 line
The pin here is used for scan out the buffer by remote display app.
I still don't understand why pinning is needed. What mechanism does the remote display app use to access the BO contents?
Sorry, I am not familiar with the remote display app. Maybe it will use drm ioctl function to get the current crtc's fb's information, and get the content in the fb's buffer object by mmap or translate the bo to an OpenGL texture for next rendering. Maybe don't need to pin the bo here, as the use has no different with other normal bos. So please ignore the patch, and will send another patch to remove the unpin the fb's bo code.
Quoted 8 lines
Opening the BO and doing something with it in OpenGL should result in proper fencing of the BO, so this sounds like a workaround for a bug somewhere else.
As long as this isn't explained further this patch is certainly a NAK.
Pinning for physical displays is allowed because they are limited in number, but this is not necessary the case with a virtual output.
Well practically, it's the same as real displays. We limit the virtual displays to 6 just like most hw. It really should overate the same. We just don't need the pinning per se because there is no hw actively scanning out of it.
Alex
Quoted 13 lines
Regards,
Christian.Quoted 8 lines
Quoted 4 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 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
A message that is not in the archive (sent off-list or not yet received): CADnq5_NJR_msQL+VawUGr4RR48BCU+CKFWnJhOBVAivHtYgaQg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Am 21.12.18 um 19:19 schrieb Alex Deucher:
Quoted 35 lines
Quoted 33 lines · Christian König
Am 21.12.18 um 10:09 schrieb Deng, Emily:
Quoted 20 lines
Quoted 20 lines
-----Original Message-----
From: Michel Dänzer <[email protected]>
Sent: Friday, December 21, 2018 4:52 PM
To: Deng, Emily <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/amdgpu/virtual_dce: Need to pin the fb's boQuoted 12 lines · Emily
Quoted 12 lines
-----Original Message-----
From: Michel Dänzer <[email protected]>
Sent: Friday, December 21, 2018 4:38 PM
To: Deng, Emily <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/amdgpu/virtual_dce: Need to pin the fb's boQuoted 1 line · Emily Deng
When the bo is used to set mode, the bo need to be pinned.
On second thought, why does the BO need to be pinned? When using the display hardware, the BO needs to be pinned to prevent it from being moved while the hardware is scanning out from it, but that shouldn't be
Quoted 8 lines
Quoted 4 lines
necessary here.
Quoted 1 line
The pin here is used for scan out the buffer by remote display app.
I still don't understand why pinning is needed. What mechanism does the remote display app use to access the BO contents?
Sorry, I am not familiar with the remote display app. Maybe it will use drm ioctl function to get the current crtc's fb's information, and get the content in the fb's buffer object by mmap or translate the bo to an OpenGL texture for next rendering. Maybe don't need to pin the bo here, as the use has no different with other normal bos. So please ignore the patch, and will send another patch to remove the unpin the fb's bo code.
Opening the BO and doing something with it in OpenGL should result in proper fencing of the BO, so this sounds like a workaround for a bug somewhere else.
Quoted 8 lines
Quoted 4 lines
As long as this isn't explained further this patch is certainly a NAK.
Pinning for physical displays is allowed because they are limited in number, but this is not necessary the case with a virtual output.
Well practically, it's the same as real displays. We limit the virtual displays to 6 just like most hw. It really should overate the same. We just don't need the pinning per se because there is no hw actively scanning out of it.
Yeah, but do we limit the number of pending flips like we do for real hardware as well?
For real hard we have at maximum two BOs pinned, the current one and the next one. For the virtual scanout I'm not sure about that.
Christian.
Quoted 2 lines
Alex
_______________________________________________
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): bd21b09c-46c6-1e22-a014-ba23458fd5de-5C7GfCeVMHo@public.gmane.org
Quoted 28 lines · Christian
Am 21.12.18 um 19:19 schrieb Alex Deucher:
Quoted 27 lines
Quoted 25 lines · Christian König
Am 21.12.18 um 10:09 schrieb Deng, Emily:
Quoted 8 lines
Quoted 8 lines
From: Michel Dänzer <[email protected]>
Quoted 6 lines · Emily
Quoted 6 lines
From: Michel Dänzer <[email protected]>
Quoted 1 line · Emily Deng
When the bo is used to set mode, the bo need to be pinned.
On second thought, why does the BO need to be pinned? When using the display hardware, the BO needs to be pinned to prevent it from being moved while the hardware is scanning out from it, but that shouldn't be
Quoted 8 lines
Quoted 4 lines
necessary here.
Quoted 1 line
The pin here is used for scan out the buffer by remote display app.
I still don't understand why pinning is needed. What mechanism does the remote display app use to access the BO contents?
Sorry, I am not familiar with the remote display app. Maybe it will use drm ioctl function to get the current crtc's fb's information, and get the content in the fb's buffer object by mmap or translate the bo to an OpenGL texture for next rendering. Maybe don't need to pin the bo here, as the use has no different with other normal bos. So please ignore the patch, and will send another patch to remove the unpin the fb's bo code.
Opening the BO and doing something with it in OpenGL should result in proper fencing of the BO, so this sounds like a workaround for a bug somewhere else.
As long as this isn't explained further this patch is certainly a NAK.
Pinning for physical displays is allowed because they are limited in number, but this is not necessary the case with a virtual output.
Quoted 7 lines
Quoted 4 lines
Well practically, it's the same as real displays. We limit the virtual displays to 6 just like most hw. It really should overate the same. We just don't need the pinning per se because there is no hw actively scanning out of it.
Yeah, but do we limit the number of pending flips like we do for real hardware as well?
Yeah, this is enforced in common code.
The issue this patch addressed was that it's also common code which pinned the new BO and unpinned the old one on a page flip, but the virtual display specific code otherwise didn't (un)pin BOs for "scanout". This resulted in triggering the WARN I added recently for the old BO on the first flip, because it wasn't pinned before, and in the new BO of the last flip staying pinned indefinitely.
The result of this patch would be BOs getting (un)pinned for "scanout" exactly the same way as for real HW scanout. Emily has now landed a better patch which instead results in BOs never getting pinned for virtual display "scanout".
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