mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-03-15 19:20:34 +01:00
broadcom/simulator: add helper to get stride alignment
Some GPUs, like AMD, has specific stride align requirements in order to display the content correctly. Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com> Signed-off-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com> Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37887>
This commit is contained in:
parent
5947eae0af
commit
d48b276acd
2 changed files with 17 additions and 0 deletions
|
|
@ -123,6 +123,9 @@ struct v3d_simulator_file {
|
|||
|
||||
/** For specific gpus, use their create ioctl. Otherwise use dumb bo. */
|
||||
enum gem_type gem_type;
|
||||
|
||||
/** The stride alignment required for raster textures. */
|
||||
uint32_t raster_stride_align;
|
||||
};
|
||||
|
||||
/** Wrapper for drm_v3d_bo tracking the simulator-specific state. */
|
||||
|
|
@ -1161,6 +1164,13 @@ v3d_simulator_get_mem_free(void)
|
|||
return total_free;
|
||||
}
|
||||
|
||||
uint32_t
|
||||
v3d_simulator_get_raster_stride_align(int fd)
|
||||
{
|
||||
struct v3d_simulator_file *file = v3d_get_simulator_file_for_fd(fd);
|
||||
return file->raster_stride_align;
|
||||
}
|
||||
|
||||
static void
|
||||
v3d_simulator_init_global()
|
||||
{
|
||||
|
|
@ -1218,6 +1228,12 @@ v3d_simulator_init(int fd)
|
|||
sim_file->gem_type = GEM_ASAHI;
|
||||
else
|
||||
sim_file->gem_type = GEM_DUMB;
|
||||
|
||||
if (sim_file->gem_type == GEM_AMDGPU)
|
||||
sim_file->raster_stride_align = 256;
|
||||
else
|
||||
sim_file->raster_stride_align = 1;
|
||||
|
||||
drmFreeVersion(version);
|
||||
|
||||
sim_file->bo_map =
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ int v3d_simulator_ioctl(int fd, unsigned long request, void *arg);
|
|||
void v3d_simulator_open_from_handle(int fd, int handle, uint32_t size);
|
||||
uint32_t v3d_simulator_get_mem_size(void);
|
||||
uint32_t v3d_simulator_get_mem_free(void);
|
||||
uint32_t v3d_simulator_get_raster_stride_align(int fd);
|
||||
|
||||
#ifdef v3dX
|
||||
# include "v3dx_simulator.h"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue