[Mesa-dev] [PATCH v3] winsys/radeon: fix nop packet padding for hawaii

Michel Dänzer michel at daenzer.net
Mon Aug 4 01:35:57 PDT 2014


On 02.08.2014 03:30, Andreas Boll wrote:
> The initial firmware for hawaii does not support type3 nop packet.
> Detect the new hawaii firmware with query RADEON_INFO_ACCEL_WORKING2.
> If the returned value is 3, then the new firmware is used.
> 
> This patch uses type2 for the old firmware and type3 for the new firmware.
> 
> It fixes the cases when the old firmware is used and the user wants to
> manually enable acceleration.
> The two possible scenarios are:
>  - the kernel has no support for the new firmware.
>  - the kernel has support for the new firmware but only the old firmware
>    is available.
> 
> v2:
>  - Fix indentation
>  - Use private struct radeon_drm_winsys instead of public struct radeon_info
>  - Rename r600_accel_working2 to accel_working2
> 
> v3:
>  - Use type2 nop packet for returned value < 3
> 
> Cc: mesa-stable at lists.freedesktop.org
> Cc: Alex Deucher <alexander.deucher at amd.com>
> Cc: Jérôme Glisse <jglisse at redhat.com>
> Cc: Marek Olšák <marek.olsak at amd.com>
> Signed-off-by: Andreas Boll <andreas.boll.dev at gmail.com>
> ---
> 
> Unfortunately I can't test this patch myself since I don't own a hawaii card.
> So I'd need someone to test this patch on kernel >= 3.16-rc7.
> This patch would bring us one step further for hawaii acceleration on kernel 3.16.
> 
> Note: v3 is required for this kernel patch:
> http://lists.freedesktop.org/archives/dri-devel/2014-August/065308.html
> 
> Finally we could enable hawaii acceleration if the query returns > 2

[...]

> diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
> index 910d06b..9c55c11 100644
> --- a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
> +++ b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
> @@ -395,6 +395,9 @@ static boolean do_winsys_init(struct radeon_drm_winsys *ws)
>      radeon_get_drm_value(ws->fd, RADEON_INFO_MAX_SH_PER_SE, NULL,
>                           &ws->info.max_sh_per_se);
>  
> +    radeon_get_drm_value(ws->fd, RADEON_INFO_ACCEL_WORKING2, NULL,
> +                         &ws->accel_working2);
> +
>      if (radeon_get_drm_value(ws->fd, RADEON_INFO_SI_TILE_MODE_ARRAY, NULL,
>                               ws->info.si_tile_mode_array)) {
>          ws->info.si_tile_mode_array_valid = TRUE;

Please make the winsys fail to initialize on Hawaii if
RADEON_INFO_ACCEL_WORKING2 returns < 2.


-- 
Earthling Michel Dänzer            |                  http://www.amd.com
Libre software enthusiast          |                Mesa and X developer


More information about the mesa-dev mailing list