* [PATCH] drm/vboxvideo: Use managed VRAM-helper initialization
@ 2021-03-03 1:39 Tian Tao
2021-03-11 13:11 ` Daniel Vetter
0 siblings, 1 reply; 4+ messages in thread
From: Tian Tao @ 2021-03-03 1:39 UTC (permalink / raw)
To: hdegoede, airlied, daniel; +Cc: dri-devel
updated to use drmm_vram_helper_init().
Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
---
drivers/gpu/drm/vboxvideo/vbox_ttm.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/vboxvideo/vbox_ttm.c b/drivers/gpu/drm/vboxvideo/vbox_ttm.c
index 0066a3c..fd8a53a 100644
--- a/drivers/gpu/drm/vboxvideo/vbox_ttm.c
+++ b/drivers/gpu/drm/vboxvideo/vbox_ttm.c
@@ -12,15 +12,13 @@
int vbox_mm_init(struct vbox_private *vbox)
{
- struct drm_vram_mm *vmm;
int ret;
struct drm_device *dev = &vbox->ddev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
- vmm = drm_vram_helper_alloc_mm(dev, pci_resource_start(pdev, 0),
+ ret = drmm_vram_helper_init(dev, pci_resource_start(pdev, 0),
vbox->available_vram_size);
- if (IS_ERR(vmm)) {
- ret = PTR_ERR(vmm);
+ if (ret) {
DRM_ERROR("Error initializing VRAM MM; %d\n", ret);
return ret;
}
@@ -33,5 +31,4 @@ int vbox_mm_init(struct vbox_private *vbox)
void vbox_mm_fini(struct vbox_private *vbox)
{
arch_phys_wc_del(vbox->fb_mtrr);
- drm_vram_helper_release_mm(&vbox->ddev);
}
--
2.7.4
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/vboxvideo: Use managed VRAM-helper initialization
2021-03-03 1:39 [PATCH] drm/vboxvideo: Use managed VRAM-helper initialization Tian Tao
@ 2021-03-11 13:11 ` Daniel Vetter
2021-03-11 13:13 ` Hans de Goede
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Vetter @ 2021-03-11 13:11 UTC (permalink / raw)
To: Tian Tao; +Cc: airlied, hdegoede, dri-devel
On Wed, Mar 03, 2021 at 09:39:46AM +0800, Tian Tao wrote:
> updated to use drmm_vram_helper_init().
>
> Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Hans, do you plan to pick this up?
-Daniel
> ---
> drivers/gpu/drm/vboxvideo/vbox_ttm.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/vboxvideo/vbox_ttm.c b/drivers/gpu/drm/vboxvideo/vbox_ttm.c
> index 0066a3c..fd8a53a 100644
> --- a/drivers/gpu/drm/vboxvideo/vbox_ttm.c
> +++ b/drivers/gpu/drm/vboxvideo/vbox_ttm.c
> @@ -12,15 +12,13 @@
>
> int vbox_mm_init(struct vbox_private *vbox)
> {
> - struct drm_vram_mm *vmm;
> int ret;
> struct drm_device *dev = &vbox->ddev;
> struct pci_dev *pdev = to_pci_dev(dev->dev);
>
> - vmm = drm_vram_helper_alloc_mm(dev, pci_resource_start(pdev, 0),
> + ret = drmm_vram_helper_init(dev, pci_resource_start(pdev, 0),
> vbox->available_vram_size);
> - if (IS_ERR(vmm)) {
> - ret = PTR_ERR(vmm);
> + if (ret) {
> DRM_ERROR("Error initializing VRAM MM; %d\n", ret);
> return ret;
> }
> @@ -33,5 +31,4 @@ int vbox_mm_init(struct vbox_private *vbox)
> void vbox_mm_fini(struct vbox_private *vbox)
> {
> arch_phys_wc_del(vbox->fb_mtrr);
> - drm_vram_helper_release_mm(&vbox->ddev);
> }
> --
> 2.7.4
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/vboxvideo: Use managed VRAM-helper initialization
2021-03-11 13:11 ` Daniel Vetter
@ 2021-03-11 13:13 ` Hans de Goede
2021-03-11 13:20 ` Daniel Vetter
0 siblings, 1 reply; 4+ messages in thread
From: Hans de Goede @ 2021-03-11 13:13 UTC (permalink / raw)
To: Daniel Vetter, Tian Tao; +Cc: airlied, dri-devel
Hi,
On 3/11/21 2:11 PM, Daniel Vetter wrote:
> On Wed, Mar 03, 2021 at 09:39:46AM +0800, Tian Tao wrote:
>> updated to use drmm_vram_helper_init().
>>
>> Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
>
> Hans, do you plan to pick this up?
The drm patch-workflow falls outside my daily kernel-work workflow,
so it is always a bit of a task-switch for me to switch to dealing
with the "dim" workflow. ATM I don't have any other drm work pending,
so I would appreciate it if someone else can pick this up.
The change does look good to me:
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Regards,
Hans
> -Daniel
>
>> ---
>> drivers/gpu/drm/vboxvideo/vbox_ttm.c | 7 ++-----
>> 1 file changed, 2 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/vboxvideo/vbox_ttm.c b/drivers/gpu/drm/vboxvideo/vbox_ttm.c
>> index 0066a3c..fd8a53a 100644
>> --- a/drivers/gpu/drm/vboxvideo/vbox_ttm.c
>> +++ b/drivers/gpu/drm/vboxvideo/vbox_ttm.c
>> @@ -12,15 +12,13 @@
>>
>> int vbox_mm_init(struct vbox_private *vbox)
>> {
>> - struct drm_vram_mm *vmm;
>> int ret;
>> struct drm_device *dev = &vbox->ddev;
>> struct pci_dev *pdev = to_pci_dev(dev->dev);
>>
>> - vmm = drm_vram_helper_alloc_mm(dev, pci_resource_start(pdev, 0),
>> + ret = drmm_vram_helper_init(dev, pci_resource_start(pdev, 0),
>> vbox->available_vram_size);
>> - if (IS_ERR(vmm)) {
>> - ret = PTR_ERR(vmm);
>> + if (ret) {
>> DRM_ERROR("Error initializing VRAM MM; %d\n", ret);
>> return ret;
>> }
>> @@ -33,5 +31,4 @@ int vbox_mm_init(struct vbox_private *vbox)
>> void vbox_mm_fini(struct vbox_private *vbox)
>> {
>> arch_phys_wc_del(vbox->fb_mtrr);
>> - drm_vram_helper_release_mm(&vbox->ddev);
>> }
>> --
>> 2.7.4
>>
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/vboxvideo: Use managed VRAM-helper initialization
2021-03-11 13:13 ` Hans de Goede
@ 2021-03-11 13:20 ` Daniel Vetter
0 siblings, 0 replies; 4+ messages in thread
From: Daniel Vetter @ 2021-03-11 13:20 UTC (permalink / raw)
To: Hans de Goede; +Cc: airlied, Tian Tao, dri-devel
On Thu, Mar 11, 2021 at 02:13:57PM +0100, Hans de Goede wrote:
> Hi,
>
> On 3/11/21 2:11 PM, Daniel Vetter wrote:
> > On Wed, Mar 03, 2021 at 09:39:46AM +0800, Tian Tao wrote:
> >> updated to use drmm_vram_helper_init().
> >>
> >> Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
> >
> > Hans, do you plan to pick this up?
>
> The drm patch-workflow falls outside my daily kernel-work workflow,
> so it is always a bit of a task-switch for me to switch to dealing
> with the "dim" workflow. ATM I don't have any other drm work pending,
> so I would appreciate it if someone else can pick this up.
>
> The change does look good to me:
>
> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
I'll push, thanks for reviewing.
-Daniel
>
> Regards,
>
> Hans
>
>
>
> > -Daniel
> >
> >> ---
> >> drivers/gpu/drm/vboxvideo/vbox_ttm.c | 7 ++-----
> >> 1 file changed, 2 insertions(+), 5 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/vboxvideo/vbox_ttm.c b/drivers/gpu/drm/vboxvideo/vbox_ttm.c
> >> index 0066a3c..fd8a53a 100644
> >> --- a/drivers/gpu/drm/vboxvideo/vbox_ttm.c
> >> +++ b/drivers/gpu/drm/vboxvideo/vbox_ttm.c
> >> @@ -12,15 +12,13 @@
> >>
> >> int vbox_mm_init(struct vbox_private *vbox)
> >> {
> >> - struct drm_vram_mm *vmm;
> >> int ret;
> >> struct drm_device *dev = &vbox->ddev;
> >> struct pci_dev *pdev = to_pci_dev(dev->dev);
> >>
> >> - vmm = drm_vram_helper_alloc_mm(dev, pci_resource_start(pdev, 0),
> >> + ret = drmm_vram_helper_init(dev, pci_resource_start(pdev, 0),
> >> vbox->available_vram_size);
> >> - if (IS_ERR(vmm)) {
> >> - ret = PTR_ERR(vmm);
> >> + if (ret) {
> >> DRM_ERROR("Error initializing VRAM MM; %d\n", ret);
> >> return ret;
> >> }
> >> @@ -33,5 +31,4 @@ int vbox_mm_init(struct vbox_private *vbox)
> >> void vbox_mm_fini(struct vbox_private *vbox)
> >> {
> >> arch_phys_wc_del(vbox->fb_mtrr);
> >> - drm_vram_helper_release_mm(&vbox->ddev);
> >> }
> >> --
> >> 2.7.4
> >>
> >
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-03-11 13:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-03 1:39 [PATCH] drm/vboxvideo: Use managed VRAM-helper initialization Tian Tao
2021-03-11 13:11 ` Daniel Vetter
2021-03-11 13:13 ` Hans de Goede
2021-03-11 13:20 ` Daniel Vetter
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.