summaryrefslogtreecommitdiffstats
path: root/src/intel/isl/isl.h
Commit message (Collapse)AuthorAgeFilesLines
* isl: use ifndef header guardsEmil Velikov2016-10-141-1/+4
| | | | | Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Chad Versace <chadversary@chromium.org>
* isl: make locally used functions staticEmil Velikov2016-10-141-10/+0
| | | | | Signed-off-by: Emil Velikov <emil.velikov@collabra.com> Reviewed-by: Chad Versace <chadversary@chromium.org>
* isl: Correct a comment in the isl_format enumNanley Chery2016-10-071-1/+1
| | | | | | | | HiZ is not a color surface, but an auxiliary depth surface. Signed-off-by: Nanley Chery <nanley.g.chery@intel.com> Reviewed-by: Chad Versace <chadversary@chromium.org> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* intel/isl: Add a format_supports_multisampling helperJason Ekstrand2016-10-031-0/+2
| | | | | | Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Chad Versace <chadversary@chromium.org> Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
* intel/isl: Add support for RGB formats in X and Y-tiled memoryJason Ekstrand2016-09-121-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Normally, using a non-linear tiling format helps improve cache locality by ensuring that neighboring pixels are usually close-by in memory. For RGB formats, this still sort-of holds, but it can also lead to rather terrible memory access patterns where a single RGB pixel value crosses a tile boundary and gets split into two pieces in different 4K pages. It also makes for some rather awkward calculations because your tile size is no longer an even multiple of surface element size. For these reasons, we chose to simply never create tiled RGB images in the Vulkan driver. The GL driver, however, is not so kind so we need to support it somehow. I briefly toyed with a couple of different schemes but this is the best one I could come up with. The fundamental problem is that a tile no longer contains an integer number of surface elements. I briefly considered a couple other options but found them wanting: 1) Using floats for the logical tile size. This leads to potential rounding error problems. 2) When presented with a RGB format, just make the tile 3-times as wide. This isn't so nice because now our tiles are no longer power-of-two size. Also, it can force the row_pitch to be larger than needed which, while not strictly a problem for ISL, causes incompatibility problems with the way the GL driver chooses surface pitches. The chosen method requires that you pay attention and not just assume that your tile_info is in the units you think it is. However, it's nice because it provides a nice "these are the units" declaration in isl_tile_info itself. Previously, the tile_info wasn't usable as a stand-alone structure because you had to also know the format. It also forces figuring out how to deal with inconsistencies between tiling and format back to the caller which is good because the two different consumers of isl_tile_info really want to deal with it differently: Computation of the surface size wants the fewest number of horizontal tiles possible while get_intratile_offset is far more concerned with things aligning nicely. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Acked-by: Chad Versace <chadversary@chromium.org>
* intel/isl: Add a helper for getting the size of an interleaved pixelJason Ekstrand2016-09-121-0/+3
| | | | | Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
* intel/isl: Fix an assert in get_intratile_offset_saJason Ekstrand2016-09-121-1/+1
| | | | | Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
* intel/isl: Add an isl_swizzle structure and use it for isl_view swizzlesJason Ekstrand2016-09-121-1/+17
| | | | | | | | | This should be more compact than the enum isl_channel_select[4] that we were using before. It's also very convenient because we already had such a structure in the Vulkan driver we just needed to pull it over. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
* intel/isl: Treat 3-D textures as 2-D arrays for renderingJason Ekstrand2016-09-121-0/+6
| | | | | | | | | | In particular, this means that isl_view::base_array_layer and isl_view::array_len get applied to 3-D textures but only when rendering. We were already applying isl_view::base_array_layer for rendering into 3-D textures so this isn't a huge deviation. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* intel: s/brw_device_info/gen_device_info/Jason Ekstrand2016-09-031-11/+11
| | | | | | | | | | | | | Generated by: sed -i -e 's/brw_device_info/gen_device_info/g' src/intel/**/*.c sed -i -e 's/brw_device_info/gen_device_info/g' src/intel/**/*.h sed -i -e 's/brw_device_info/gen_device_info/g' **/i965/*.c sed -i -e 's/brw_device_info/gen_device_info/g' **/i965/*.cpp sed -i -e 's/brw_device_info/gen_device_info/g' **/i965/*.h Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* isl: Add helpers for creating different types of aux surfacesJason Ekstrand2016-08-171-0/+15
| | | | Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
* isl: Add a #define for DEV_IS_BAYTRAILJason Ekstrand2016-08-171-0/+4
| | | | Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
* isl: Add functions for computing surface offsets in samplesJason Ekstrand2016-08-171-0/+48
| | | | Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
* isl: Fix the parameter names for get_intratile_offsetJason Ekstrand2016-08-171-4/+4
| | | | | | | | It's been in elements for a while but, for whatever reason, the parameter names in the header file never got updated. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
* isl: Add a helper for getting a depth format from an isl_formatJason Ekstrand2016-08-081-0/+2
| | | | | Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* isl/state: Add support for OffsetX/Y in surface stateJason Ekstrand2016-07-151-0/+3
| | | | | Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Chad Versace <chad.versace@intel.com>
* isl: Add an ISL_DEV_IS_G4X macroJason Ekstrand2016-07-151-0/+4
| | | | | Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Chad Versace <chad.versace@intel.com>
* isl: Fix isl_tiling_is_any_y()Nanley Chery2016-07-151-1/+1
| | | | | | | Cc: 12.0 <mesa-stable@lists.freedesktop.org> Signed-off-by: Nanley Chery <nanley.g.chery@intel.com> Reviewed-by: Chad Versace <chad.versace@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* isl/state: Add support for handling auxiliary surfacesJason Ekstrand2016-07-131-0/+7
| | | | | Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com> Reviewed-by: Chad Versace <chad.versace@intel.com>
* isl: Add an auxiliary surface usage enumJason Ekstrand2016-07-131-0/+26
| | | | Reviewed-by: Chad Versace <chad.versace@intel.com>
* isl: Add support for color control surfacesJason Ekstrand2016-07-131-0/+14
| | | | Reviewed-by: Chad Versace <chad.versace@intel.com>
* isl: Add support for multisample compression surfacesJason Ekstrand2016-07-131-0/+7
| | | | Reviewed-by: Chad Versace <chad.versace@intel.com>
* isl: Add support for HiZ surfacesJason Ekstrand2016-07-131-0/+17
| | | | Reviewed-by: Chad Versace <chad.versace@intel.com>
* isl: Kill off isl_format_layout::bsJason Ekstrand2016-07-131-3/+2
| | | | Reviewed-by: Chad Versace <chad.versace@intel.com>
* isl: Take bpb rather than bs in tiling_get_infoJason Ekstrand2016-07-131-1/+1
| | | | Reviewed-by: Chad Versace <chad.versace@intel.com>
* isl: Bring back isl_format_layout::bpbJason Ekstrand2016-07-131-0/+1
| | | | | | | | A while ago we got rid of the bits-per-block because we thought we didn't need it. We're about to introduce some very useful 1 and 2-bit formats so we really should be able to handle them again. Reviewed-by: Chad Versace <chad.versace@intel.com>
* isl: Rework the way we define tile sizes.Jason Ekstrand2016-07-131-4/+33
| | | | | | | | | | | This is based on a very long set of discussions between Chad and myself about how we should properly represent HiZ and CCS buffers. The end result of that discussion was that a tiling actually has two different sizes, a logical size in elements, and a physical size in bytes and rows. This commit reworks ISL's pitch and size calculations to work in terms of these two sizes. Reviewed-by: Chad Versace <chad.versace@intel.com>
* isl: Get rid of tiling_get_extentJason Ekstrand2016-07-131-6/+0
| | | | | | It was unused Reviewed-by: Chad Versace <chad.versace@intel.com>
* isl: Fix some tautological-compare warningsBen Widawsky2016-05-261-0/+8
| | | | | | | | | | | | Fixes: isl.c:62:22: warning: self-comparison always evaluates to true [-Wtautological-compare] assert(ISL_DEV_GEN(dev) == dev->info->gen); ^~ isl.c:63:33: warning: self-comparison always evaluates to true [-Wtautological-compare] assert(ISL_DEV_USE_SEPARATE_STENCIL(dev) == dev->use_separate_stencil); Signed-off-by: Ben Widawsky <ben@bwidawsk.net> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
* isl: Add per-gen format introspectionJason Ekstrand2016-05-231-0/+13
| | | | | | This is just a copy-and-paste from brw_surface_formats.c. For the supports_vertex_fetch function, we do a bit more work so that it properly handles Bay Trail.
* isl: Add the ISL_FORMAT_R32G32_FLOAT_LD formatJason Ekstrand2016-05-231-0/+1
|
* isl: Add support for quering the string name of a formatJason Ekstrand2016-05-231-0/+7
|
* isl: Add 2D ASTC format layouts and enumsNanley Chery2016-05-201-0/+30
| | | | | | | | Also, make changes needed for successful compilation and registration as a texture compression mode. Signed-off-by: Nanley Chery <nanley.g.chery@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* isl/format: Add a get_num_channels helperJason Ekstrand2016-04-211-0/+2
| | | | Reviewed-by: Chad Versace <chad.versace@intel.com>
* isl/format: Add more isl_format_has_type_channel functionsJason Ekstrand2016-04-211-4/+19
| | | | Reviewed-by: Chad Versace <chad.versace@intel.com>
* isl: Add a helper for determining when a typed load/store can be usedJason Ekstrand2016-04-211-0/+7
| | | | Reviewed-by: Chad Versace <chad.versace@intel.com>
* isl: Take a devinfo in lower_storage_image_format instead of an isl_deviceJason Ekstrand2016-04-211-1/+1
| | | | | | | We want to call this function from the shader compiler and having a full isl_device available at that point isn't practical. Reviewed-by: Chad Versace <chad.versace@intel.com>
* isl: Don't use designated initializers in the headerJason Ekstrand2016-04-211-13/+24
| | | | | | | C++ doesn't support designated initializers and g++ in particular doesn't handle them when the struct gets complicated, i.e. has a union. Reviewed-by: Chad Versace <chad.versace@intel.com>
* isl: Include c99_compat.hJason Ekstrand2016-04-211-0/+1
| | | | | | We need the restrict keyword in isl.h Reviewed-by: Chad Versace <chad.versace@intel.com>
* isl: Remove surf_get_intratile_offset_elJason Ekstrand2016-04-081-20/+0
| | | | | | | The intratile offset may not be a multiple of the element size so this calculation is invalid. Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
* isl: Rework the get_intratile_offset functionJason Ekstrand2016-04-081-12/+21
| | | | | | | | | | The old function tried to work in elements which isn't, strictly speaking, a valid thing to do. In the case of a non-power-of-two format, there is no guarantee that the x offset into the tile is a multiple of the format block size. This commit refactors it to work entirely in terms of a tiling (not a surface) and bytes/rows. Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
* isl: Add more helpers for determining if a format is an integer formatJason Ekstrand2016-03-101-0/+10
|
* isl: Get rid of isl_surf_fill_state_info::level0_extent_pxNanley Chery2016-03-041-9/+0
| | | | | | | This field is no longer needed. Signed-off-by: Nanley Chery <nanley.g.chery@intel.com> Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
* isl: Add function to get intratile offsets from x/y offsetsNanley Chery2016-03-031-0/+12
| | | | | Signed-off-by: Nanley Chery <nanley.g.chery@intel.com> Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
* isl: Add helpers for filling out brw_image_paramJason Ekstrand2016-02-271-0/+12
|
* isl: Add a helper for filling a buffer surface stateJason Ekstrand2016-02-271-0/+37
|
* isl: Add a function for filling out a surface stateJason Ekstrand2016-02-271-0/+102
|
* Move isl to src/intelJason Ekstrand2016-02-181-0/+1025