[Mesa-dev] [PATCH] winsys/radeon: fix vram_size overflow with Hawaii

Alex Deucher alexdeucher at gmail.com
Sun Jul 27 19:50:09 PDT 2014


On Sat, Jul 26, 2014 at 6:44 AM, Marek Olšák <maraeo at gmail.com> wrote:
> From: Marek Olšák <marek.olsak at amd.com>
>
> This fixes piglit spec/!OpenGL 3.1/minmax.
>
> Cc: mesa-stable at lists.freedesktop.org

Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

> ---
>  src/gallium/drivers/r300/r300_context.c       | 4 +++-
>  src/gallium/winsys/radeon/drm/radeon_drm_cs.h | 4 ++--
>  src/gallium/winsys/radeon/drm/radeon_winsys.h | 4 ++--
>  3 files changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c
> index 7ae3551..4e06fc4 100644
> --- a/src/gallium/drivers/r300/r300_context.c
> +++ b/src/gallium/drivers/r300/r300_context.c
> @@ -37,6 +37,8 @@
>  #include "r300_screen_buffer.h"
>  #include "compiler/radeon_regalloc.h"
>
> +#include <inttypes.h>
> +
>  static void r300_release_referenced_objects(struct r300_context *r300)
>  {
>      struct pipe_framebuffer_state *fb =
> @@ -482,7 +484,7 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen,
>  #endif
>          fprintf(stderr,
>                  "r300: DRM version: %d.%d.%d, Name: %s, ID: 0x%04x, GB: %d, Z: %d\n"
> -                "r300: GART size: %d MB, VRAM size: %d MB\n"
> +                "r300: GART size: %"PRIu64" MB, VRAM size: %"PRIu64" MB\n"
>                  "r300: AA compression RAM: %s, Z compression RAM: %s, HiZ RAM: %s\n",
>                  r300->screen->info.drm_major,
>                  r300->screen->info.drm_minor,
> diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_cs.h b/src/gallium/winsys/radeon/drm/radeon_drm_cs.h
> index c601019..089494e 100644
> --- a/src/gallium/winsys/radeon/drm/radeon_drm_cs.h
> +++ b/src/gallium/winsys/radeon/drm/radeon_drm_cs.h
> @@ -50,8 +50,8 @@ struct radeon_cs_context {
>
>      int                         reloc_indices_hashlist[512];
>
> -    unsigned                    used_vram;
> -    unsigned                    used_gart;
> +    uint64_t                    used_vram;
> +    uint64_t                    used_gart;
>  };
>
>  struct radeon_drm_cs {
> diff --git a/src/gallium/winsys/radeon/drm/radeon_winsys.h b/src/gallium/winsys/radeon/drm/radeon_winsys.h
> index 9aea1e8..dbd58f1 100644
> --- a/src/gallium/winsys/radeon/drm/radeon_winsys.h
> +++ b/src/gallium/winsys/radeon/drm/radeon_winsys.h
> @@ -199,8 +199,8 @@ struct radeon_info {
>      uint32_t                    pci_id;
>      enum radeon_family          family;
>      enum chip_class             chip_class;
> -    uint32_t                    gart_size;
> -    uint32_t                    vram_size;
> +    uint64_t                    gart_size;
> +    uint64_t                    vram_size;
>      uint32_t                    max_sclk;
>      uint32_t                    max_compute_units;
>      uint32_t                    max_se;
> --
> 1.9.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list