mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-02 13:50:09 +01:00
radeon: add radeon_info parameter into radeon_winsys::surface_init
to allow radeonsi to change radeon_info. The next commit will rely on it. Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22771>
This commit is contained in:
parent
ae6b928495
commit
8c8b5a8fbd
5 changed files with 12 additions and 6 deletions
|
|
@ -244,7 +244,7 @@ static int r600_init_surface(struct r600_common_screen *rscreen,
|
|||
if (is_imported)
|
||||
flags |= RADEON_SURF_IMPORTED | RADEON_SURF_SHAREABLE;
|
||||
|
||||
r = rscreen->ws->surface_init(rscreen->ws, ptex,
|
||||
r = rscreen->ws->surface_init(rscreen->ws, &rscreen->info, ptex,
|
||||
flags, bpe, array_mode, surface);
|
||||
if (r) {
|
||||
return r;
|
||||
|
|
@ -634,7 +634,7 @@ void r600_texture_get_fmask_info(struct r600_common_screen *rscreen,
|
|||
bpe *= 2;
|
||||
}
|
||||
|
||||
if (rscreen->ws->surface_init(rscreen->ws, &templ,
|
||||
if (rscreen->ws->surface_init(rscreen->ws, &rscreen->info, &templ,
|
||||
flags, bpe, RADEON_SURF_MODE_2D, &fmask)) {
|
||||
R600_ERR("Got error in surface_init while allocating FMASK.\n");
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -313,7 +313,8 @@ static int si_init_surface(struct si_screen *sscreen, struct radeon_surf *surfac
|
|||
|
||||
surface->modifier = modifier;
|
||||
|
||||
r = sscreen->ws->surface_init(sscreen->ws, ptex, flags, bpe, array_mode, surface);
|
||||
r = sscreen->ws->surface_init(sscreen->ws, &sscreen->info, ptex, flags, bpe, array_mode,
|
||||
surface);
|
||||
if (r) {
|
||||
return r;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -728,13 +728,15 @@ struct radeon_winsys {
|
|||
* Initialize surface
|
||||
*
|
||||
* \param ws The winsys this function is called from.
|
||||
* \param info radeon_info from the driver
|
||||
* \param tex Input texture description
|
||||
* \param flags Bitmask of RADEON_SURF_* flags
|
||||
* \param bpe Bytes per pixel, it can be different for Z buffers.
|
||||
* \param mode Preferred tile mode. (linear, 1D, or 2D)
|
||||
* \param surf Output structure
|
||||
*/
|
||||
int (*surface_init)(struct radeon_winsys *ws, const struct pipe_resource *tex, uint64_t flags,
|
||||
int (*surface_init)(struct radeon_winsys *ws, const struct radeon_info *info,
|
||||
const struct pipe_resource *tex, uint64_t flags,
|
||||
unsigned bpe, enum radeon_surf_mode mode, struct radeon_surf *surf);
|
||||
|
||||
uint64_t (*query_value)(struct radeon_winsys *ws, enum radeon_value_id value);
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@ static int amdgpu_surface_sanity(const struct pipe_resource *tex)
|
|||
}
|
||||
|
||||
static int amdgpu_surface_init(struct radeon_winsys *rws,
|
||||
const struct radeon_info *info,
|
||||
const struct pipe_resource *tex,
|
||||
uint64_t flags, unsigned bpe,
|
||||
enum radeon_surf_mode mode,
|
||||
|
|
@ -103,7 +104,8 @@ static int amdgpu_surface_init(struct radeon_winsys *rws,
|
|||
if (flags & RADEON_SURF_Z_OR_SBUFFER)
|
||||
config.info.surf_index = NULL;
|
||||
|
||||
return ac_compute_surface(ws->addrlib, &ws->info, &config, mode, surf);
|
||||
/* Use radeon_info from the driver, not the winsys. The driver is allowed to change it. */
|
||||
return ac_compute_surface(ws->addrlib, info, &config, mode, surf);
|
||||
}
|
||||
|
||||
void amdgpu_surface_init_functions(struct amdgpu_screen_winsys *ws)
|
||||
|
|
|
|||
|
|
@ -343,6 +343,7 @@ static void si_compute_htile(const struct radeon_info *info,
|
|||
}
|
||||
|
||||
static int radeon_winsys_surface_init(struct radeon_winsys *rws,
|
||||
const struct radeon_info *info,
|
||||
const struct pipe_resource *tex,
|
||||
uint64_t flags, unsigned bpe,
|
||||
enum radeon_surf_mode mode,
|
||||
|
|
@ -391,7 +392,7 @@ static int radeon_winsys_surface_init(struct radeon_winsys *rws,
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (radeon_winsys_surface_init(rws, &templ, fmask_flags, bpe,
|
||||
if (radeon_winsys_surface_init(rws, info, &templ, fmask_flags, bpe,
|
||||
RADEON_SURF_MODE_2D, &fmask)) {
|
||||
fprintf(stderr, "Got error in surface_init while allocating FMASK.\n");
|
||||
return -1;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue