summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2016-10-20 22:57:03 +0200
committerMarek Olšák <[email protected]>2016-10-26 13:02:58 +0200
commit81a95946dab730c1cfcf04ac1373cea5f7908f65 (patch)
treef2bffccf7708d25b7f8c01a6fa634a588d2e52ef /src/gallium/winsys
parentdc6bbe2dd0eb9ba421c8454b3b6179a6b0452b40 (diff)
gallium/radeon: fold radeon_winsys::surface_best into radeon/winsys
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r--src/gallium/winsys/amdgpu/drm/amdgpu_surface.c7
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_drm_surface.c24
2 files changed, 6 insertions, 25 deletions
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_surface.c b/src/gallium/winsys/amdgpu/drm/amdgpu_surface.c
index c5462bc0e04..95da4acc716 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_surface.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_surface.c
@@ -577,14 +577,7 @@ static int amdgpu_surface_init(struct radeon_winsys *rws,
return 0;
}
-static int amdgpu_surface_best(struct radeon_winsys *rws,
- struct radeon_surf *surf)
-{
- return 0;
-}
-
void amdgpu_surface_init_functions(struct amdgpu_winsys *ws)
{
ws->base.surface_init = amdgpu_surface_init;
- ws->base.surface_best = amdgpu_surface_best;
}
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_surface.c b/src/gallium/winsys/radeon/drm/radeon_drm_surface.c
index 0399e5a3680..8a88ee55490 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_surface.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_surface.c
@@ -186,24 +186,13 @@ static int radeon_winsys_surface_init(struct radeon_winsys *rws,
surf_winsys_to_drm(&surf_drm, surf_ws);
- r = radeon_surface_init(ws->surf_man, &surf_drm);
- if (r)
- return r;
-
- surf_drm_to_winsys(ws, surf_ws, &surf_drm);
- return 0;
-}
-
-static int radeon_winsys_surface_best(struct radeon_winsys *rws,
- struct radeon_surf *surf_ws)
-{
- struct radeon_drm_winsys *ws = (struct radeon_drm_winsys*)rws;
- struct radeon_surface surf_drm;
- int r;
-
- surf_winsys_to_drm(&surf_drm, surf_ws);
+ if (!(surf_ws->flags & RADEON_SURF_IMPORTED)) {
+ r = radeon_surface_best(ws->surf_man, &surf_drm);
+ if (r)
+ return r;
+ }
- r = radeon_surface_best(ws->surf_man, &surf_drm);
+ r = radeon_surface_init(ws->surf_man, &surf_drm);
if (r)
return r;
@@ -214,5 +203,4 @@ static int radeon_winsys_surface_best(struct radeon_winsys *rws,
void radeon_surface_init_functions(struct radeon_drm_winsys *ws)
{
ws->base.surface_init = radeon_winsys_surface_init;
- ws->base.surface_best = radeon_winsys_surface_best;
}