AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Dieter Nützel" <Dieter@nuetzel-hh.de>
To: "Michel Dänzer" <michel@daenzer.net>
Cc: mesa-dev@lists.freedesktop.org, amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/radeon: Fix vram_size/visible values in DRM_RADEON_GEM_INFO ioctl
Date: Tue, 31 Jan 2017 12:24:30 +0100	[thread overview]
Message-ID: <5abbe0dcb709f4624fa52f32d9e3e3d5@nuetzel-hh.de> (raw)
In-Reply-To: <20170131065414.2434-1-michel@daenzer.net>

Hello Michel,

as this is for radeon, do you think this could/should fix
the wrong reported VRAM size with Unigine_Heaven/-Valley, too?
Maybe speed things up? ;-)

Unigine_Valley-1.0

GPU: Unknown GPU x1
System memory: 24102 MB
Video memory:  256 MB
Sync threads:  7
Async threads: 8

I'll try patching openSUSE Kernel:stable 4.9.6-2 with this
and maybe this could then go into 4.10-rc7 'cause it is a
bugfix. - Alex?

Greetings,
Dieter

Am 31.01.2017 07:54, schrieb Michel Dänzer:
> From: Michel Dänzer <michel.daenzer@amd.com>
> 
> vram_size is supposed to be the total amount of VRAM that can be used 
> by
> userspace, which corresponds to the TTM VRAM manager size (which is
> normally the full amount of VRAM, but can be just the visible VRAM when
> DMA can't be used for BO migration for some reason).
> 
> The above was incorrectly used for vram_visible before, resulting in
> generally too large values being reported.
> 
> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
> ---
>  drivers/gpu/drm/radeon/radeon_drv.c | 3 ++-
>  drivers/gpu/drm/radeon/radeon_gem.c | 4 ++--
>  2 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/radeon/radeon_drv.c
> b/drivers/gpu/drm/radeon/radeon_drv.c
> index a252bc407aa2..88c41d43ec3d 100644
> --- a/drivers/gpu/drm/radeon/radeon_drv.c
> +++ b/drivers/gpu/drm/radeon/radeon_drv.c
> @@ -97,9 +97,10 @@
>   *   2.46.0 - Add PFP_SYNC_ME support on evergreen
>   *   2.47.0 - Add UVD_NO_OP register support
>   *   2.48.0 - TA_CS_BC_BASE_ADDR allowed on SI
> + *   2.49.0 - DRM_RADEON_GEM_INFO ioctl returns correct
> vram_size/visible values
>   */
>  #define KMS_DRIVER_MAJOR	2
> -#define KMS_DRIVER_MINOR	48
> +#define KMS_DRIVER_MINOR	49
>  #define KMS_DRIVER_PATCHLEVEL	0
>  int radeon_driver_load_kms(struct drm_device *dev, unsigned long 
> flags);
>  int radeon_driver_unload_kms(struct drm_device *dev);
> diff --git a/drivers/gpu/drm/radeon/radeon_gem.c
> b/drivers/gpu/drm/radeon/radeon_gem.c
> index 0bcffd8a7bd3..96683f5b2b1b 100644
> --- a/drivers/gpu/drm/radeon/radeon_gem.c
> +++ b/drivers/gpu/drm/radeon/radeon_gem.c
> @@ -220,8 +220,8 @@ int radeon_gem_info_ioctl(struct drm_device *dev,
> void *data,
> 
>  	man = &rdev->mman.bdev.man[TTM_PL_VRAM];
> 
> -	args->vram_size = rdev->mc.real_vram_size;
> -	args->vram_visible = (u64)man->size << PAGE_SHIFT;
> +	args->vram_size = (u64)man->size << PAGE_SHIFT;
> +	args->vram_visible = rdev->mc.visible_vram_size;
>  	args->vram_visible -= rdev->vram_pin_size;
>  	args->gart_size = rdev->mc.gtt_size;
>  	args->gart_size -= rdev->gart_pin_size;
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

  parent reply	other threads:[~2017-01-31 11:24 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-31  6:54 [PATCH] drm/radeon: Fix vram_size/visible values in DRM_RADEON_GEM_INFO ioctl Michel Dänzer
     [not found] ` <20170131065414.2434-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
2017-01-31  6:54   ` [PATCH] winsys/radeon: Allow visible VRAM size > 256MB with kernel driver >= 2.49 Michel Dänzer
     [not found]     ` <20170131065414.2434-2-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
2017-01-31  9:12       ` Samuel Pitoiset
2017-01-31 11:44       ` Nicolai Hähnle
2017-01-31 15:30       ` Deucher, Alexander
2017-01-31  9:09   ` [PATCH] drm/radeon: Fix vram_size/visible values in DRM_RADEON_GEM_INFO ioctl Christian König
2017-01-31 15:30   ` Deucher, Alexander
2017-01-31 11:24 ` Dieter Nützel [this message]
     [not found]   ` <5abbe0dcb709f4624fa52f32d9e3e3d5-0hun7QTegEsDD4udEopG9Q@public.gmane.org>
2017-01-31 15:43     ` [Mesa-dev] " Deucher, Alexander
     [not found]       ` <BN6PR12MB16528D1DF5184C0A29572C04F74A0-/b2+HYfkarQqUD6E6FAiowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-01-31 21:08         ` Dieter Nützel
2017-01-31 22:06       ` Emil Velikov
     [not found]         ` <CACvgo50tFrVg+vq=Lt+5p-GYb9v+M-jRVq66rLAENFn5yoPWDA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-01-31 22:23           ` [Mesa-dev] " Alex Deucher
     [not found]             ` <CADnq5_MA5NNZ=9T_U7=GG-n-AHs+VxtwksSE6v=9DSAgyZk=Xw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-02-01 19:43               ` Marek Olšák

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5abbe0dcb709f4624fa52f32d9e3e3d5@nuetzel-hh.de \
    --to=dieter@nuetzel-hh.de \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=mesa-dev@lists.freedesktop.org \
    --cc=michel@daenzer.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox