[Mesa-dev] [PATCH] ac/surface: fix hybrid graphics where APU=GFX9, dGPU=older

Alex Deucher alexdeucher at gmail.com
Tue Jul 25 18:57:10 UTC 2017


On Tue, Jul 25, 2017 at 12:38 PM, Marek Olšák <maraeo at gmail.com> wrote:
> From: Marek Olšák <marek.olsak at amd.com>
>
> Cc: 17.2 <mesa-stable at lists.freedesktop.org>

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

> ---
>  src/amd/common/ac_surface.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/src/amd/common/ac_surface.c b/src/amd/common/ac_surface.c
> index cd3d7b7..9e5390b 100644
> --- a/src/amd/common/ac_surface.c
> +++ b/src/amd/common/ac_surface.c
> @@ -250,20 +250,31 @@ static int gfx6_compute_level(ADDR_HANDLE addrlib,
>                               ADDR_COMPUTE_HTILE_INFO_INPUT *AddrHtileIn,
>                               ADDR_COMPUTE_HTILE_INFO_OUTPUT *AddrHtileOut)
>  {
>         struct legacy_surf_level *surf_level;
>         ADDR_E_RETURNCODE ret;
>
>         AddrSurfInfoIn->mipLevel = level;
>         AddrSurfInfoIn->width = u_minify(config->info.width, level);
>         AddrSurfInfoIn->height = u_minify(config->info.height, level);
>
> +       /* Make GFX6 linear surfaces compatible with GFX9 for hybrid graphics,
> +        * because GFX9 needs linear alignment of 256 bytes.
> +        */
> +       if (config->info.levels == 1 &&
> +           AddrSurfInfoIn->tileMode == ADDR_TM_LINEAR_ALIGNED) {
> +               unsigned alignment = 256 / (AddrSurfInfoIn->bpp / 8);
> +
> +               assert(util_is_power_of_two(AddrSurfInfoIn->bpp));
> +               AddrSurfInfoIn->width = align(AddrSurfInfoIn->width, alignment);
> +       }
> +
>         if (config->is_3d)
>                 AddrSurfInfoIn->numSlices = u_minify(config->info.depth, level);
>         else if (config->is_cube)
>                 AddrSurfInfoIn->numSlices = 6;
>         else
>                 AddrSurfInfoIn->numSlices = config->info.array_size;
>
>         if (level > 0) {
>                 /* Set the base level pitch. This is needed for calculation
>                  * of non-zero levels. */
> --
> 2.7.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list