From a15dcd9f9a7abda566dfad615303c910bd47749a Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Sat, 31 Oct 2015 09:09:14 +0200 Subject: dumbfb: improve exception texts --- libkms++/dumbframebuffer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libkms++') 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); } -- cgit v1.2.3