diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2015-10-31 09:09:14 +0200 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2015-11-06 22:27:01 +0200 |
commit | a15dcd9f9a7abda566dfad615303c910bd47749a (patch) | |
tree | f4d303536df3cad4520869170cbcac73ad2ffc13 | |
parent | 6927457186de9e2a6692cd7cd0f254b2fbef037f (diff) |
dumbfb: improve exception texts
-rw-r--r-- | libkms++/dumbframebuffer.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libkms++/dumbframebuffer.cpp b/libkms++/dumbframebuffer.cpp index d1e40ff..0779b05 100644 --- a/libkms++/dumbframebuffer.cpp +++ b/libkms++/dumbframebuffer.cpp @@ -83,7 +83,7 @@ void DumbFramebuffer::Create() creq.bpp = pi.bitspp; r = drmIoctl(card().fd(), DRM_IOCTL_MODE_CREATE_DUMB, &creq); if (r) - throw std::invalid_argument("foo"); + throw invalid_argument(string("DRM_IOCTL_MODE_CREATE_DUMB failed") + strerror(errno)); plane.handle = creq.handle; plane.stride = creq.pitch; @@ -100,13 +100,13 @@ void DumbFramebuffer::Create() mreq.handle = plane.handle; r = drmIoctl(card().fd(), DRM_IOCTL_MODE_MAP_DUMB, &mreq); if (r) - throw std::invalid_argument("foo"); + throw invalid_argument(string("DRM_IOCTL_MODE_MAP_DUMB failed") + strerror(errno)); /* perform actual memory mapping */ m_planes[i].map = (uint8_t *)mmap(0, plane.size, PROT_READ | PROT_WRITE, MAP_SHARED, card().fd(), mreq.offset); if (plane.map == MAP_FAILED) - throw std::invalid_argument("foo"); + throw invalid_argument(string("mmap failed: ") + strerror(errno)); /* clear the framebuffer to 0 */ memset(plane.map, 0, plane.size); @@ -120,7 +120,7 @@ void DumbFramebuffer::Create() r = drmModeAddFB2(card().fd(), width(), height(), (uint32_t)format(), bo_handles, pitches, offsets, &id, 0); if (r) - throw std::invalid_argument("foo"); + throw invalid_argument(string("drmModeAddFB2 failed: ") + strerror(errno)); set_id(id); } |