mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-09 05:20:36 +02:00
winsys/radeon: fix nop packet padding for hawaii
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. Additionaly this patch disables GPU acceleration on hawaii if the kernel returns a value < 2. In this case the kernel hasn't the required fixes for proper acceleration. 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 v4: - Fail to initialize winsys for returned value < 2 Cc: mesa-stable@lists.freedesktop.org Cc: Alex Deucher <alexander.deucher@amd.com> Cc: Jérôme Glisse <jglisse@redhat.com> Cc: Marek Olšák <marek.olsak@amd.com> Cc: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
fa5b76e3a2
commit
36771dc60f
3 changed files with 16 additions and 1 deletions
|
|
@ -446,8 +446,12 @@ static void radeon_drm_cs_flush(struct radeon_winsys_cs *rcs,
|
|||
case RING_GFX:
|
||||
/* pad DMA ring to 8 DWs to meet CP fetch alignment requirements
|
||||
* r6xx, requires at least 4 dw alignment to avoid a hw bug.
|
||||
* hawaii with old firmware needs type2 nop packet.
|
||||
* accel_working2 with value 2 indicates the new firmware.
|
||||
*/
|
||||
if (cs->ws->info.chip_class <= SI) {
|
||||
if (cs->ws->info.chip_class <= SI ||
|
||||
(cs->ws->info.family == CHIP_HAWAII &&
|
||||
cs->ws->accel_working2 < 3)) {
|
||||
while (rcs->cdw & 7)
|
||||
OUT_CS(&cs->base, 0x80000000); /* type2 nop packet */
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -415,6 +415,16 @@ 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 (ws->info.family == CHIP_HAWAII && ws->accel_working2 < 2) {
|
||||
fprintf(stderr, "radeon: GPU acceleration for Hawaii disabled, "
|
||||
"returned accel_working2 value %u is smaller than 2. "
|
||||
"Please install a newer kernel.\n",
|
||||
ws->accel_working2);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
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;
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ struct radeon_drm_winsys {
|
|||
enum radeon_generation gen;
|
||||
struct radeon_info info;
|
||||
uint32_t va_start;
|
||||
uint32_t accel_working2;
|
||||
|
||||
struct pb_manager *kman;
|
||||
struct pb_manager *cman_vram;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue