isl: Work around NVIDIA and AMD display pitch requirements
In the case where we're rendering on the Intel GPU, but displaying on an AMD and NVIDIA GPU, we need to follow their pitch requirements for our linear scanout buffers. Based on a patch by Lionel Landwerlin. Closes: #4706 Reviewed-by: Emma Anholt <emma@anholt.net> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10895>
This commit is contained in:
parent
d8a1d41952
commit
a3a4517f41
|
@ -1466,9 +1466,12 @@ isl_calc_row_pitch_alignment(const struct isl_device *dev,
|
|||
* PRI_STRIDE Stride (p1254):
|
||||
*
|
||||
* "When using linear memory, this must be at least 64 byte aligned."
|
||||
*
|
||||
* However, when displaying on NVIDIA and recent AMD GPUs via PRIME,
|
||||
* we need a larger pitch of 256 bytes. We do that just in case.
|
||||
*/
|
||||
if (surf_info->usage & ISL_SURF_USAGE_DISPLAY_BIT)
|
||||
alignment = isl_align(alignment, 64);
|
||||
alignment = isl_align(alignment, 256);
|
||||
|
||||
return alignment;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue