summaryrefslogtreecommitdiff
path: root/lib/igt_fb.h
AgeCommit message (Collapse)Author
2022-05-24lib/igt_fb: Add support for drawing rectangles with random colorsAndré Almeida
Add support for drawing rectangles with random colors, useful for tests that you don't mind which color will be used. Signed-off-by: André Almeida <andrealmeid@igalia.com> Reviewed-by: Melissa Wen <mwen@igalia.com> Reviewed-by: Alex Hung <alex.hung@amd.com>
2022-03-04lib/igt_fb: add an API to support color square DP CTS patternMaitreyee Rao
Add an api to support the CTA range color square video test pattern as explained in section 3.2.5.3 of the DP CTS specification. This pattern is required for supporting the CTA range for RGB formats. Also rename the existing api igt_fill_cts_framebuffer to igt_fill_cts_color_ramp_framebuffer to highlight the pattern type. changes in v3: - fix compilation warnings by reformatting code changes in v2: - removed redundant pointers - fixed overall formatting issues - Fixed author name Signed-off-by: Maitreyee Rao <maitreye@codeaurora.org> Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com> Acked-by: Petri Latvala <petri.latvala@intel.com>
2021-10-18lib/fb: Introduce igt_fb_modifier_name()Ville Syrjälä
Provide a human readable name for modifiers. Only plugged in the i915 specific ones for now. Also provide some printf format macros for convenience. Reviewed-by: Karthik B S <karthik.b.s@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2021-03-26lib: Introduce the igt_nouveau libraryLyude Paul
This introduces the igt_nouveau library, which enables support for tiling formats on nouveau, along with accelerated clears for allocated bos in VRAM using the dma-copy engine present on Nvidia hardware since Tesla. Typically the latter would be handled by the kernel automatically, which is the long-term plan for nouveau, but since the kernel doesn't yet support that we implement this in igt in order to fulfill the expectation that most of igt has in which newly allocated fbs are expected to be zero-filled by default. The dma-copy engine is capable of fast blitting, and is also able to perform tiling/untiling at the same time. This is worth mentioning because unlike many of the other drivers supported in igt, we go out of our way to avoid using mmap() in order to perform CPU rendering wherever possible. Instead of mmap()ing an fb that we want to draw to on the CPU (whether it be for converting formats, or just normal rendering), we instead use dma-copy to blit linear/tiled fbs over to linear system memory which we mmap() instead. This is primarily because while mmap() is typically painfully slow for vram, it's even slower on nouveau due to the current lack of dynamic reclocking in our driver. Furthermore, using the dma-copy engine for copying things over to system ram is also dramatically faster than using igt's memcpy wc helpers even when no tiling is involved. Such speed improvements are both quite nice, but also very necessary for certain tests like kms_plane that are rather sensitive when it comes to slow rendering with drivers. This doesn't mean we won't want to provide a way of using mmap() for rendering in the future however, as at least basic testing of mmap() is certainly something we eventually want for nouveau. However, I think the best way for us to do this in the future will be to adapt the igt_draw API to work with nouveau so we can explicitly request using mmap() in tests which need it. Finally, this code also adds a hard dependency on libdrm support for nouveau tests. The main reason for this is currently there are no real applications that use nouveau's ioctls directly (mesa for instance, uses libdrm as well) and also that nouveau's ioctls are currently a bit complicated to use by hand. This will likely be temporary however, as Ben Skeggs is planning on revamping a lot of nouveau's APIs to simplify them and make libdrm support for nouveau obsolete in the future. Note that we take care to make sure that users can still disable libdrm support for nouveau if needed, with the only caveat being that any tests using igt_nouveau will be disabled, along with any tiling support for nvidia-specific tiling formats. This should enable igt tests which test tiling formats to run on nouveau, and fix some seemingly random test failures as a result of not having zero-filled buffers in a few other tests like kms_cursor_crc. Changes since v1: * Remove leftover rebase detritus in drm_fourcc.h Signed-off-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Martin Peres <martin.peres@mupuf.org> Cc: Ben Skeggs <bskeggs@redhat.com> Cc: Jeremy Cline <jcline@redhat.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2020-11-23lib/rendercopy: Enable fast clearMika Kahola
Enable fast clear rendering on rendercopy function. v2: Modify _gen9_render_copyfunc to support fast clear (Matt) Enable fast clear bit on 3D sequence (Matt) Add helper function to figure out clear color modifier (Matt) v3: Remove unrelated line additions/removes v4: Fast clear with color (Imre) v5: Write raw 32-bit color values to register (Imre) Require 32-bit color format v6: Rebase to use batchbuffer without libdrm dependency v7: Enable clear color (Nanley) v8: Various cleanups (Imre) Modificate buffer creation (Imre) v9: Renaming of render_copyfunc() to render_op() (Imre) Remove igt_render_clearfunc variable (Imre) v10: Dst buffer width division by 64 pixels and height by 16 lines (Imre) Reorder ss10 bit fields (Imre) Relocate buffer with clear color value enabled (Imre) Set fast clear enable bit in correct dword (Imre) Signed-off-by: Mika Kahola <mika.kahola@intel.com> Reviewed-by: Imre Deak <imre.deak@intel.com>
2020-09-16lib/igt_fb: move the CTS fill framebuffer to igt_fb libAbhinav Kumar
The function to fill the framebuffer with the CTS pattern is generic. Move it to the igt_fb layer so that it can be used by other modules. changes in v2: none Signed-off-by: Abhinav Kumar <abhinavk@codeaurora.org> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2020-09-04lib: Add function to hash a framebufferBrian Starkey
To use writeback buffers as a CRC source, we need to be able to hash them. Implement a simple FVA-1a hashing routine for this purpose. Doing a bytewise hash on the framebuffer directly can be very slow if the memory is noncached. By making a copy of each line in the FB first (which can take advantage of word-access speedup), we can do the hash on a cached copy, which is much faster (10x speedup on my platform). Changes since V7 (Maxime Ripard): * Maxime Ripard: - Replace `gem_mmap__gtt` by `igt_fb_map_buffer` on `igt_fb_get_crc()` * Rodrigo Siqueira: - Rename igt_fb_get_crc to igt_fb_get_fnv1a_crc Changes since V6 (Simon Ser): * Use plain uint32_t for FNV1a_OFFSET_BIAS and FNV1a_PRIME * Return -EINVAL in case fb->num_planes != 1 * Just copy fb->width * cpp instead of copy the whole stride v5: use igt_memcpy_from_wc() instead of plain memcpy, as suggested by Chris Wilson Signed-off-by: Brian Starkey <brian.starkey@arm.com> [rebased and updated to the most recent API] Signed-off-by: Liviu Dudau <liviu.dudau@arm.com> [rebased and updated] Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com> Reviewed-by: Simon Ser <simon.ser@intel.com> Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
2020-07-07lib/igt_fb: remove extra parameters from igt_put_cairo_ctxMelissa Wen
The function igt_put_cairo_ctx currently requires three parameters, but only one of them is used in it. This patch removes the useless parameters, making the code more readable and cohesive. It also applies the change to all occurrences of the function in the code. Signed-off-by: Melissa Wen <melissa.srw@gmail.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2020-02-17tests/kms_ccs: Use correct CCS plane for semiplanar formatsMika Kahola
In case with semiplanar formats, we should use correct CCS plane when these formats are under a test. v2: Correct plane for bad ccs handle test (Imre) Added documentation (Petri) Signed-off-by: Mika Kahola <mika.kahola@intel.com> Reviewed-by: Imre Deak <imre.deak@intel.com>
2019-12-31tests/kms_ccs: Add option to check the CCS planesImre Deak
Add an option to check whether the framebuffer content was really compressed. v2: - Add code comment explaining the reason and way of the check. (JP) Cc: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Cc: Mika Kahola <mika.kahola@intel.com> Signed-off-by: Imre Deak <imre.deak@intel.com> Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2019-08-19lib: expose fb_initOleg Vasilev
Make it public. Signed-off-by: Oleg Vasilev <oleg.vasilev@intel.com> Reviewed-by: Simon Ser <simon.ser@intel.com>
2019-07-08lib/igt_fb: Allow creating yuv fbs with different encodings/rangesVille Syrjälä
Pass the color encoding/range to igt_create_fb_with_bo_size() so that tests are able to generate fbs with various encodings/ranges. v2: Drop the _full() variants of th fb create funcs (Nicholas) Cc: Uma Shankar <uma.shankar@intel.com> Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> #v1 Reviewed-by: Uma Shankar <uma.shankar@intel.com> #v1 Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2019-06-27lib/igt_fb: add functionality of getting framebuffer 16-bit CRC.Dingchen Zhang
Need framebuffer CRC to validate AMDGPU bypass mode. For each color component less than 16-bits, padding zero bits, loop to update CRC for each RGB compoment in the framebuffer. The algorithm is based on DP spec v1.4. Cc: Harry Wentland <Harry.Wentland@amd.com> Cc: Nick Kazlauskas <Nicholas.Kazlauskas@amd.com> Signed-off-by: Dingchen Zhang <dingchen.zhang@amd.com> Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
2019-04-18lib/igt_fb: Add support for fp16 formats through conversionKevin Strasser
Follow design of P01x conversion to support tests needing pixel data in fp16 (half float 64 bpp). rfc2: - Convert whole rows of pixels if possible (Maarten) - Treat rgbx like rgba, let hardware ignore alpha (Maarten) Signed-off-by: Kevin Strasser <kevin.strasser@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2019-03-13lib/igt_fb: better format printingDaniel Vetter
Steal if from kms_plane.c and put it into igt_fb.h Also tiny bikeshed to remove the space, so it fits more tidily into the usual name1=value1, name2=value2 style printing. v2: Rebase v3: It better compile :-/ Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> (v1) Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2019-03-11lib/igt_fb: Function to create a bo for passed in igt_fbDhinakaran Pandiyan
In order to execute negative tests that validate fb creation, tests need to be able to call the addfb ioctl themselves so that the arguments can be manipulated. Add a library function to provide an initialized fb without registering the fb with the kernel. Cc: Clinton Taylor <clinton.a.taylor@intel.com> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2019-03-11lib/igt_fb: s/tiling/modifier/ where appropriateVille Syrjälä
Rename the igt_fb.tiling to igt_fb.modifier to better reflect what information it carries. Now it's clear whether we're talking about a modifier or a i915 tiling thing. Cc: Clinton Taylor <clinton.a.taylor@intel.com> >From DK: Rebased on vc4 changes Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
2019-02-26lib/igt_fb: Pass the modifier to igt_fb_convert helpersPaul Kocialkowski
The modifier is part of how a frame is represented, so add it as an extra argument so that it can be specified when converting framebuffers. For now, only a linear modifier is supported. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
2019-02-26lib/igt_fb: Add a helper to fill-in the available DRM formatsPaul Kocialkowski
Introduce a helper to allocate and fill-in a list of available DRM formats, which is useful for picking one at random in tests. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com>
2019-02-26lib/igt_fb: Add a helper to retreive the plane bpp for a given formatPaul Kocialkowski
The format bpp for a given plane is stored in the static format_desc structure and is not accessible to tests, which is inconvenient to get the minimum stride for a format when testing various strides. Add a simple helper to expose the information. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com>
2019-02-26lib/igt_fb: Add a stride-provisioned fashion of igt_fb_convertPaul Kocialkowski
The current implementation of igt_fb_convert does not allow passing the destination stride, which is something we want to change for tests. Add a new fashion of this function that allocates the desintation buffer with a given stride. Since the current function does the same thing with an unspecified stride (set to zero, which will be filled later), make it call our new fashion with the stride set to zero to avoid duplication. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com>
2019-02-13lib/igt_fb: Add support for P01x formats, v5.Maarten Lankhorst
The P01x formats are planar 16 bits per component, with the unused lower bits set to 0. This means they can all be converted the same way. Only the range is slightly different, and this is handled in the color_encoding implementation. This requires cairo 1.17.2 and pixman 0.36. This works but doesn't give extra precision. For more than 8 bits precision a few more patches are required to pixman, pending review: https://lists.freedesktop.org/archives/pixman/2019-January/004815.html https://lists.freedesktop.org/archives/pixman/2019-January/004809.html Once those are merged, we will require the next pixman release for better precision. Changes since v1: - Add fallback color definitions when compiling on cairo version < 1.17.2. - Skip when FB creation fails on HDR formats, instead of failing. Changes since v2: - Complain slightly harder when pixman/cairo are out of date. - Create a fb with alpha when converting to pixman formats with alpha. - Oops, s/pixman_format_code_t/cairo_format_t/ Changes since v3: - Rebase on top of upstream YUV changes. Changes since v4: - Rebase again. - Use drm_fourcc.h from drm-misc-next. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> #v4
2018-10-08fb: Add format conversion routineMaxime Ripard
The chamelium format subtests will need to convert the reference pattern to the format to be tested on the DRM device. However, Cairo is very limited when it comes to format, and while pixman has much more support for formats, it's still falling short compared to what DRM exposes, especially on the YUV side. Plus, since we want to run CRC checks on the frame, we can't afford having conversions back and forth between RGB24, as the current API is doing. In order to abstract this away, let's create a function that will convert a igt_fb structure to another DRM format and return the converted igt_fb. For now, we will use only cairo to do the conversion, but we will use other libraries or roll our own routines to convert to more exotic formats and abstract it away from the users. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
2018-10-08fb: Add buffer map/unmap functionsMaxime Ripard
The current code to manipulate the buffer has the assumption that we can create an underlying cairo instance. However, when it comes to supporting various formats, cairo is very limited so we would need to decouple the buffer access from cairo surfaces. Let's create a function that allows to map the underlying GEM buffer from an igt_fb structure, which will then allow use to manipulate as we wish. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
2018-09-27lib/igt_fb: Pass around igt_fb internallyVille Syrjälä
Instead of passing around a boatload of integers everywhere let's just pass around the igt_fb struct. That obviously means we have to populate it first sufficiently, to which end we'll add a small helper. Later on the stride/size calculations will consult the already pre-populated igt_fb and fill in the rest as needed. This makes the whole thing a lot less error prone as it's impossible to accidentally pass the arguments in the wrong order when there's just the one of them, and it's a pointer. v2: Rebase due to uint64_t size Cc: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2018-09-11lib/igt_fb: Make fb size 64bitVille Syrjälä
Switch all fb size handling to 64bits to accomodate >4GiB framebuffers. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-06-08lib/fb: Add color_encoding/color_range to igt_fbVille Syrjälä
Make igt_fb be aware of the color encoding/range. For now we still hardcore everything to BT.709 limited range though. v2: Default to BT.709 Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2018-05-23tests/kms_plane_scaling: Allow clip test to fail with YUVVille Syrjälä
YUV formats require the clipped src coordinates to be suitably aligned. We'd need to very carefully compute the unclipped dst coordinates to guarantee that. That's too much hassle so let's just accept failure in case YUV formats are used. v2: Actually remove the original igt_display_commit2() (Maarten) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> #irc
2018-02-12lib/igt_fb: Remove igt_get_all_cairo_formats()Maarten Lankhorst
All users have been converted to igt_fb_supported_format(), I don't think there's a valid use left for this. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com> Tested-by: Vidya Srinivas <vidya.srinivas@intel.com>
2018-02-12lib/igt_fb: Add igt_fb_supported_format()Maarten Lankhorst
This makes it possible to iterate whether a format is supported or not, without each driver having to open code it. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com> Tested-by: Vidya Srinivas <vidya.srinivas@intel.com>
2018-02-01lib/fb: Add support for creating planar framebuffers, v3.Maarten Lankhorst
Add support to create planar framebuffers, but don't add formats that support them yet. This first requires conversion to the RGB24 format. Changes since v1: - Don't crash in igt_create_bo_with_dimensions(). Changes since v2: - Zero offsets for dumb fb too. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com> [mlankhorst: Change memset(4 * ..) to memset(ARRAY_SIZE(format->plane_bpp) * ..)]
2018-02-01lib/igt_fb: Pass format to igt_calc_fb_sizeMaarten Lankhorst
bpp is only sufficient to calculate dimensions for packed formats, in case of planar formats we need to pass the drm format fourcc, which will give us better information. This is required for supporting planar framebuffers. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2018-02-01lib/igt_fb: Add igt_put_cairo_ctx as counter to igt_get_cairo_ctxMaarten Lankhorst
This will allow support for NV12 in the future, where igt_get_cairo_ctx will return a RGB image to draw with, which will be converted in igt_put_cairo_ctx so tests don't have to add special support for NV12. This is the same as cairo_destroy + checking for errors, but not all tests use this correctly so it's better to have a single handler for it. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2017-11-29igt: Remove Android supportArkadiusz Hiler
This patch gets rid of the Android support, deleting all the hacks and moving code around to the places it belongs. Android build is not really maintained properly and rots rather fast. With recent push for Meson here and Android going for Soong it will only accelerate. It's a good time to drop the illusion of providing any support. Cc: Daniel Vetter <daniel.vetter@intel.com> Cc: Kalyan Kondapally <kalyan.kondapally@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Cc: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Acked-by: Petri Latvala <petri.latvala@intel.com>
2017-09-22lib/igt_fb: Add igt_cairo_image_surface_create_from_png()Ville Syrjälä
Raw usage of cairo_image_surface_create_from_png() doesn't work since it doesn't know about IGT_DATADIR and IGT_SRCDIR. Let's extract the helper from igt_paint_image() that uses igt_fopen_data() + cairo_image_surface_create_from_png_stream() and call it igt_cairo_image_surface_create_from_png(). Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2017-07-25lib/igt_fb: Add helper function for tile_to_modPraveen Paneri
igt_get_fb_tile_size function takes modifer as an argument This helper function will let users to convert tiling to modifier and use igt_get_fb_tile_size() v2: Improved code comment (Paulo) v3 (from Paulo): Simple rebase. Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Praveen Paneri <praveen.paneri@intel.com> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2017-07-25lib/igt_fb: Let others use igt_get_fb_tile_sizePraveen Paneri
This function can be used by igt_draw to get accurate tile dimensions for all tile formats. v2: Added comments to function igt_get_fb_tile_size (Daniel) v3: Fixed errors in comments and coding style (Paulo) Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Praveen Paneri <praveen.paneri@intel.com>
2017-07-19lib/igt_fb: Export the cairo surface instead of writing to a pngPaul Kocialkowski
This removes the igt_write_fb_to_png function (that was unused thus far) and exports the igt_get_cairo_surface function to grab the matching cairo surface. Writing to a png is now handled by the common frame handling code in lib/igt_frame. This also fixes how the surface is retreived in chamelium code, which avoids destroying it too early. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com> Reviewed-by: Lyude <lyude@redhat.com>
2016-11-10lib: Pass tiling constant where that's expectedTomeu Vizoso
We were passing in two places a framebuffer modifier constant instead of a tiling constant. Also adds igt_fb_mod_to_tiling so tests can do that by themselves. Cc: Tvrtko Ursulin <tursulin@ursulin.net> Fixes: 8a1a38661f56 ("lib: Add igt_create_bo_with_dimensions") Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
2016-07-27lib: Update docs for igt_fbDaniel Vetter
- Again match names of paramaters - structs need a typedef to work in gtk-doc - gtk-doc doesn't know about unsigned, expects unsigned int instead Cc: Paulo Zanoni <paulo.r.zanoni@intel.com Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-04-14lib: Add igt_create_bo_with_dimensionsTomeu Vizoso
igt_create_bo_with_dimensions() is intended to abstract differences between drivers in buffer object creation. The driver-specific ioctls will be called if the driver that is being tested can satisfy the needs of the calling subtest, or it will be skipped otherwise. 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: Map dumb buffersTomeu Vizoso
If a buffer object is dumb, call DRM_IOCTL_MODE_MAP_DUMB when mapping it. Also, don't call DRM_IOCTL_I915_GEM_SET_DOMAIN on dumb buffers. 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 igt_dirty_fbTomeu Vizoso
Just wraps drmModeDirtyFB and for now invalidates the whole FB. 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-05lib: kms: move framebuffer scanout offset/size to planeLionel Landwerlin
This fixes potential crashes when the framebuffer is unset from a given plane. v2: s/with/within/ typo in header Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Marius Vlad <marius.c.vlad@intel.com> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-03-21lib: fb: add igt_paint_color_gradient_rangeLionel Landwerlin
This is a helper to draw a gradient between 2 colors. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
2016-03-02lib/igt_fb: Fix domain tracking for GTT cairo surfacesChris Wilson
If we create a cairo surface using a GTT mmaping, then we need to use the GTT access domain. cairo surfaces created with a blit temporary (for unfenced surfaces) still use the CPU domain. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-29tests/igt_fb: rename igt_get_all_formats to igt_get_all_cairo_formatsPaulo Zanoni
I recently had this discussion with Daniel where I didn't want to use igt_drm_format_to_bpp() because it uses the format_desc array, and igt_fb currently assumes that all the format_desc formats have a matching valid Cairo format, so I wouldn't be able to easily add formats such as ARGB2101010. The function that has the assumption mentioned above is igt_get_all_formats: its current users call igt_get_all_formats, and then call cairo-dependent functions, such as igt_get_cairo_ctx on the returned formats. In order to document the current behavior and prevent any problems in case we start adding new formats without matching Cairo versions to format_desc, rename igt_get_all_formats to igt_get_all_cairo_formats and make it explicitly check for CAIRO_FORMAT_INVALID. Requested-by: Daniel Vetter <daniel.vetter@ffwll.ch> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-01-29lib/igt_fb: make the automatic buffer sizes/strides smallerPaulo Zanoni
The big motivation behind this patch is that the current power-of-two granularity from igt_fb is way too big. There was more than one occasion where I had to work around this problem on kms_frontbuffer_tracking, and during my last workaround I was requested to just make igt_fb use more minimal buffers. I also need to export the size computation function so I won't need to reimplement it inside kms_frontbuffer_tracking. v2: - Fix the Yf sizes (Ville). - Don't change the Gen 2/3 behavior for both tiled and non-tiled. v3: - Edit the commit message, clarify that v1 was wrongly treating gen 2/3 non-tiled as tiled (Chris). Requested-by: Daniel Vetter <daniel.vetter@ffwll.ch> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-01-08lib: Extract some common fb create+fill methods into helpersVille Syrjälä
Several tests do one or more of the following: * igt_create_fb() + igt_paint_test_pattern() * igt_create_color_fb() + igt_paint_test_pattern() * igt_create_fb() + igt_paint_image() Extract them into new helpers: igt_create_pattern_fb(), igt_create_color_pattern_fb(), igt_create_image_fb(). v2: Fix typos, and improve API docs (Thomas) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-11-27lib/igt_fb: also pass the stride to igt_create_fb_with_bo_size()Paulo Zanoni
If the caller is going to specify a custom size, it's likely that he will also specify a custom stride. The automatic stride picked by create_bo_for_fb() is too huge for tiled buffers, so if the caller wants smaller buffers, then he'll need a smaller stride too, otherwise the Kernel will reject the addfb IOCTL due to stride * height being bigger than the size. I want to make tests/kms_frontbuffer_tracking use igt_create_fb_with_bo_size() so I can provide smaller buffers that will fit into the CFB. I'm also planning to make all frontbuffers with the same width/height/format have the same stride and size regardless of tiling method so I can exercise specific code paths. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>