Commit Graph

66 Commits

Author SHA1 Message Date
Lucas Stach 3701cb9439 gallium/dri: copy image use in dup_image
Don't lose the use flags when dup'ing an image.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8106>
2021-05-19 16:54:19 +00:00
Simon Ser 23b0112ce1 gallium/dri: implement createImageWithModifiers2
This implements __DRIimageExtension version 19.

Signed-off-by: Simon Ser <contact@emersion.fr>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8106>
2021-05-19 16:54:19 +00:00
Adam Jackson b9a172c5af gallium/dri: Remove unused dri_drawable::drisw_surface
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10758>
2021-05-17 16:02:18 -04:00
Adam Jackson 291aff3fcb gallium: Remove unused st_visual::render_buffer
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10675>
2021-05-07 16:47:30 -04:00
Jason Ekstrand 91cbe8d855 gallium: Add a transcode_astc driconf option
This is similar to the transcode_etc flag in that it changes the ASTC
fallback (when present) to use DXT5 instead of RGBA8888.  This reduces
the memory footprint of the app at the expense of a bit of correctness.
Because it's not quite correct, it's hidden behind a driconf option.

Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10476>
2021-04-27 14:16:03 -05:00
Lucas Stach 07546c69b0 Revert remaining half of "gallium/dri2: Pass the resource that corresponds to the plane"
As documented in 6ec7e0d406 (gallium: document convention for get_handle
calls on multi-planar resources) it's the drivers responsibility to walk
the chain of resources for multi-planar resources. The get_handle interface
should always be called with the base resource by the frontend.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Acked-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10212>
2021-04-13 16:40:04 +00:00
Adam Jackson b5c33174a1 dri: Use __DRI_BUFFER_COUNT consistently internally
These arrays were all sized with insufficiently large magic numbers,
which is probably not a good idea.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10142>
2021-04-09 16:05:35 +00:00
Adam Jackson 84d6ee0920 mesa: Remove unused gl_config::mutableRenderBuffer
This bit is only meaningful for EGL, where we in fact derive it from
whether EGL_KHR_mutable_render_buffer is enabled and don't actually look
at the DRI attribute.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10045>
2021-04-06 12:16:17 -04:00
Adam Jackson 6d81b9c972 gallium: Remove curious st_visual::no_config
The gallium context creation API embeds storage for a whole st_visual
even if the context is to have no config. no_config was being used to
signal this, but we can just as easily check that the color format is
non-NONE.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10045>
2021-04-06 12:16:10 -04:00
Adam Jackson 4daef7ffe3 mesa: Remove redundant gl_config::sampleBuffers
This is just !!samples.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9817>
2021-03-30 20:33:51 +00:00
Kenneth Graunke 640e8cb3dc Half-revert "gallium/dri2: Pass the resource that corresponds to the plane"
This reverts the resource_get_param changes from Tomeu's commit
ab7744b280.  It breaks every single
program run on iris (such as wflinfo -a gl -p glx).

iris's I915_FORMAT_MOD_Y_TILED_CCS modifier reports two planes - one for
the main surface, and a second one for the CCS surface.  However, there
is only one underlying pipe_resource.  We only use pipe_resource::next
for modifier information when importing buffers from elsewhere; there is
no res->next for internally allocated resources created with modifiers.

resource_get_param() is not supposed to chase res->next pointers.  The
hook is intended to take the base image, and the plane, as parameters.
The driver can then walk its own data structures however it sees fit
in order to find the appropriate plane, rather than enforcing a linked
list of resources.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9847>
2021-03-25 18:24:53 -07:00
Tomeu Vizoso ab7744b280 gallium/dri2: Pass the resource that corresponds to the plane
Previously, we were calling resource_get_handle for the first plane in
the image, regardless of what plane was being requested.

v2: - Add assert (Simon)

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5442>
2021-03-25 05:48:00 +00:00
Jose Fonseca 6e6cd7d93c scons: Remove.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9720>
2021-03-20 10:38:55 +00:00
Marek Olšák 0bbae3139e st/mesa: add a driconf option to transcode ETC2 to DXTC
for performance analysis

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9357>
2021-03-17 23:33:09 +00:00
Rob Clark e6f2e8b3fc driconf: Add ignore_map_unsynchronized option
Add an option to workaround incorrect unsynchronized VBO updates in
Dead-Cells.

See: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4337
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9316>
2021-03-03 22:47:59 +00:00
Ian Romanick 7ca3e90c18 gallium/dri: Remove dri2_format_mapping::cpp
I was suspicious that some entries in dri2_format_table (in
dri_helpers.c) had this field set incorrectly.  It seemed like
DRM_FORMAT_ABGR16161616F and DRM_FORMAT_XBGR16161616F should have been 8
instead of 4.  Upon digging I found that nothing uses the field.  Fix
code by removing it.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9354>
2021-03-02 19:42:04 +00:00
Marek Olšák 35be83846e mesa: fix glPopAttrib for many texture fields
Move the fields that should be restored by glPopAttrib into the Attrib
structure, which is the only portion of texture objects that is restored
by glPopAttrib. Also moves fields that should not be restored by glPopAttrib
out of the Attrib structure.

This is based on the GL 4.6 Compatibility spec.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8181>
2021-01-30 16:23:53 -05:00
Nanley Chery b26f510978 gallium: Flush GL API resources in eglCreateImage
Some drivers need to be able to remove compression from resources before
they are handed to consumers that wouldn't understand or expect it.

Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8663>
2021-01-26 22:15:31 +00:00
Nanley Chery 0a8cc88202 gallium: Map _DRI_IMAGE_FORMAT_NONE to NULL
Many entries in the dri2_format_table have _DRI_IMAGE_FORMAT_NONE as the
dri_format. Make the result of dri2_get_mapping_by_format a tad more
well-defined by returning NULL when this format is passed into it.

Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8663>
2021-01-26 22:15:31 +00:00
cheyang 3e13c1f8df frontend/dri: fix doesn't support RGBA ordering still expose RGBA in config
Signed-off-by: cheyang <cheyang@bytedance.com>
Acked-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8553>
2021-01-19 17:10:47 +00:00
Marek Olšák 98e8dc1db8 gallium/pp: don't use cso_context to restore VBs, constbuf 0 and sampler views
These cso_context capabilities will be removed.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8180>
2021-01-15 04:01:12 -05:00
Marek Olšák 2813688f8d gallium/hud: don't use cso_context to restore VBs, constbuf 0 and sampler views
These cso_context capabilities will be removed.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8180>
2021-01-15 04:01:12 -05:00
Rob Clark f70c50b643 frontend/dri: Expose RGB[AX]_SRGB as well
platform_android prefers RGB[AX] over BGR[AX] to avoid buggyness with
older android versions.  But we need to include the corresponding SRGB
formats as well.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2888
Signed-off-by: Rob Clark <robdclark@chromium.org>
Acked-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8452>
2021-01-14 23:04:53 +00:00
James Jones 80cfc5350c gallium/dri: Use per-screen DRI extension list
Some DRI extension features are enabled/disabled
based on capabilities of the gallium pipe_screen
associated with the DRI screen. Additionally, the
list of extensions enabled also varied based on
features requested by the screen creator. However,
prior to this change the extension list and
extension definition structures within it were
global variables, meaning the last screen
initialized ended up defining the DRI capabilities
of all screens.

This change instead stores a copy of the
extensions which vary per screen, as well as a
copy of the extension list itself in the gallium
DRI screen structure, allowing them to vary per
screen.

