| From 355183a1ba518b12fc917fa4bea73b9082c9094d Mon Sep 17 00:00:00 2001 |
| From: Josip Pavic <Josip.Pavic@amd.com> |
| Date: Fri, 21 Feb 2020 12:26:19 -0500 |
| Subject: [PATCH] drm/amd/display: fix dcc swath size calculations on dcn1 |
| |
| commit a0275dfc82c9034eefbeffd556cca6dd239d7925 upstream. |
| |
| [Why] |
| Swath sizes are being calculated incorrectly. The horizontal swath size |
| should be the product of block height, viewport width, and bytes per |
| element, but the calculation uses viewport height instead of width. The |
| vertical swath size is similarly incorrectly calculated. The effect of |
| this is that we report the wrong DCC caps. |
| |
| [How] |
| Use viewport width in the horizontal swath size calculation and viewport |
| height in the vertical swath size calculation. |
| |
| Signed-off-by: Josip Pavic <Josip.Pavic@amd.com> |
| Reviewed-by: Aric Cyr <Aric.Cyr@amd.com> |
| Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com> |
| Signed-off-by: Alex Deucher <alexander.deucher@amd.com> |
| Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> |
| |
| diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c |
| index 0db2a6e96fc0..8725e6d54ac9 100644 |
| --- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c |
| +++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c |
| @@ -779,8 +779,8 @@ static void hubbub1_det_request_size( |
| |
| hubbub1_get_blk256_size(&blk256_width, &blk256_height, bpe); |
| |
| - swath_bytes_horz_wc = height * blk256_height * bpe; |
| - swath_bytes_vert_wc = width * blk256_width * bpe; |
| + swath_bytes_horz_wc = width * blk256_height * bpe; |
| + swath_bytes_vert_wc = height * blk256_width * bpe; |
| |
| *req128_horz_wc = (2 * swath_bytes_horz_wc <= detile_buf_size) ? |
| false : /* full 256B request */ |
| -- |
| 2.7.4 |
| |