Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1599616

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

From Andy Shevchenko <andy.shevchenko@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH 4/4] drm/amdgpu: resize VRAM BAR for CPU access
Date 2017-03-13 18:00 +0100
Message-ID <tkBua-3kO-25@gated-at.bofh.it> (permalink)
References <tkxAe-ys-17@gated-at.bofh.it> <tkxAf-ys-49@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Mar 13, 2017 at 2:41 PM, Christian König
<deathsimple@vodafone.de> wrote:
> From: Christian König <christian.koenig@amd.com>
>
> 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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 4/4] drm/amdgpu: resize VRAM BAR for CPU access Christian König <deathsimple@vodafone.de> - 2017-03-13 13:50 +0100
  Re: [PATCH 4/4] drm/amdgpu: resize VRAM BAR for CPU access Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-03-13 18:00 +0100
  Re: [PATCH 4/4] drm/amdgpu: resize VRAM BAR for CPU access Ayyappa Ch <ayyappa.ch.linux@gmail.com> - 2017-03-15 08:30 +0100
    Re: [PATCH 4/4] drm/amdgpu: resize VRAM BAR for CPU access Christian König <deathsimple@vodafone.de> - 2017-03-15 08:40 +0100
      RE: [PATCH 4/4] drm/amdgpu: resize VRAM BAR for CPU access "Zhou, David(ChunMing)" <David1.Zhou@amd.com> - 2017-03-15 09:30 +0100
        Re: [PATCH 4/4] drm/amdgpu: resize VRAM BAR for CPU access Christian König <deathsimple@vodafone.de> - 2017-03-15 10:30 +0100
          RE: [PATCH 4/4] drm/amdgpu: resize VRAM BAR for CPU access "Zhang, Jerry" <Jerry.Zhang@amd.com> - 2017-03-16 03:20 +0100
            Re: [PATCH 4/4] drm/amdgpu: resize VRAM BAR for CPU access Alex Deucher <alexdeucher@gmail.com> - 2017-03-16 03:30 +0100
              RE: [PATCH 4/4] drm/amdgpu: resize VRAM BAR for CPU access "Zhang, Jerry" <Jerry.Zhang@amd.com> - 2017-03-16 03:50 +0100
                Re: [PATCH 4/4] drm/amdgpu: resize VRAM BAR for CPU access "Sagalovitch, Serguei" <Serguei.Sagalovitch@amd.com> - 2017-03-23 15:40 +0100
                Re: [PATCH 4/4] drm/amdgpu: resize VRAM BAR for CPU access Christian König <deathsimple@vodafone.de> - 2017-03-23 17:00 +0100
      Re: [PATCH 4/4] drm/amdgpu: resize VRAM BAR for CPU access Ayyappa Ch <ayyappa.ch.linux@gmail.com> - 2017-03-15 11:50 +0100
        Re: [PATCH 4/4] drm/amdgpu: resize VRAM BAR for CPU access Christian König <deathsimple@vodafone.de> - 2017-03-15 12:10 +0100
      RE: [PATCH 4/4] drm/amdgpu: resize VRAM BAR for CPU access "Deucher, Alexander" <Alexander.Deucher@amd.com> - 2017-03-15 17:20 +0100
  Re: [PATCH 4/4] drm/amdgpu: resize VRAM BAR for CPU access Bjorn Helgaas <helgaas@kernel.org> - 2017-03-24 22:50 +0100

csiph-web