summaryrefslogtreecommitdiffstats
path: root/gralloc_drm_radeon.c
diff options
context:
space:
mode:
authorChia-I Wu <olvaffe@gmail.com>2011-07-18 13:24:05 +0800
committerChia-I Wu <olvaffe@gmail.com>2011-07-18 13:32:48 +0800
commita442674a06b308d43b8bc3029b1522e2b48888d6 (patch)
treefdd63d498a4721498b64e1711625efce0f092732 /gralloc_drm_radeon.c
parent68ea7da097be193e44f6d9fcbde6b1daf0e703c1 (diff)
downloadexternal_drm_gralloc-a442674a06b308d43b8bc3029b1522e2b48888d6.zip
external_drm_gralloc-a442674a06b308d43b8bc3029b1522e2b48888d6.tar.gz
external_drm_gralloc-a442674a06b308d43b8bc3029b1522e2b48888d6.tar.bz2
radeon: verbose debug messages on errors
Diffstat (limited to 'gralloc_drm_radeon.c')
-rw-r--r--gralloc_drm_radeon.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/gralloc_drm_radeon.c b/gralloc_drm_radeon.c
index 1aca76f..e09b16a 100644
--- a/gralloc_drm_radeon.c
+++ b/gralloc_drm_radeon.c
@@ -441,28 +441,38 @@ static int radeon_probe(struct radeon_info *info)
kinfo.request = RADEON_INFO_DEVICE_ID;
kinfo.value = (long) &info->chipset;
err = drmCommandWriteRead(info->fd, DRM_RADEON_INFO, &kinfo, sizeof(kinfo));
- if (err)
+ if (err) {
+ LOGE("failed to get device id");
return err;
+ }
/* XXX this is wrong and a table should be used */
- if (info->chipset >= 0x68e4 && info->chipset <= 0x68fe)
+ if (info->chipset >= 0x68e4 && info->chipset <= 0x68fe) {
info->chip_family = CHIP_FAMILY_CEDAR;
- else if (info->chipset >= 0x9802 && info->chipset <= 0x9807)
+ }
+ else if (info->chipset >= 0x9802 && info->chipset <= 0x9807) {
info->chip_family = CHIP_FAMILY_PALM;
- else
+ }
+ else {
+ LOGE("unknown device id 0x%04x", info->chipset);
return -EINVAL;
+ }
err = radeon_init_tile_config(info);
- if (err)
+ if (err) {
+ LOGE("failed to get tiling config");
return err;
+ }
/* CPU cannot handle tiled buffers (need scratch buffers) */
info->allow_color_tiling = 0;
memset(&mminfo, 0, sizeof(mminfo));
err = drmCommandWriteRead(info->fd, DRM_RADEON_GEM_INFO, &mminfo, sizeof(mminfo));
- if (err)
+ if (err) {
+ LOGE("failed to get gem info");
return err;
+ }
info->vram_size = mminfo.vram_visible;
info->gart_size = mminfo.gart_size;