Commit Graph

76 Commits

Author SHA1 Message Date
Mario Kleiner ef99597d95 st/dri: Support texture_from_pixmap for BGR[A/X]1010102 formats.
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2018-01-03 22:57:57 +01:00
Marek Olšák 11e25eb7f4 gallium/hud: update the HUD interface for multiple contexts
This is the boring subset of the following commit.
All new parameters are optional.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-11-25 17:16:56 +01:00
Marek Olšák 0e319ed835 gallium/hud: split hud_draw into 3 separate functions
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-11-25 17:16:56 +01:00
Michel Dänzer 7561da367b st/mesa: Initialize textures array in st_framebuffer_validate
And just reference pipe_resources to it in the validate callbacks.

Avoids pipe_resource leaks when st_framebuffer_validate ends up calling
the validate callback multiple times, e.g. when a window is resized.

v2:
* Use generic stable tag instead of Fixes: tag, since the problem could
  already happen before the commit referenced in v1 (Thomas Hellstrom)
* Use memset to initialize the array on the stack instead of allocating
  the array with os_calloc.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
2017-10-18 18:28:00 +02:00
Thomas Hellstrom d5ba75f888 st/dri2 Plumb the flush_swapbuffer functionality through to dri3
Implement the state tracker manager drawable interface flush_swapbuffer
method by plumbing it through to dri3 if available.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
2017-08-03 08:01:31 +02:00
Charmaine Lee bbc29393d3 st/mesa: create framebuffer iface hash table per st manager
With commit 5124bf9823, a framebuffer interface hash table is
created in st_gl_api_create(), which is called in
dri_init_screen_helper() for each screen. When the hash table is
overwritten with multiple calls to st_gl_api_create(), it can cause
race condition. This patch fixes the problem by creating a
framebuffer interface hash table per state tracker manager.

Fixes crash with steam.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101876
Fixes: 5124bf9823 ("st/mesa: add destroy_drawable interface")
Tested-by: Christoph Haag <haagch@frickel.club>
Reviewed-by: Brian Paul <brianp@vmware.com>
2017-07-24 14:03:28 -07:00
Charmaine Lee 5124bf9823 st/mesa: add destroy_drawable interface
With this patch, the st manager will maintain a hash table for
the active framebuffer interface objects. A destroy_drawable interface
is added to allow the state tracker to notify the st manager to remove
the associated framebuffer interface object from the hash table,
so the associated framebuffer and its resources can be deleted
at framebuffers purge time.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101829
Fixes: 147d7fb772 ("st/mesa: add a winsys buffers list in st_context")
Tested-by: Brad King <brad.king@kitware.com>
Tested-by: Gert Wollny <gw.fossdev@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2017-07-20 17:34:34 -07:00
Charmaine Lee 147d7fb772 st/mesa: add a winsys buffers list in st_context
Commit a5e733c6b5 fixes the dangling
framebuffer object by unreferencing the window system draw/read buffers
when context is released. However this can prematurely destroy the
resources associated with these window system buffers. The problem is
reproducible with Turbine Demo running with VMware driver. In this case,
the depth buffer content was lost when the context is rebound to a
drawable.

To prevent premature destroy of the resources associated with
window system buffers, this patch maintains a list of these buffers in
the context, making sure the reference counts of these buffers will not
reach zero until the associated framebuffer interface objects no
longer exist. This also helps to avoid unnecessary destruction and
re-construction of the resources associated with the framebuffer.

Fixes VMware bug 1909807.

Reviewed-by: Brian Paul <brianp@vmware.com>
2017-07-11 19:40:17 -07:00
Marek Olšák c83562ccaa gallium: implement the backend of threaded GL dispatch
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Tested-by: Mike Lothian <mike@fireburn.co.uk>
2017-03-16 14:14:19 +11:00
Marek Olšák 696c5115b9 st/dri: use local pointer to st_context_iface
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2017-03-07 08:16:39 +11:00
Marek Olšák 54272e18a6 gallium: add a pipe_context parameter to fence_finish
required by glClientWaitSync (GL 4.5 Core spec) that can optionally flush
the context

Reviewed-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2016-08-10 01:11:10 +02:00
Michel Dänzer 0491dd1deb st/dri: Don't call invalidate_resource for NULL depth/stencil buffers
Fixes crash in 4 EGL piglit tests with radeonsi.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-01-18 17:39:37 +09:00
Michel Dänzer 87c3c9acd2 st/dri: Use packed RGB formats
Fixes Gallium based DRI drivers failing to load on big endian hosts
because they can't find any matching fbconfigs.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71789
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-10-04 21:50:31 -04:00
Marek Olšák 956ebf41ac st/dri: expose sRGB visuals (v2)
v2: The fix for the darkness in Ubuntu Unity is in the hunk
    with the 4-line comment.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-07-22 23:56:00 +02:00
