Commit Graph

17 Commits (617213357e94299a5e9a3cb1342de55de949d156)

Author SHA1 Message Date
Ville Syrjälä 76b4a69aab Using sizeof() on a function parameter with an array type does not
work. sizeof() treats such parameters as pointers.

Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
2012-02-02 14:53:43 -05:00
Ville Syrjälä a14c3dd0f9 This function was missing.
Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
2012-02-02 14:53:41 -05:00
Ville Syrjälä df497e9281 drmModeFreeResources() always leaked some memory.
drmModeGetPlaneResources() and drmModeGetPlane() leaked in one error
path.

Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
2012-02-02 14:53:39 -05:00
Jesse Barnes ac168bf2a0 libdrm: update drm headers from kernel, including new overlay ioctls & structs
Add structs and functions necessary for the new plane and fb handling code,
including a new header, drm_fourcc.h, that includes the surface formats
supported by various DRM drivers.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2011-12-13 11:47:15 -08:00
Marcin Slusarz 763b618d55 drm mode: fix drmIoctl wrapper
Both drmIoctl and ioctl define second argument as unigned long.

Debugging/tracing tools (like strace or valgrind) on 64-bit machines see
different request value for ioctls with 32nd bit set, because casting
signed int to unsigned long extends 32nd bit to upper word, so 0x80000000
becomes 0xFFFFFFFF80000000)

Nobody noticed because higher 32 bits are chopped off on their way to kernel.
2011-09-18 15:25:18 +02:00
Chih-Wei Huang 8d055890d9 Specify the return type explicitly. 2011-07-12 09:52:32 +01:00
Chris Wilson 8a76244a0f Free the property blob along the error path.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-08-24 21:29:31 +01:00
Chris Wilson b803918f3f drm mode: Return -errno on drmIoctl() failure
The high layers expect to receive a status code on error (on the
pessimistic assumption that the errno value will have been overwritten
by the time the failure is propagated all the way up), so convert
xf86drmMode.c to return -errno on an ioctl error and be consistent with
the rest of the libdrm API.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-07-01 22:51:33 +01:00
Peter Clifton 04f90a4470 modes: Retry GETCONNECTOR if a hotplug event occurs between the two ioctls
If the available modes changes between the two GETCONNECTOR ioctls, that
caused the kernel to skip filling one array and led to a crash (as the size
of the allocated and initialised block of memory differed from the reported
size, and might be NULL if no modes were present at first).

This bug manifest its self on my machine due to spurious false positive
detections of a connected TV-out.

Fixes: http://bugs.freedesktop.org/show_bug.cgi?id=25912
       Crash whilst probing modes

Based upon the similar fixes for the GETRESOURCES ioctls by Chris Wilson,
in the following commits:

    commit e6c136ca7a
    commit 85fb3e55fd
    commit d1308f4fe7

Signed-off-by: Peter Clifton <pcjc2@cam.ac.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-01-06 23:46:14 +00:00
Chris Wilson e6c136ca7a modes: Fix previous commit for potential legal NULLs
If the count is 0, then the malloc is permitted to return NULL, so don't
throw an error in that case.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-01-06 16:54:22 +00:00
Chris Wilson 85fb3e55fd modes: Free local resources after allocation failure in GETRESOURCES
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-01-06 15:41:17 +00:00
Chris Wilson d1308f4fe7 modes: Retry GETRESOURCES if a hotplug event occurs between the two ioctls
Peter Clifton hit an issue whereby he had a spurious TV hotplug event
that occurred between the two GETRESOURCES ioctls that caused the kernel
to skip filling one array and led to a crash (as the size of the
allocated and initialised block of memory differed from the reported
size).

Fixes: http://bugs.freedesktop.org/show_bug.cgi?id=25912
       Crash whilst probing modes

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reported-by: Peter Clifton <pcjc2@cam.ac.uk>
2010-01-06 15:33:21 +00:00
Jakob Bornecrantz 3bd834a217 Merge branch 'modesetting-dirty-libdrm'
Conflicts:
	include/drm/drm.h
2009-12-02 19:40:58 +01:00
Jesse Barnes 14f5958f7f Bump event context structure version for page flipping 2009-12-03 14:27:08 -08:00
Jesse Barnes 53addc5d6e Merge branch 'pageflip' of git://people.freedesktop.org/~jbarnes/drm
Conflicts:
	include/drm/drm.h - RMFB had its signature changed to avoid uint32_t
2009-12-03 14:17:26 -08:00
Jakob Bornecrantz 3e48613b48 Bring dirty code from old branch 2009-11-26 16:47:54 +01:00
Kristian Høgsberg 4f57abfe66 Move libdrm/ up one level 2009-11-17 11:15:06 -05:00