summaryrefslogtreecommitdiff
path: root/tests/drm_read.c
AgeCommit message (Collapse)Author
2022-07-06tests/drm_read: Fix -Wdeprecated-declarationsAshutosh Dixit
[1/405] Compiling C object tests/drm_read.p/drm_read.c.o ../tests/drm_read.c: In function ‘test_short_buffer_wakeup’: ../tests/drm_read.c:224:17: warning: ‘pthread_yield’ is deprecated: \ pthread_yield is deprecated, \ use sched_yield instead [-Wdeprecated-declarations] 224 | pthread_yield(); | ^~~~~~~~~~~~~ /usr/include/pthread.h:479:12: note: declared here 479 | extern int __REDIRECT_NTH (pthread_yield, (void), sched_yield) | ^~~~~~~~~~~~~~ Use sched_yield instead of pthread_yield Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
2021-10-11igt: s/DRM_FORMAT_MOD_NONE/DRM_FORMAT_MOD_LINEAR/Ville Syrjälä
DRM_FORMAT_MOD_LINEAR is the more sensible name for DRM_FORMAT_MOD_NONE. Use the better name. Reviewed-by: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2021-07-15Nuke local versions of DRM_FORMAT and DRM_MODELucas De Marchi
Use the definition from kernel headers. Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
2021-06-21tests/drm_read: Fix subtest invalid-bufferVidya Srinivas
Using (void *)-1 directly in read is aborting on chrome systems. Following message is seen. Starting subtest: invalid-buffer *** buffer overflow detected ***: terminated Received signal SIGABRT. Stack trace: Aborted (core dumped) Patch just adds a pointer variable and uses it in read. Signed-off-by: Vidya Srinivas <vidya.srinivas@intel.com> Tested-by: Mark Yacoub <markyacoub@chromium.org> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2021-03-24tests/drm_read: Don't use deprecated siginterruptArkadiusz Hiler
Since we are using sigaction() we can also register the signal handler in one go. Fixes: "warning: ‘siginterrupt’ is deprecated: Use sigaction with SA_RESTART instead" Signed-off-by: Arkadiusz Hiler <arek@hiler.eu> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2019-02-27igt/drm_read: Exercise waking up the next waiterChris Wilson
Try to hit a bug in the kernel whereby a short reader does not wakeup the next waiter (on the same fd) leading to forever blocking. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2018-10-01igt: Require a display (KMS enabled) for KMS testsChris Wilson
Simple rule of thumb, if a kms_* test calls igt_display_init() in its global fixture, skip the entire test if the driver has disabled KMS. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Antonio Argenziano <antonio.argenziano@intel.com>
2017-10-16tests/drm_read: Change tests to not require fbconMaarten Lankhorst
The first active pipe might not be pipe A, and we shouldn't rely on fbcon for a working crtc. Use igt_kms to set up something basic, and use the kmstest helper to get an event from the correct pipe. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-25tests/drm_read: Drop DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_IDTomeu Vizoso
So the test runs on other drivers, drop the usage of the i915-specific DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID ioctl. Wait for a vblank event on pipe0 and if we get it, then the test can proceed (code copied from kms_vblank). Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
2016-04-14tests: Open any driverTomeu Vizoso
For those tests that now pass on drivers other than i915, call drm_open_driver_master with DRIVER_ANY. Also do so from igt_enable_connectors. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-04-14lib: Add wrapper for DRM_IOCTL_MODE_CREATE_DUMBTomeu Vizoso
In order to test drivers that don't have support for proper buffer objects, add a wrapper for creating dumb buffer objects that will be called from the lib code for those subtests that don't need to care. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-11-25igt/drm_read: Clear O_NONBLOCK between testsChris Wilson
Ensure that O_NONBLOCK isn't accidentally set when we want a nonblocking file descroptor. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-11-25igt/drm_read: Check handling of pagefault on destination bufferChris Wilson
In theory, this should force i915_gem_fault() when we first use the buffer (and not at mmap time) and so prevent a __copy_to_user_inatomic() from writting to the buffer. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-09-11convert drm_open_any*() calls to drm_open_driver*(DRIVER_INTEL) calls with cocciMicah Fedke
Apply the new API to all call sites within the test suite using the following semantic patch: // Semantic patch for replacing drm_open_any* with arch-specific drm_open_driver* calls @@ identifier i =~ "\bdrm_open_any\b"; @@ - i() + drm_open_driver(DRIVER_INTEL) @@ identifier i =~ "\bdrm_open_any_master\b"; @@ - i() + drm_open_driver_master(DRIVER_INTEL) @@ identifier i =~ "\bdrm_open_any_render\b"; @@ - i() + drm_open_driver_render(DRIVER_INTEL) @@ identifier i =~ "\b__drm_open_any\b"; @@ - i() + __drm_open_driver(DRIVER_INTEL) Signed-off-by: Micah Fedke <micah.fedke@collabora.co.uk> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-08-21lib: add a single include headerThomas Wood
Add a header that includes all the headers for the library. This allows reorganisation of the library without affecting programs using it and also simplifies the headers that need to be included to use the library. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-12-08igt/drm_read: Require that pipe 0 is activeChris Wilson
As we require a pipe enabled to generate vblanks, the first step is to then to check that pipe 0 is active or else skip the test. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-05igt/drm_read: Abuse read(drm)Chris Wilson
Check that the more obvious userspace error conditions are handled by the kernel, ideally without loss of data. These include nonblocking waits, passing invalid buffers and passing buffers of the incorrect length. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>