Closes: https://gitlab.freedesktop.org/drm/nouveau/issues/9

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7175>
2021-01-05 16:11:12 +00:00
James Jones 7d4c184ff9 gallium/dri: Factor out DRI extension setup code
Share the DRI extension setup code between
dri2_init_screen and dri_kms_init_screen. There's
currently very little difference, and the sharing
will make a subsequent change to refactor this
code to use per-screen extension lists easier.

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7175>
2021-01-05 16:11:11 +00:00
Erik Faye-Lund 967ae12931 Revert "st/dri: make sure software color-buffers are linear"
This reverts commit 040a2643c0.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8115>
2020-12-16 09:25:59 +00:00
Lionel Landwerlin d21cc94201 gallium/dri2: Don't forget protected content flag
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: bd182777c8 ("egl: implement EGL_EXT_protected_surface support")
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8094>
2020-12-15 10:10:17 +00:00
David Stevens d7814d6e0c frontend/dri: plumb loader image cleanup callback
Signed-off-by: David Stevens <stevensd@chromium.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7805>
2020-12-15 06:05:27 +00:00
Jesse Natalie 9ac8f8f490 gallium: Add optional pipe_context to flush_frontbuffer
It's hooked up in all the pipe wrapper drivers, and all the
frontends except a couple places in glx/xlib.

This enables a more efficient path for drivers which use
swrast's Present, but hardware rendering (e.g. d3d12, zink).

Reviewed-by: Dave Airlie <airlied@redhat.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8045>
2020-12-14 23:31:37 +00:00
Pierre-Eric Pelloux-Prayer 34b08a298d driconf: add allow_incorrect_primitive_id option
And enable it for SPECviewperf.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7078>
2020-12-08 10:17:32 +01:00
Marek Olšák 9a8b54285d mesa: reorganize gl_texture and sampler structures for glPush/PopAttrib
Put the fields saved by glPush/PopAttrib into the sub-structure declared
as Attrib. This will make glPush/PopAttrib much faster because it will
only save and restore that structure.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
2020-12-01 11:52:11 +00:00
Pierre-Eric Pelloux-Prayer c7986febf2 gallium: update fallthrough comments
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7747>
2020-12-01 10:04:41 +01:00
Rob Clark 53f7d539cd util: Add helgrind support for simple_mtx
Annoyingly mtypes.h pulls in simple_mtx, which means we end up needing
to sprinkle a lot of idep_mesautil around.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3773
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7644>
2020-11-24 21:03:34 +00:00
James Jones 68d70fb969 gallium: Add format modifier plane count query
Rather than hard-code a list of all the format
modifiers supported by any gallium driver and the
number of aux planes they require in the dri state
tracker, add a screen proc that queries the number
of planes required for a given modifier+format
pair.

Since the only format modifiers that require
auxiliary planes currently are the iris driver's
I915_FORMAT_MOD_Y_TILED_CCS,
I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS, and
I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS, the absence
of the screen proc implies zero aux planes for all
of the screen's supported modifiers.  Hence, when
a driver does not expose the proc, derive the
number of planes directly from the format.

Signed-off-by: James Jones <jajones@nvidia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3723>
2020-11-11 10:51:37 +00:00
Lucas Stach 788f6dc857 Revert "gallium/dri: fix dri2_from_planar for multiplanar images"
It breaks some assumptions in the iris driver, leading to crashes.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Tested-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7391>
2020-11-03 10:36:33 +00:00
Dave Airlie e9724722a3 gallium: add a level parameter to resource parameter get
For lavapipe interface to llvmpipe there is a need to retrieve per-level
info, so this seems like the best interface to use for it.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6639>
2020-11-02 22:27:14 +00:00
Pierre-Eric Pelloux-Prayer 18b7cafc70 driconf: add disable_protected_content_check option
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5096>
2020-11-02 10:15:47 +01:00
Pierre-Eric Pelloux-Prayer 9b0ffa9ecd egl/dri2: implement createImageFromDmaBufs3
And refuse to import image with protected_content enabled.

We don't want a compositor to import an encrypted buffer in a image
without the ProtectedContent attribute enabled, because that will
lead to incorrect display.

