Re: [PATCH 4/4] drm/amdgpu: resize VRAM BAR for CPU access

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 13, 2017 at 2:41 PM, Christian König
<deathsimple@xxxxxxxxxxx> wrote:
> From: Christian König <christian.koenig@xxxxxxx>
>
> Try to resize BAR0 to let CPU access all of VRAM.

> +void amdgpu_resize_bar0(struct amdgpu_device *adev)
> +{
> +       u32 size = max(ilog2(adev->mc.real_vram_size - 1) + 1, 20) - 20;
> +       int r;
> +
> +       r = pci_resize_resource(adev->pdev, 0, size);

> +

Redundant.

> +       if (r == -ENOTSUPP) {
> +               /* The hardware don't support the extension. */
> +               return;

> +

Ditto.

> +       } else if (r == -ENOSPC) {

Useless use of else. And thus of curly braces.

> +               DRM_INFO("Not enoigh PCI address space for a large BAR.");
> +       } else if (r) {
> +               DRM_ERROR("Problem resizing BAR0 (%d).", r);
> +       }
> +
> +       /* Reinit the doorbell mapping, it is most likely moved as well */
> +       amdgpu_doorbell_fini(adev);

> +       BUG_ON(amdgpu_doorbell_init(adev));

Comment why it's used here.
-- 
With Best Regards,
Andy Shevchenko
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux