Commit Graph

72 Commits (7b60986640c6584f112222fb65b23a2fc326ce6e)

Author SHA1 Message Date
Eric Anholt 734de7093d drm: Initialize or valgrind-clear modesetting ioctl arguments.
Fixes valgrind complaints in the modesetting driver.  I tried to
follow each ioctl's pattern for whether it was initializing just the
in values, or both in and out values.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-20 10:58:06 -08:00
Dave Airlie 2e0ab62376 drm: add hotspot cursor interface support.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-07-02 09:21:39 +01:00
Rob Clark e81acf5101 initialize width/height fields in drmModeCrtc
If we have valid timings, we can at least set width/height to
*something*, which is I think at least less confusing than always
seeing width/height of zero.  At least modeprint and modetest
seem to expect width/height to mean something.

Signed-off-by: Rob Clark <rob@ti.com>
2012-10-14 16:56:53 -05:00
Rob Clark 7b228e900f Add support for bitmask properties
A bitmask property is similar to an enum.  The enum value is a bit
position (0-63), and valid property values consist of a mask of
zero or more of (1 << enum_val[n]).

Signed-off-by: Rob Clark <rob@ti.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2012-06-08 09:27:21 -05:00
Paulo Zanoni 8c75703df0 Add support for generic object properties IOCTLs
New library calls:
- drmModeObjectGetProperties
- drmModeFreeObjectProperties
- drmModeObjectSetProperties

Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
Reviewed-by: Rob Clark <rob@ti.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2012-06-08 09:27:20 -05:00
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