Commit Graph

43 Commits

Author SHA1 Message Date
Kamil Diedrich 2f88abfa2a Add information about image from buffer extension
- don't change allocation type when buffer is given
- add flag isImageFromBuffer to mem_obj

Change-Id: I48a0722040d8482ed3653540179d047245affa3c
2018-12-18 22:37:33 +01:00
Piotr Fusik e8a71132a4 Remove unnecessary casts.
Change-Id: I2d293d065c7efa006efe7d60a625cba0c6116c86
2018-12-18 13:42:14 +01:00
Maciej Godek 2ad5108380 Clarified dependencies in Context::getSupportedImageFormats
Change-Id: Iaa09a2b572b3ae6d0533378f0ecf227bd90b1a10
2018-09-27 18:41:18 +02:00
Woloszyn, Wojciech f624ec757b Unify mipmap layout accross platforms
- revert "Fix reported row/slicePitch for mip-maps"
- calculate mipmap offset without gmm

Change-Id: Id4802ef9624ad330e0d0f871dfa4d4fc35a7ba33
2018-09-25 16:27:43 +02:00
Woloszyn, Wojciech 2248c8e048 Fix typo
Change-Id: I393ad63769ac1fd9f95374344dae60dda803346a
2018-09-25 01:53:59 +02:00
Artur Harasimiuk 40146291ad Update copyright headers
Updating files modified in 2018 only. Older files remain with old style
copyright header

Change-Id: Ic99f2e190ad74b4b7f2bd79dd7b9fa5fbe36ec92
Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
2018-09-20 18:02:35 +02:00
Hoppe, Mateusz aaf2f94887 Fix zeroCopy property for images
- zeroCopy means no need for data transfer when cpu transfer is
chosen during map/unmap operations
- tests cleanup

Change-Id: Id312267e51d593781c6fe536b6e96f42f32e5c02
2018-08-23 16:45:05 +02:00
Kamil Diedrich 1dcec9e23a Error handling improvement
Change-Id: I5e35bff508c45993be03bc946ddebfb698a0c638
2018-08-20 10:54:28 +02:00
Woloszyn, Wojciech 93c1a7b51b Fix mipmaps return values
Change-Id: I6e7cdc69edc80010a0c6f5f337e6b530278a6606
2018-08-13 11:56:07 +02:00
Dunajski, Bartosz 239ebf9eab Improve AllocationType operations: dont do bit operations on enums
Change-Id: Ie70ca9e2a93ec80b1cd655bad622db9e12abb7f7
Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
2018-07-20 09:12:58 +02:00
Mrozek, Michal 3817857276 Remove redundant cast.
Change-Id: I3eb79be6a25abbaf0327458384e0e180d5b52ab5
2018-07-19 15:38:46 +02:00
Hoppe, Mateusz 684b1d75ba Refactor GraphicsAllocation::AllocationType and allocationType enums
- change GraphicsAllocatoin::AllocationType to scoped enumeration
so that ALLOCATION_TYPE_ prefix in every enum value can be removed
- all accesses are typed (example AllocationType::IMAGE)
- Rename allocationType to AllocationUsage to eliminate confusion
with multiple AllocationType enums / types

Change-Id: I16003297ecfcb0aaa5779ad00706c5d983914bbe
2018-07-06 13:00:08 +02:00
Dunajski, Bartosz e26d67cde3 Aux surface programming for Buffers [1/n]: Gmm interface improvement
Change-Id: I984b8ebee27808a236217e82bb4e910550d624c4
2018-07-03 13:00:08 +02:00
Dunajski, Bartosz 5408913d38 Set HwInfo to GmmHelper on Device creation
This allows querying HwInfo from code that doesnt have access to Device

Change-Id: I0084f824f557cd85c2fdfbf0ff2ec71118e9af2e
2018-06-29 11:02:52 +02:00
Dunajski, Bartosz e18e9fb94e Move static methods from Gmm to new GmmHelper class
Change-Id: I84fbe94f0e1072324164086b456c71a46ae5040c
2018-06-27 16:46:09 +02:00
Dunajski, Bartosz 88edc7279d Improve returned row pitch calculation for multisampled images
Change-Id: I2fbf413ba83941682fa2bd0353060cab3f534d1a
2018-06-13 13:00:26 +02:00
Maciej Dziuban 3bfbcad8c6 Fix validation of size when creating image from buffer
Change-Id: Iaf9b8aae8bd3a2f2ea2b4a3d7f751dbcf4df7c0e
2018-06-06 13:17:10 +02:00
Hoppe, Mateusz d019638119 Fix image from subbuffer offsets
- change 32 bit offset to size_t to account for offsets bigger
than 4 GB in SurfaceOffsets
- change ImageInfo offset to size_t type
- fix hostptr offseting in subbuffer creation - null hostptr
shouldn't be offseted

