aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys/intel/drm/intel_drm_winsys.c
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2014-03-08 16:22:06 +0800
committerChia-I Wu <[email protected]>2014-03-10 16:42:42 +0800
commit790c32ec75c1310a03aecc797fd2a2f703cda66a (patch)
treeff771aec7323b8f18b7c0003e853d4407050775b /src/gallium/winsys/intel/drm/intel_drm_winsys.c
parent90786613e98a4d9e5dbb733c18003c36992aba30 (diff)
ilo: remove intel_bo_get_virtual()
Make the map functions return the pointer directly.
Diffstat (limited to 'src/gallium/winsys/intel/drm/intel_drm_winsys.c')
-rw-r--r--src/gallium/winsys/intel/drm/intel_drm_winsys.c48
1 files changed, 33 insertions, 15 deletions
diff --git a/src/gallium/winsys/intel/drm/intel_drm_winsys.c b/src/gallium/winsys/intel/drm/intel_drm_winsys.c
index ad91281e62e..e68fd45ec62 100644
--- a/src/gallium/winsys/intel/drm/intel_drm_winsys.c
+++ b/src/gallium/winsys/intel/drm/intel_drm_winsys.c
@@ -365,7 +365,7 @@ void
intel_winsys_decode_commands(struct intel_winsys *winsys,
struct intel_bo *bo, int used)
{
- int err;
+ void *ptr;
if (!winsys->decode) {
winsys->decode = drm_intel_decode_context_alloc(winsys->info.devid);
@@ -376,8 +376,8 @@ intel_winsys_decode_commands(struct intel_winsys *winsys,
drm_intel_decode_set_output_file(winsys->decode, stderr);
}
- err = intel_bo_map(bo, false);
- if (err) {
+ ptr = intel_bo_map(bo, false);
+ if (!ptr) {
debug_printf("failed to map buffer for decoding\n");
return;
}
@@ -386,7 +386,7 @@ intel_winsys_decode_commands(struct intel_winsys *winsys,
used /= 4;
drm_intel_decode_set_batch_pointer(winsys->decode,
- gem_bo(bo)->virtual, gem_bo(bo)->offset64, used);
+ ptr, gem_bo(bo)->offset64, used);
drm_intel_decode(winsys->decode);
@@ -412,27 +412,45 @@ intel_bo_get_size(const struct intel_bo *bo)
}
void *
-intel_bo_get_virtual(const struct intel_bo *bo)
-{
- return gem_bo(bo)->virtual;
-}
-
-int
intel_bo_map(struct intel_bo *bo, bool write_enable)
{
- return drm_intel_bo_map(gem_bo(bo), write_enable);
+ int err;
+
+ err = drm_intel_bo_map(gem_bo(bo), write_enable);
+ if (err) {
+ debug_error("failed to map bo");
+ return NULL;
+ }
+
+ return gem_bo(bo)->virtual;
}
-int
+void *
intel_bo_map_gtt(struct intel_bo *bo)
{
- return drm_intel_gem_bo_map_gtt(gem_bo(bo));
+ int err;
+
+ err = drm_intel_gem_bo_map_gtt(gem_bo(bo));
+ if (err) {
+ debug_error("failed to map bo");
+ return NULL;
+ }
+
+ return gem_bo(bo)->virtual;
}
-int
+void *
intel_bo_map_unsynchronized(struct intel_bo *bo)
{
- return drm_intel_gem_bo_map_unsynchronized(gem_bo(bo));
+ int err;
+
+ err = drm_intel_gem_bo_map_unsynchronized(gem_bo(bo));
+ if (err) {
+ debug_error("failed to map bo");
+ return NULL;
+ }
+
+ return gem_bo(bo)->virtual;
}
void