Similarly, if the compositor thinks the image is encrypted, we fail
the import if the buffer is not.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5096>
2020-11-02 10:15:47 +01:00
Pierre-Eric Pelloux-Prayer bd182777c8 egl: implement EGL_EXT_protected_surface support
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5096>
2020-11-02 10:15:47 +01:00
Timothy Arceri ea83fd9124 glsl: drop NMS OpenGL workarounds
No Mans Sky dropped its OpenGL backend on April 16, 2019 in favour
of its Vulkan backend. So here we drop the old OpenGL workarounds.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7362>
2020-11-01 05:57:35 +00:00
Timothy Arceri a09717c4de glsl: add extra pp tokens workaround and enable for CoR
The CTS now tests to make sure these are not allowed. However, previously
drivers (including Mesa) would allow them to exist and just issue a
warning. Some old applications such as Champions of Regnum seem to
depend on this.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/422

Fixes: 43047384c3 ("glsl/glcpp: Promote "extra token at end of directive" from warning to error")

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7361>
2020-10-29 23:35:58 +00:00
Philipp Zabel 13859c769f gallium/dri: fix dri2_from_planar for multiplanar images
Fix the gbm_dri_bo_get_handle_for_plane use case by allowing plane > 0
in dri2_from_planar for images with multiple planes in separate chained
texture resources.

Not all multiplanar resources are chained, though. The iris aux buffer
is a separate plane in the same resource.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7028>
2020-10-29 12:40:41 +01:00
Philipp Zabel 6c118aebb1 gallium/dri: fix dri2_query_image for multiplanar images
Images with multiple planes in separate chained texture resources should
report the correct number of planes.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7028>
2020-10-29 12:33:55 +01:00
Lucas Stach 0f3594cd7b gallium/dri: allow create image for formats that only support SV or RT binding
Unconditionally requesting both bindings can lead to premature
failure to create a valid image.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7028>
2020-10-29 12:31:28 +01:00
Martin Peres 4ba255dfaa dri/DRI2ConfigQueryExtension: add support for string options
This will be useful to enable extension overriding as a drirc option.

v2 (Adam Jackson):
 - Rename from configQuerystr to configQuerys for symmetry
 - Increase the version number of the interface

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Martin Peres <martin.peres@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7212>
2020-10-22 07:47:28 +03:00
Kristian H. Kristensen 826a10255f st/mesa: Add NV12 lowering to PIPE_FORMAT_R8_G8B8_420_UNORM
Some GPUs can sample biplanar formats like NV12 natively, returning
the YUV values. Add a lowering type that uses that for sampling and
relies on existing colorspace conversions.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6693>
2020-10-08 09:37:14 +00:00
Eric Anholt 8a05d6ffc6 driconf: Make the driver's declarations be structs instead of XML.
We can generate the XML if anybody actually queries it, but this reduces
the amount of work in driver setup and means that we'll be able to support
driconf option queries on Android without libexpat.

This updates the driconf interface struct version for i965, i915, and
radeon to use the new getXml entrypoint to call the on-demand xml
generation.  Note that our loaders (egl, glx) implement the v2 function
interface and don't use .xml when that's set, and the X server doesn't use
this interface at all.

XML generation tested on iris and i965 using adriconf

Acked-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6916>
2020-10-02 23:59:52 +00:00
Vinson Lee 03e7b75c22 gallium/dri2: Move image->texture assignment after image NULL check.
Fix defect reported by Coverity Scan.

Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking image suggests that it may be
null, but it has already been dereferenced on all paths leading to
the check.

Fixes: ad609bf55a ("frontend/dri: Implement mapping individual planes.")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6807>
2020-09-25 00:47:26 +00:00
Marek Olšák 3586068557 gallium: rename pipe_transfer_usage -> pipe_map_flags
Acked-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5749>
2020-09-22 03:20:54 +00:00
Marek Olšák 22253e6b65 gallium: rename PIPE_TRANSFER_* -> PIPE_MAP_*
Acked-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5749>
2020-09-22 03:20:54 +00:00