Change-Id: I18a5b8eacbd8c9e40c1f2effe5ded4fa8b453395
2018-05-29 16:29:25 +02:00
Hoppe, Mateusz 4c4e682bc7 Set correct offset for images created from buffer
- images from subbuffer with non-zero offset relative to
parent buffer didn't have correct Surface Address offset

Change-Id: I6ae2b87f8c9d19e40ec14a29b5eadc7401db18ad
2018-05-24 18:12:55 +02:00
Woloszyn, Wojciech 8a488ad52f Fix reported row/slicePitch for mip-maps
- use information from gmm correctly
- modify computation on gen8

Change-Id: Iaefcc20ce9436ef70cd2f4bc36654932c4b5af49
2018-05-22 10:36:54 +02:00
Mateusz Jablonski 5d296f15e3 Validate image 2d sizes unless parent image is nv12
when any check in Image::validate method failed then early return

Change-Id: Ib28110ac493f5930ffa99fa7463443e9e7fc8fcf
2018-04-10 11:41:00 +02:00
Mateusz Jablonski 1843b23692 Fix image 2d validation
check image sizes only for image without parent mem object

Change-Id: I73189f1c73653f609c6e4d7dcb7a85d06a2f858a
2018-04-10 09:39:52 +02:00
Mateusz Jablonski ac45ff74ec Fix creating image from image
- allow creating image 2d from non NV12 image 2d
- validate image descriptor and format when create image from image

Change-Id: Ie7887e75f1450fc723dc1d1ae9ff5639d88835fc
2018-04-09 11:29:11 +02:00
Chodor, Jaroslaw 0a97dfbb2f [1/n] Mipmap support
* adding support for map/unmap
* adding support for origin/region validation with mipmaps
* fixing slices returned in map/unmap
* removing ambiguity around mipLevel naming
* enabling cl_khr_mipmap_image in current shape
* enabling cl_khr_mipmap_image_writes in current shape

* fixing CompileProgramWithReraFlag test

Change-Id: I0c9d83028c5c376f638e45151755fd2c7d0fb0ab
2018-04-05 01:09:27 +02:00
Woloszyn, Wojciech 0ad81024b7 Implement cl_khr_mipmap_image [1/n]
- Add mipmap image handling for clEnqueueReadImage, clEnqueueWriteImage
- Fix mipmap image handling for clCreateImage

Change-Id: I42938a330b55c7e69a16c26dce3ab5d66f8a8938
2018-03-21 10:51:13 +01:00
Dunajski, Bartosz 08c2379f6e Validate region and origin for all image API calls
Change-Id: I28782d8838cf8f5d800f76c922fcb59235f637a1
2018-03-09 08:24:25 +01:00
Dunajski, Bartosz 23c1c4fea6 clEnqueueMapImage origin and region usage fixes
- Return error on origin > 0 or region > 1 when its not allowed
- For 1Darray, array region and origin are stored on 2nd position.
  For 2Darray, its on 3rd postion
- Fix map offset for 1Darray image
- Fix CPU data transfer for 1Darray image

Change-Id: Id35ba5f54f117e7af318ca7e6e03c1fc942ce729
2018-03-08 08:54:48 +01:00
Woloszyn, Wojciech 5c8cd51fc8 Use allocateGraphicsMemoryForImage for mipmaps
Change-Id: I0cd740ca4c8286fb73f766b74abc50ed53cfc9d0
2018-03-01 20:39:15 +01:00
Dunajski, Bartosz dd44a87d5f Map/unmap enqueue fixes [6/n]: Support multiple map operations
- Dont make cpu/gpu writes on read-only unmap
- Read/Write on limited map range only
- Overlaps checks for non read-only maps
- Fixed cmd type on returned event

Change-Id: I98ca542e8d369d2426a87279f86cadb0bf3db299
2018-02-23 10:45:06 +01:00
Dunajski, Bartosz b4f79e036f Map/unmap enqueue fixes [5/n]: Unify offset calculation
Change-Id: I53eafe89532d43c5cf5139ed3fac0a87619dc7a3
2018-02-21 20:12:52 +01:00
Dunajski, Bartosz e0ca78ccea Map/unmap enqueue fixes [3/n]: Map params inconsistency
- Introducing MapInfo struct which will be used as container for multiple
  map operations
- Unified mapped offset and size for Buffers and Images
- Fixed incorrect map params for CPU and GPU path
- Missing API level checks


Change-Id: Ib4077c9e2c0c333b131ffd5ccbc4a1404920eb5b
2018-02-16 08:28:29 +01:00
Dale Stimson 4e6fe62eb6 Convert FALLTHROUGH comments to C++17 [[fallthrough]] attribute
Use conditionals and a macro to avoid provoking compilers that do
not support this attribute.