Park, Jeongmin 0467a52dc3 st/dri: Make depth buffer optional for postprocessing
Since only pp_jimenezmlaa uses depth buffer, we can make it optional.

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2015-02-07 12:12:00 +01:00
Eric Anholt 239db93888 gallium: Plumb the swap INVALIDATE_ANCILLARY flag through more layers.
v2: Instead of telling the driver that the window system ancillaries have
    been invalidated (when the driver doesn't know which of its buffers
    are the window system's!), introduce a method for invalidating
    specific surfaces.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2015-01-06 15:40:41 -08:00
Emil Velikov 29ca7d2c94 st/dri: merge dri/drm and dri/sw backends
Move the driver_name to dri2/drisw and remove all the SPLIT_TAGETS
mayhem. In the next step we'll unify the dri and dri-swrast targets,
completing the gallium DRI megadriver.

v2: Remove leftover st/dri Makefiles from CONFIG_FILES. Spotted by
Thomas Helland.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Clark <robclark@freedesktop.org>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-07-10 01:06:49 +01:00
Jakob Bornecrantz 80672e84cf st/dri: Move common files to common directory
27 files changed, 15 insertions(+), 15 deletions(-)
 rename src/gallium/state_trackers/dri/{ => common}/dri1_helper.c (100%)
 rename src/gallium/state_trackers/dri/{ => common}/dri1_helper.h (100%)
 rename src/gallium/state_trackers/dri/{ => common}/dri_context.c (100%)
 rename src/gallium/state_trackers/dri/{ => common}/dri_context.h (100%)
 rename src/gallium/state_trackers/dri/{ => common}/dri_drawable.c (100%)
 rename src/gallium/state_trackers/dri/{ => common}/dri_drawable.h (100%)
 rename src/gallium/state_trackers/dri/{ => common}/dri_extensions.c (100%)
 rename src/gallium/state_trackers/dri/{ => common}/dri_screen.c (100%)
 rename src/gallium/state_trackers/dri/{ => common}/dri_screen.h (100%)
 rename src/gallium/state_trackers/dri/{ => common}/dri_st_api.c (100%)
 rename src/gallium/state_trackers/dri/{ => common}/dri_st_api.h (100%)
 rename src/gallium/state_trackers/dri/{ => common}/dri_wrapper.h (100%)
2010-03-26 00:37:54 +01:00
George Sapountzis 4ce16e13ce st/dri: export DRI1 surface / pipe
They will be used by DRISW. Also, add destroy functions.
2010-03-25 17:01:53 +02:00
George Sapountzis 6a7bd8eb95 st/dri: split out DRI2 code 2010-03-25 17:01:53 +02:00
George Sapountzis 96c152b4b0 st/dri: make get_texture into validate_att
This is a wrapper around dri_st_framebuffer_validate for a single attachment.
Also, call validate through hook to make it more generic.
2010-03-25 17:01:52 +02:00
Chia-I Wu bd1ce87472 st/dri: Switch from st_public.h to st_api.h.
This is tested with demos found in progs/demos.  However, only the DRI2
path is tested.
2010-03-18 09:43:22 +08:00
Chia-I Wu 903b90926c st/dri: Headers and public symbols clean up.
Remove unused headers and stop marking driDriverAPI as PUBLIC.
2010-03-18 08:48:13 +08:00
Chia-I Wu a437bc50f2 st/dri: Move DRI1 bits in dri_drawable.c to dri1.c. 2010-03-18 08:48:13 +08:00
Chia-I Wu ca69249f25 st/dri: Move DRI1 bits in dri_screen.c to dri1.c. 2010-03-18 08:48:12 +08:00
Chia-I Wu de8a879f5c st/mesa: Implement st_api.h.
There is currently no user of this new interface.  As the inteface can
coexist with st_public.h, everthing should work as before.

ST_TEXTURE_2D is both defined by st_public.h and st_api.h.  Reorder the
headers in st/dri to avoid conflicts.
2010-03-12 09:57:07 +08:00
Keith Whitwell 3ca933623c Merge commit 'origin/gallium-winsys-handle-rebased' 2010-03-08 12:03:46 +00:00
José Fonseca c456dd5b4b dri: Rename pipe formats. 2010-03-01 18:53:31 +00:00
Jakob Bornecrantz b2e94d05c9 gallium: Expose a opaque winsys handle and functions on pipe_screen
Instead of having these functions on a side interface like on
drm_api create a opaque winsys_handle that is to be passed down
into the winsys.

Currently the only thing ported to this new interface is drm_api,
and of that only the components that builds by default is ported.
All the drivers and any extra state trackers needs to be ported
before this can go into master.
2010-03-01 16:05:24 +00:00
Vinson Lee 307071fe1e st/dri: Assert pointer is not null before dereferencing. 2010-02-27 02:01:56 -08:00
Francisco Jerez 196214bf2b Revert "st/mesa: Make the frontbuffer visible on st_flush(PIPE_FLUSH_FRAME)."
We probably don't want to propagate this condition to the pipe driver,
this reverts commit f455ca6490 and the
dri_update_buffer flush altogether until an agreement is reached.
2010-02-18 14:04:14 +01:00
Francisco Jerez 52e3f0949d st/dri2: Flush FRAME instead of RENDER_CACHE on buffer invalidation. 2010-02-17 23:15:48 +01:00
Francisco Jerez f845e4ff1b st/dri2: Use event-driven buffer validation. 2010-02-16 10:38:50 -05:00
Zack Rusin 59b4146a5d st/dri, st/xorg: fix buffers that have attachements of different depth
we actually need to specify the formats for different attachements, otherwise
if the color buffer is 24bpp and the app asks for 16bpp depth buffer than
we end up fetching the depth from the drawable which is 24bpp and end up
creating the wrong depth buffer. use the new getBuffersWithFormat extension
to pass the depth correctly.
2010-02-12 16:00:22 -05:00
Kristian Høgsberg debf00e5fc dri_interface: Introduce DRI tokens for the texBuffer texture formats
This used to take GLX tokens, but the DRI interface can't depend on GLX
defines.  We fix this by introducing DRI tokens that have the same value
as the GLX texture format tokens.
2010-02-09 15:55:25 -05:00
Dave Airlie 3584a44270 gallium: fix more missing includes from various places
nouveau/ dri st / vmware
2010-02-04 10:52:43 +10:00
Vinson Lee 4030cd5a2d st/dri: Remove unnecessary headers. 2010-01-28 00:20:22 -08:00
Brian Paul cd8614b028 Merge branch 'mesa_7_7_branch'
Conflicts:
	src/gallium/auxiliary/draw/draw_context.c
	src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c
	src/gallium/auxiliary/pipebuffer/Makefile
	src/gallium/auxiliary/pipebuffer/SConscript
	src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c
	src/gallium/auxiliary/tgsi/tgsi_scan.c
	src/gallium/drivers/i915/i915_surface.c
	src/gallium/drivers/i915/i915_texture.c
	src/gallium/drivers/llvmpipe/lp_setup.c
	src/gallium/drivers/llvmpipe/lp_tex_sample_c.c
	src/gallium/drivers/llvmpipe/lp_texture.c
	src/gallium/drivers/softpipe/sp_prim_vbuf.c
	src/gallium/state_trackers/xorg/xorg_dri2.c
	src/gallium/winsys/drm/intel/gem/intel_drm_api.c
	src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c
	src/gallium/winsys/drm/radeon/core/radeon_drm.c
	src/gallium/winsys/drm/vmware/core/vmw_screen_dri.c
	src/mesa/state_tracker/st_cb_clear.c
2010-01-22 12:17:02 -07:00
Ben Skeggs 116a02be22 st/dri: update dri2 drawables when viewport is changed
Fixes gnome-shell on nouveau, as well as window resize with various
other applications.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-01-19 17:06:22 +01:00
Vinson Lee f8db32acbd st/dri: Add comment for intentional fallthrough in case statement. 2010-01-18 18:14:03 -08:00
Thomas Hellstrom 5f2d60a715 st/dri: Don't request a fake front if the server adds one automatically.
We use the presence of the getBuffersWithFormat extension function to
detect whether the server automatically adds a front.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-01-18 13:39:25 +01:00
Jakob Bornecrantz b01ffb12ed Merge branch 'mesa_7_7_branch'
Conflicts:
	src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c
	src/gallium/auxiliary/util/Makefile
	src/gallium/drivers/r300/r300_state_derived.c
2010-01-14 22:31:04 +00:00
Thomas Hellstrom a9086f2d17 st/dri: Make sure we always request a fake front.
This should be the correct, but sub-optimal way to handle things on
pre-1.7 servers. For servers that automatically adds a fake front
we should never request the fake front and handle the reply differently.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-01-13 17:45:21 +01:00
Ben Skeggs 32da02f7c1 st/dri: update dri2 drawables when viewport is changed
Fixes gnome-shell on nouveau, as well as window resize with various
other applications.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-01-11 11:44:38 +10:00
Thomas Hellstrom cb51f02678 Revert "st/dri: no need to request fake front buffer, only handle it being returned"
This reverts commit 1336989ec6.

The commit breaks frontbuffer rendering and the possibility to do
on-demand frontbuffer requests on all Xservers prior to 1.7.

The commit should be conditioned on a dri2 version check.
I've submitted a patch to Xserver to bump dri2 minor, and it's acked by Ian.

To be able to check the version from within the state tracker, we will
probably need another dri2 extension function that returns the server
version. The protocol has support for it.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2010-01-11 21:36:51 +01:00
Kristian Høgsberg d61f07318c Remove leftover __DRI{screen,drawable,context}Private references
As part of the DRI driver interface rewrite I merged __DRIscreenPrivate
and __DRIscreen, and likewise for __DRIdrawablePrivate and
__DRIcontextPrivate.  I left typedefs in place though, to avoid renaming
all the *Private use internal to the driver.  That was probably a
mistake, and it turns out a one-line find+sed combo can do the mass
rename.  Better late than never.
2010-01-04 11:48:00 -05:00
Michal Krol 16c6dce013 Merge branch 'master' into pipe-format-simplify
Conflicts:
	src/gallium/auxiliary/draw/draw_pipe_aaline.c
	src/gallium/auxiliary/draw/draw_pipe_pstipple.c
	src/gallium/auxiliary/util/u_blit.c
	src/gallium/auxiliary/util/u_gen_mipmap.c
	src/gallium/auxiliary/util/u_surface.c
	src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c
	src/gallium/drivers/cell/ppu/cell_texture.c
	src/gallium/drivers/llvmpipe/lp_texture.c
	src/gallium/drivers/r300/r300_emit.c
	src/gallium/drivers/r300/r300_texture.c
	src/gallium/drivers/softpipe/sp_texture.c
	src/gallium/drivers/softpipe/sp_tile_cache.c
	src/gallium/drivers/svga/svga_state_vs.c
	src/gallium/include/pipe/p_format.h
	src/gallium/state_trackers/dri/dri_drawable.c
	src/gallium/state_trackers/egl/egl_surface.c
	src/gallium/state_trackers/python/p_device.i
	src/gallium/state_trackers/python/st_softpipe_winsys.c
	src/gallium/state_trackers/vega/api_filters.c
	src/gallium/state_trackers/vega/image.c
	src/gallium/state_trackers/vega/mask.c
	src/gallium/state_trackers/vega/paint.c
	src/gallium/state_trackers/vega/renderer.c
	src/gallium/state_trackers/vega/vg_tracker.c
	src/gallium/state_trackers/xorg/xorg_crtc.c
	src/gallium/state_trackers/xorg/xorg_dri2.c
	src/gallium/state_trackers/xorg/xorg_exa.c
	src/gallium/state_trackers/xorg/xorg_renderer.c
	src/gallium/state_trackers/xorg/xorg_xv.c
	src/gallium/state_trackers/xorg/xvmc/surface.c
	src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c
	src/gallium/winsys/drm/radeon/core/radeon_buffer.c
	src/gallium/winsys/egl_xlib/sw_winsys.c
	src/gallium/winsys/g3dvl/xlib/xsp_winsys.c
	src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c
	src/gallium/winsys/gdi/gdi_softpipe_winsys.c
	src/gallium/winsys/xlib/xlib_cell.c
	src/gallium/winsys/xlib/xlib_llvmpipe.c
	src/gallium/winsys/xlib/xlib_softpipe.c
	src/mesa/state_tracker/st_cb_fbo.c
	src/mesa/state_tracker/st_cb_texture.c
	src/mesa/state_tracker/st_texture.c
2009-12-17 22:37:15 +01:00
Michal Krol 6df42d8023 Move pf_get_block() to u_format auxiliary module. 2009-12-03 10:52:47 +01:00
Roland Scheidegger decf6ed810 fixups for interface changes (mostly state trackers) 2009-11-30 23:02:49 +01:00
Roland Scheidegger d509f84543 gallium: fix more statetrackers/drivers for not using texture width/height/depth arrays 2009-11-26 22:51:45 +01:00