Adds a macro named CPP_ATTRIBUTE_FALLTHROUGH which is invoked right
before a following case statement to declare that the intent is to
fall through.  Example:

    ...
    case xxx:
       ...
       CPP_ATTRIBUTE_FALLTHROUGH;
    case yyy:
    ...

The gcc/clang alternative of adding comments that contain "FALLTHROUGH"
suffers from the problem that *by default* ccache strips the comments
so that they are not present for the real compilation.

Change-Id: I77ddeb7dae46db8398b014a93f6a71bedc64ada9
Signed-off-by: Dale Stimson <dale.b.stimson@intel.com>
2018-02-14 07:08:00 -08:00
mplewka 94c996a452 Provide hint when create zero copy image
Change-Id: I526a81e0d14daba98574575e8c945214b0bda810
2018-02-14 12:56:04 +01:00
Dunajski, Bartosz 4f2a05ac88 Map/unmap enqueue fixes [2/n]: CPU operations on limited range
- Curently each non-zerocopy CPU operation on map/unmap make a full copy
  using hostPtr
- This commit adds functionality to select specific range of copy
- Multiple mapping with different size is not supported yet,
  so copy will be made on full range for now. This is for future usage.

Change-Id: I7652e85482ba6fffb2474169447baf9b080dcd1e
2018-02-13 16:29:01 +01:00
mplewka 21c1dce943 Enable zero copy for enqueueImage r/w with hints
Change-Id: I6d4379b4bebaca162f859ea790f6a77475f7e94e
2018-02-06 19:00:15 +01:00
Dunajski, Bartosz 844f956244 Remove redundant/recursive checks in unmap operations
- Some of the paths were made only for ULTs
- Params like mappedPtr were ignored
- Improve confusing method names
- Fix for memory leak in map shared buffer path (not tested code)

Change-Id: I8a69035f1d1c340f2d131a6f8d7e13116e3ddabc
2018-02-02 10:36:09 +01:00
Jacek Danecki 73e2e72d07 waSamplerCacheFlushBetweenRedescribedSurfaceReads fix
Change-Id: Id322f58ce6997c8710ed2d8faf4f3c3f3d2ef0c3
2018-02-01 15:37:18 +01:00
Dunajski, Bartosz 8974af4de8 SNORM formats support
Change-Id: I4138a3e96788aab2a8f3af108dcbfa6f81006bf9
2018-02-01 11:18:01 +01:00
Dale Stimson a3a21d8168 runtime/mem_obj/image.cpp - Avoid warning from switch case fallthrough
For the new Linux/Fedora configuration with introduction of gcc 7.2,
option -Wimplicit-fallthrough is implemented.  This option requests a
warning if a switch case falls through into the next case.  This was
causing build errors.

For C++17 (and g++ 7 regardless), standard attribute [[fallthrough]]
notifies the compiler that the fallthrough is intentional.
For clang++ 5 (with -std=c++11 or later) and g++ 7, built-in
preprocessor function __has_cpp_attribute(fallthrough) returns true.
Currently, msvc does not have __has_cpp_attribute.

Note: The use of __has_cpp_attribute has been proposed for c++2x and
is advocated by (81-char link broken in two to avoid 80 char hard limit):
    https://isocpp.org/std/standing-documents/
    sd-6-sg10-feature-test-recommendations

For gcc 7, a comment consisting of "FALLTHROUGH" will accomplish the
same thing with -Wimplicit-fallthrough=<n>, for n <= 4.

The diagnostic:

/opt/src/src/vpg-compute-neo/runtime/mem_obj/image.cpp:146:24: error:
this statement may fall through [-Werror=implicit-fallthrough=]
             imageDepth = imageDesc->image_depth;
             ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/opt/src/src/vpg-compute-neo/runtime/mem_obj/image.cpp:148:9: note: here
         case CL_MEM_OBJECT_IMAGE2D:
         ^~~~

Change-Id: I604700a23b09c8bf22baf5614700a8b76dbe4cdd
Signed-off-by: Dale Stimson <dale.b.stimson@intel.com>
2018-01-31 12:06:30 -08:00
Mateusz Jablonski 285ecbd9cb Add method to append gen specific surface state params
Add method to check if image format has alpha channel

Change-Id: I138f766c17654917b0357b1ec2250a8489738bef
2018-01-31 17:18:41 +01:00
Dunajski, Bartosz a9a24e82e5 Prefer render compression for tiled images
Change-Id: I1ae1cf9a5cfdc54ab4d889456e252cd1f9860883
2018-01-17 15:18:47 +01:00
Dunajski, Bartosz c939419ccc preferRenderCompression flag for GMM resources creation
Change-Id: I718fa21d0feb825e0a3215408c78fa49d094a15f
2018-01-12 11:01:57 +01:00
Brandon Fliflet 7e9ad41290 Initial commit
Change-Id: I4bf1707bd3dfeadf2c17b0a7daff372b1925ebbd
2017-12-21 00:45:38 +01:00