winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
March 2022
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
1138 discussions
Start a n
N
ew thread
Francois Gouget : win32u: Make some functions static.
by Alexandre Julliard
25 Mar '22
25 Mar '22
Module: wine Branch: master Commit: af915de2126cb1d0732ab3ea9bf2e114cfe8ad56 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=af915de2126cb1d0732ab3ea…
Author: Francois Gouget <fgouget(a)free.fr> Date: Thu Mar 24 19:16:42 2022 +0100 win32u: Make some functions static. Signed-off-by: Francois Gouget <fgouget(a)free.fr> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/win32u/sysparams.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 6e6300c502b..f22f6604454 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -1347,7 +1347,7 @@ static void unlock_display_devices(void) pthread_mutex_unlock( &display_lock ); } -HDC get_display_dc(void) +static HDC get_display_dc(void) { pthread_mutex_lock( &display_dc_lock ); if (!display_dc) @@ -1365,7 +1365,7 @@ HDC get_display_dc(void) return display_dc; } -void release_display_dc( HDC hdc ) +static void release_display_dc( HDC hdc ) { pthread_mutex_unlock( &display_dc_lock ); }
1
0
0
0
Paul Gofman : wined3d: Add full dirty region at texture creation.
by Alexandre Julliard
25 Mar '22
25 Mar '22
Module: wine Branch: master Commit: 2ce72c6872d1658694753aacc1d9bc109446aca7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2ce72c6872d1658694753aac…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Fri Mar 25 14:56:40 2022 +0300 wined3d: Add full dirty region at texture creation. Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d8/tests/visual.c | 20 +++++++++++++++++--- dlls/d3d9/tests/visual.c | 20 +++++++++++++++++--- dlls/wined3d/texture.c | 12 ++++++++---- 3 files changed, 42 insertions(+), 10 deletions(-) diff --git a/dlls/d3d8/tests/visual.c b/dlls/d3d8/tests/visual.c index b7f6dd62e9c..41fc0cbf16a 100644 --- a/dlls/d3d8/tests/visual.c +++ b/dlls/d3d8/tests/visual.c @@ -5531,9 +5531,6 @@ static void add_dirty_rect_test(void) hr = IDirect3DTexture8_GetSurfaceLevel(tex_dynamic, 0, &surface_dynamic); ok(SUCCEEDED(hr), "Failed to get surface level, hr %#x.\n", hr); - fill_surface(surface_src_red, 0x00ff0000, 0); - fill_surface(surface_src_green, 0x0000ff00, 0); - hr = IDirect3DDevice8_SetVertexShader(device, D3DFVF_XYZ | D3DFVF_TEX1); ok(SUCCEEDED(hr), "Failed to set fvf, hr %#x.\n", hr); hr = IDirect3DDevice8_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1); @@ -5543,6 +5540,23 @@ static void add_dirty_rect_test(void) hr = IDirect3DDevice8_SetTextureStageState(device, 0, D3DTSS_MIPFILTER, D3DTEXF_POINT); ok(SUCCEEDED(hr), "Failed to set mip filter, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetTexture(device, 0, (IDirect3DBaseTexture8 *)tex_dst2); + ok(hr == D3D_OK, "Unexpected hr %#x.\n", hr); + hr = IDirect3DDevice8_UpdateTexture(device, (IDirect3DBaseTexture8 *)tex_src_red, + (IDirect3DBaseTexture8 *)tex_dst2); + fill_surface(surface_src_green, 0x00000080, D3DLOCK_NO_DIRTY_UPDATE); + hr = IDirect3DDevice8_UpdateTexture(device, (IDirect3DBaseTexture8 *)tex_src_green, + (IDirect3DBaseTexture8 *)tex_dst2); + ok(hr == D3D_OK, "Unexpected hr %#x.\n", hr); + add_dirty_rect_test_draw(device); + color = getPixelColor(device, 320, 240); + ok(color_match(color, 0x00000080, 1), "Unexpected colour 0x%08x.\n", color); + hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); + ok(hr == D3D_OK, "Unexpected hr %#x.\n", hr); + + fill_surface(surface_src_red, 0x00ff0000, 0); + fill_surface(surface_src_green, 0x0000ff00, 0); + hr = IDirect3DDevice8_UpdateTexture(device, (IDirect3DBaseTexture8 *)tex_src_green, (IDirect3DBaseTexture8 *)tex_dst1); ok(SUCCEEDED(hr), "Failed to update texture, hr %#x.\n", hr); diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index 89f9e9cf2c6..9f9055483b1 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -19394,9 +19394,6 @@ static void add_dirty_rect_test(void) hr = IDirect3DTexture9_GetSurfaceLevel(tex_dynamic, 0, &surface_dynamic); ok(SUCCEEDED(hr), "Failed to get surface level, hr %#x.\n", hr); - fill_surface(surface_src_red, 0x00ff0000, 0); - fill_surface(surface_src_green, 0x0000ff00, 0); - hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_TEX1); ok(SUCCEEDED(hr), "Failed to set fvf, hr %#x.\n", hr); hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1); @@ -19406,6 +19403,23 @@ static void add_dirty_rect_test(void) hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MIPFILTER, D3DTEXF_POINT); ok(SUCCEEDED(hr), "Failed to set sampler state, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetTexture(device, 0, (IDirect3DBaseTexture9 *)tex_dst2); + ok(hr == D3D_OK, "Unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_UpdateTexture(device, (IDirect3DBaseTexture9 *)tex_src_red, + (IDirect3DBaseTexture9 *)tex_dst2); + fill_surface(surface_src_green, 0x00000080, D3DLOCK_NO_DIRTY_UPDATE); + hr = IDirect3DDevice9_UpdateTexture(device, (IDirect3DBaseTexture9 *)tex_src_green, + (IDirect3DBaseTexture9 *)tex_dst2); + ok(hr == D3D_OK, "Unexpected hr %#x.\n", hr); + add_dirty_rect_test_draw(device); + color = getPixelColor(device, 320, 240); + ok(color_match(color, 0x00000080, 1), "Unexpected colour 0x%08x.\n", color); + hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); + ok(hr == D3D_OK, "Unexpected hr %#x.\n", hr); + + fill_surface(surface_src_red, 0x00ff0000, 0); + fill_surface(surface_src_green, 0x0000ff00, 0); + hr = IDirect3DDevice9_UpdateTexture(device, (IDirect3DBaseTexture9 *)tex_src_green, (IDirect3DBaseTexture9 *)tex_dst1); ok(SUCCEEDED(hr), "Failed to update texture, hr %#x.\n", hr); diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index ebe770af0d2..c495de171d5 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -3895,11 +3895,15 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc texture->flags |= WINED3D_TEXTURE_GENERATE_MIPMAPS; } - if (flags & WINED3D_TEXTURE_CREATE_RECORD_DIRTY_REGIONS - && !(texture->dirty_regions = heap_calloc(texture->layer_count, sizeof(*texture->dirty_regions)))) + if (flags & WINED3D_TEXTURE_CREATE_RECORD_DIRTY_REGIONS) { - wined3d_texture_cleanup_sync(texture); - return E_OUTOFMEMORY; + if (!(texture->dirty_regions = heap_calloc(texture->layer_count, sizeof(*texture->dirty_regions)))) + { + wined3d_texture_cleanup_sync(texture); + return E_OUTOFMEMORY; + } + for (i = 0; i < texture->layer_count; ++i) + wined3d_texture_dirty_region_add(texture, i, NULL); } /* Precalculated scaling for 'faked' non power of two texture coords. */
1
0
0
0
Jan Sikorski : wined3d: Reuse deferred uploads heaps.
by Alexandre Julliard
25 Mar '22
25 Mar '22
Module: wine Branch: master Commit: eae36aab813a8627cb250d57a5bef0cf25bfb85c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=eae36aab813a8627cb250d57…
Author: Jan Sikorski <jsikorski(a)codeweavers.com> Date: Fri Mar 25 12:31:09 2022 +0100 wined3d: Reuse deferred uploads heaps. Avoids needing to fault-in the memory on each recording. Signed-off-by: Jan Sikorski <jsikorski(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/cs.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 46 insertions(+), 9 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index 63d6ed4c123..cf7debe4256 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -49,13 +49,15 @@ struct wined3d_command_list SIZE_T data_size; void *data; - HANDLE upload_heap; SIZE_T resource_count; struct wined3d_resource **resources; SIZE_T upload_count; struct wined3d_deferred_upload *uploads; + HANDLE upload_heap; + LONG *upload_heap_refcount; + /* List of command lists queued for execution on this command list. We might * be the only thing holding a pointer to another command list, so we need * to hold a reference here (and in wined3d_deferred_context) as well. */ @@ -3960,7 +3962,6 @@ static void wined3d_cs_packet_incref_objects(struct wined3d_cs_packet *packet) struct wined3d_deferred_context { struct wined3d_device_context c; - HANDLE upload_heap; SIZE_T data_size, data_capacity; void *data; @@ -3971,6 +3972,9 @@ struct wined3d_deferred_context SIZE_T upload_count, uploads_capacity; struct wined3d_deferred_upload *uploads; + HANDLE upload_heap; + LONG *upload_heap_refcount; + /* List of command lists queued for execution on this context. A command * list can be the only thing holding a pointer to another command list, so * we need to hold a reference here and in wined3d_command_list as well. */ @@ -4090,12 +4094,22 @@ static bool wined3d_deferred_context_map_upload_bo(struct wined3d_device_context deferred->upload_count + 1, sizeof(*deferred->uploads))) return false; - if (!deferred->upload_heap) - deferred->upload_heap = HeapCreate(HEAP_NO_SERIALIZE, 0, 0); if (!deferred->upload_heap) { - ERR("Failed to create upload heap.\n"); - return false; + if (!(deferred->upload_heap = HeapCreate(0, 0, 0))) + { + ERR("Failed to create upload heap.\n"); + return false; + } + + if (!(deferred->upload_heap_refcount = heap_alloc(sizeof(*deferred->upload_heap_refcount)))) + { + HeapDestroy(deferred->upload_heap); + deferred->upload_heap = 0; + return false; + } + + *deferred->upload_heap_refcount = 1; } if (!(sysmem = HeapAlloc(deferred->upload_heap, 0, size + RESOURCE_ALIGNMENT - 1))) @@ -4243,9 +4257,20 @@ void CDECL wined3d_deferred_context_destroy(struct wined3d_device_context *conte heap_free(deferred->resources); for (i = 0; i < deferred->upload_count; ++i) + { wined3d_resource_decref(deferred->uploads[i].resource); + HeapFree(deferred->upload_heap, 0, deferred->uploads[i].resource); + } + if (deferred->upload_heap) - HeapDestroy(deferred->upload_heap); + { + if (!InterlockedDecrement(deferred->upload_heap_refcount)) + { + HeapDestroy(deferred->upload_heap); + heap_free(deferred->upload_heap_refcount); + } + } + heap_free(deferred->uploads); for (i = 0; i < deferred->command_list_count; ++i) @@ -4331,7 +4356,8 @@ HRESULT CDECL wined3d_deferred_context_record_command_list(struct wined3d_device deferred->query_count = 0; object->upload_heap = deferred->upload_heap; - deferred->upload_heap = 0; + if ((object->upload_heap_refcount = deferred->upload_heap_refcount)) + InterlockedIncrement(object->upload_heap_refcount); /* This is in fact recorded into a subsequent command list. */ if (restore) @@ -4349,11 +4375,22 @@ HRESULT CDECL wined3d_deferred_context_record_command_list(struct wined3d_device static void wined3d_command_list_destroy_object(void *object) { struct wined3d_command_list *list = object; + unsigned int i; TRACE("list %p.\n", list); + for (i = 0; i < list->upload_count; ++i) + HeapFree(list->upload_heap, 0, list->uploads[i].sysmem); + if (list->upload_heap) - HeapDestroy(list->upload_heap); + { + if (!InterlockedDecrement(list->upload_heap_refcount)) + { + HeapDestroy(list->upload_heap); + heap_free(list->upload_heap_refcount); + } + } + heap_free(list); }
1
0
0
0
Huw Davies : winealsa: Build with msvcrt.
by Alexandre Julliard
25 Mar '22
25 Mar '22
Module: wine Branch: master Commit: 67e53fc98cd7bb49264f94c81a036577bc521b74 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=67e53fc98cd7bb49264f94c8…
Author: Huw Davies <huw(a)codeweavers.com> Date: Fri Mar 25 08:42:19 2022 +0000 winealsa: Build with msvcrt. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winealsa.drv/Makefile.in | 2 -- dlls/winealsa.drv/midi.c | 9 --------- dlls/winealsa.drv/mmdevdrv.c | 17 ++++++----------- 3 files changed, 6 insertions(+), 22 deletions(-) diff --git a/dlls/winealsa.drv/Makefile.in b/dlls/winealsa.drv/Makefile.in index 2113594fbe3..1349f6f9dab 100644 --- a/dlls/winealsa.drv/Makefile.in +++ b/dlls/winealsa.drv/Makefile.in @@ -5,8 +5,6 @@ IMPORTS = uuid ole32 advapi32 DELAYIMPORTS = winmm EXTRALIBS = $(ALSA_LIBS) $(PTHREAD_LIBS) -EXTRADLLFLAGS = -mcygwin - C_SRCS = \ alsa.c \ alsamidi.c \ diff --git a/dlls/winealsa.drv/midi.c b/dlls/winealsa.drv/midi.c index 4db38537dd0..fc2205de6f6 100644 --- a/dlls/winealsa.drv/midi.c +++ b/dlls/winealsa.drv/midi.c @@ -22,17 +22,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" - -#include <string.h> #include <stdarg.h> -#include <stdio.h> -#include <unistd.h> -#include <fcntl.h> -#include <errno.h> -#include "ntstatus.h" -#define WIN32_NO_STATUS #include "windef.h" #include "winbase.h" #include "wingdi.h" diff --git a/dlls/winealsa.drv/mmdevdrv.c b/dlls/winealsa.drv/mmdevdrv.c index 389c40b47de..7dc01940dc9 100644 --- a/dlls/winealsa.drv/mmdevdrv.c +++ b/dlls/winealsa.drv/mmdevdrv.c @@ -18,23 +18,15 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define NONAMELESSUNION #define COBJMACROS -#include "config.h" #include <stdarg.h> -#include <stdio.h> -#include <math.h> #include "windef.h" #include "winbase.h" #include "winnls.h" #include "winreg.h" -#include "wine/debug.h" -#include "wine/unicode.h" -#include "wine/list.h" -#include "wine/unixlib.h" - +#include "winternl.h" #include "propsys.h" #include "initguid.h" #include "ole2.h" @@ -44,11 +36,14 @@ #include "mmsystem.h" #include "dsound.h" -#include "initguid.h" #include "endpointvolume.h" #include "audioclient.h" #include "audiopolicy.h" +#include "wine/debug.h" +#include "wine/list.h" +#include "wine/unixlib.h" + #include "unixlib.h" WINE_DEFAULT_DEBUG_CHANNEL(alsa); @@ -371,7 +366,7 @@ HRESULT WINAPI AUDDRV_GetEndpointIDs(EDataFlow flow, WCHAR ***ids_out, GUID **gu } for(i = 0; i < params.num; i++){ - unsigned int size = (strlenW(params.endpoints[i].name) + 1) * sizeof(WCHAR); + unsigned int size = (wcslen(params.endpoints[i].name) + 1) * sizeof(WCHAR); ids[i] = HeapAlloc(GetProcessHeap(), 0, size); if(!ids[i]){ params.result = E_OUTOFMEMORY;
1
0
0
0
Huw Davies : winealsa: Move DRVM_INIT to the unixlib.
by Alexandre Julliard
25 Mar '22
25 Mar '22
Module: wine Branch: master Commit: a6211e590fd373773c5356e110dde90bddb3aa6a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a6211e590fd373773c5356e1…
Author: Huw Davies <huw(a)codeweavers.com> Date: Fri Mar 25 08:42:18 2022 +0000 winealsa: Move DRVM_INIT to the unixlib. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winealsa.drv/alsa.c | 1 - dlls/winealsa.drv/alsamidi.c | 25 ++++++++++++------------- dlls/winealsa.drv/midi.c | 27 --------------------------- dlls/winealsa.drv/unixlib.h | 7 ------- 4 files changed, 12 insertions(+), 48 deletions(-) diff --git a/dlls/winealsa.drv/alsa.c b/dlls/winealsa.drv/alsa.c index e068f6608f3..e5f755b69ed 100644 --- a/dlls/winealsa.drv/alsa.c +++ b/dlls/winealsa.drv/alsa.c @@ -2444,7 +2444,6 @@ unixlib_entry_t __wine_unix_call_funcs[] = set_event_handle, is_started, get_prop_value, - midi_init, midi_release, midi_out_message, midi_in_message, diff --git a/dlls/winealsa.drv/alsamidi.c b/dlls/winealsa.drv/alsamidi.c index 8ec646281d2..476ea383a25 100644 --- a/dlls/winealsa.drv/alsamidi.c +++ b/dlls/winealsa.drv/alsamidi.c @@ -400,27 +400,22 @@ static void port_add(snd_seq_client_info_t* cinfo, snd_seq_port_info_t* pinfo, u } } -NTSTATUS midi_init(void *args) +static UINT midi_init(void) { - struct midi_init_params *params = args; static BOOL init_done; snd_seq_client_info_t *cinfo; snd_seq_port_info_t *pinfo; snd_seq_t *seq; - if (init_done) { - *params->err = ERROR_ALREADY_INITIALIZED; - return STATUS_SUCCESS; - } + if (init_done) + return ERROR_ALREADY_INITIALIZED; TRACE("Initializing the MIDI variables.\n"); init_done = TRUE; /* try to open device */ - if (!(seq = seq_open(NULL))) { - *params->err = ERROR_OPEN_FAILED; - return STATUS_SUCCESS; - } + if (!(seq = seq_open(NULL))) + return ERROR_OPEN_FAILED; cinfo = calloc( 1, snd_seq_client_info_sizeof() ); pinfo = calloc( 1, snd_seq_port_info_sizeof() ); @@ -454,11 +449,9 @@ NTSTATUS midi_init(void *args) free( cinfo ); free( pinfo ); - *params->err = NOERROR; - TRACE("End\n"); - return STATUS_SUCCESS; + return NOERROR; } NTSTATUS midi_release(void *args) @@ -1369,6 +1362,9 @@ NTSTATUS midi_out_message(void *args) switch (params->msg) { + case DRVM_INIT: + *params->err = midi_init(); + break; case DRVM_EXIT: case DRVM_ENABLE: case DRVM_DISABLE: @@ -1424,6 +1420,9 @@ NTSTATUS midi_in_message(void *args) switch (params->msg) { + case DRVM_INIT: + *params->err = midi_init(); + break; case DRVM_EXIT: case DRVM_ENABLE: case DRVM_DISABLE: diff --git a/dlls/winealsa.drv/midi.c b/dlls/winealsa.drv/midi.c index b768517e655..4db38537dd0 100644 --- a/dlls/winealsa.drv/midi.c +++ b/dlls/winealsa.drv/midi.c @@ -59,22 +59,6 @@ static void notify_client(struct notify_context *notify) * MIDI entry points * *======================================================================*/ -/************************************************************************** - * ALSA_MidiInit [internal] - * - * Initializes the MIDI devices information variables - */ -static BOOL ALSA_MidiInit(void) -{ - struct midi_init_params params; - UINT err; - - params.err = &err; - ALSA_CALL(midi_init, ¶ms); - - return TRUE; -} - /************************************************************************** * midMessage (WINEALSA.@) */ @@ -87,11 +71,6 @@ DWORD WINAPI ALSA_midMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser, TRACE("(%04X, %04X, %08lX, %08lX, %08lX);\n", wDevID, wMsg, dwUser, dwParam1, dwParam2); - switch (wMsg) { - case DRVM_INIT: - ALSA_MidiInit(); - return 0; - } params.dev_id = wDevID; params.msg = wMsg; @@ -123,12 +102,6 @@ DWORD WINAPI ALSA_modMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser, TRACE("(%04X, %04X, %08lX, %08lX, %08lX);\n", wDevID, wMsg, dwUser, dwParam1, dwParam2); - switch (wMsg) { - case DRVM_INIT: - ALSA_MidiInit(); - return 0; - } - params.dev_id = wDevID; params.msg = wMsg; params.user = dwUser; diff --git a/dlls/winealsa.drv/unixlib.h b/dlls/winealsa.drv/unixlib.h index ad8865a0988..7d7be1e140d 100644 --- a/dlls/winealsa.drv/unixlib.h +++ b/dlls/winealsa.drv/unixlib.h @@ -207,11 +207,6 @@ struct get_prop_value_params unsigned int *buffer_size; }; -struct midi_init_params -{ - UINT *err; -}; - struct notify_context { BOOL send_notify; @@ -278,14 +273,12 @@ enum alsa_funcs alsa_set_event_handle, alsa_is_started, alsa_get_prop_value, - alsa_midi_init, alsa_midi_release, alsa_midi_out_message, alsa_midi_in_message, alsa_midi_notify_wait, }; -NTSTATUS midi_init(void *args) DECLSPEC_HIDDEN; NTSTATUS midi_release(void *args) DECLSPEC_HIDDEN; NTSTATUS midi_out_message(void *args) DECLSPEC_HIDDEN; NTSTATUS midi_in_message(void *args) DECLSPEC_HIDDEN;
1
0
0
0
Huw Davies : winealsa: Move MIDM_OPEN and MIDM_CLOSE to the unixlib.
by Alexandre Julliard
25 Mar '22
25 Mar '22
Module: wine Branch: master Commit: 33d7dd9268fda79047275f5e6bcaeeb0bd5366e4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=33d7dd9268fda79047275f5e…
Author: Huw Davies <huw(a)codeweavers.com> Date: Fri Mar 25 08:42:17 2022 +0000 winealsa: Move MIDM_OPEN and MIDM_CLOSE to the unixlib. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winealsa.drv/Makefile.in | 2 +- dlls/winealsa.drv/alsa.c | 4 - dlls/winealsa.drv/alsamidi.c | 231 ++++++++++++++++++++++++++++++---- dlls/winealsa.drv/midi.c | 287 ------------------------------------------ dlls/winealsa.drv/unixlib.h | 33 ----- 5 files changed, 206 insertions(+), 351 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=33d7dd9268fda7904727…
1
0
0
0
Huw Davies : winealsa: Use a pipe to signal the end of the record thread.
by Alexandre Julliard
25 Mar '22
25 Mar '22
Module: wine Branch: master Commit: 32746a292d6c20c749ffbc877b1fc8185abce251 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=32746a292d6c20c749ffbc87…
Author: Huw Davies <huw(a)codeweavers.com> Date: Fri Mar 25 08:42:16 2022 +0000 winealsa: Use a pipe to signal the end of the record thread. This means the thread doesn't have to wake every 250ms to test "end_thread". Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winealsa.drv/midi.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/dlls/winealsa.drv/midi.c b/dlls/winealsa.drv/midi.c index 4cc906b03ca..327d4b7b200 100644 --- a/dlls/winealsa.drv/midi.c +++ b/dlls/winealsa.drv/midi.c @@ -54,7 +54,7 @@ static int MIDM_NumDevs = 0; static int numStartedMidiIn = 0; -static int end_thread; +static int rec_cancel_pipe[2]; static HANDLE hThread; static void seq_lock(void) @@ -162,18 +162,25 @@ static DWORD WINAPI midRecThread(void *arg) struct pollfd *pollfd; int ret; - num_fds = snd_seq_poll_descriptors_count(midi_seq, POLLIN); + /* Add on one for the read end of the cancel pipe */ + num_fds = snd_seq_poll_descriptors_count(midi_seq, POLLIN) + 1; pollfd = malloc(num_fds * sizeof(struct pollfd)); - while(!end_thread) { + while(1) { + pollfd[0].fd = rec_cancel_pipe[0]; + pollfd[0].events = POLLIN; + seq_lock(); - snd_seq_poll_descriptors(midi_seq, pollfd, num_fds, POLLIN); + snd_seq_poll_descriptors(midi_seq, pollfd + 1, num_fds - 1, POLLIN); seq_unlock(); /* Check if an event is present */ - if (poll(pollfd, num_fds, 250) <= 0) + if (poll(pollfd, num_fds, -1) <= 0) continue; + if (pollfd[0].revents & POLLIN) /* cancelled */ + break; + do { snd_seq_event_t *ev; @@ -259,9 +266,11 @@ static DWORD midOpen(WORD wDevID, LPMIDIOPENDESC lpDesc, DWORD dwFlags) TRACE("Input port :%d connected %d:%d\n",port_in,MidiInDev[wDevID].addr.client,MidiInDev[wDevID].addr.port); if (numStartedMidiIn++ == 0) { - end_thread = 0; + pipe(rec_cancel_pipe); hThread = CreateThread(NULL, 0, midRecThread, midi_seq, 0, NULL); if (!hThread) { + close(rec_cancel_pipe[0]); + close(rec_cancel_pipe[1]); numStartedMidiIn = 0; WARN("Couldn't create thread for midi-in\n"); midiCloseSeq(); @@ -302,11 +311,13 @@ static DWORD midClose(WORD wDevID) } if (--numStartedMidiIn == 0) { TRACE("Stopping thread for midi-in\n"); - end_thread = 1; + write(rec_cancel_pipe[1], "x", 1); if (WaitForSingleObject(hThread, 5000) != WAIT_OBJECT_0) { WARN("Thread end not signaled, force termination\n"); TerminateThread(hThread, 0); } + close(rec_cancel_pipe[0]); + close(rec_cancel_pipe[1]); TRACE("Stopped thread for midi-in\n"); }
1
0
0
0
Huw Davies : winealsa: Allocate the pollfd array at the start.
by Alexandre Julliard
25 Mar '22
25 Mar '22
Module: wine Branch: master Commit: 048a8c3346d19076bcfd5b5ccb0e944d137e48a2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=048a8c3346d19076bcfd5b5c…
Author: Huw Davies <huw(a)codeweavers.com> Date: Fri Mar 25 08:42:15 2022 +0000 winealsa: Allocate the pollfd array at the start. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winealsa.drv/midi.c | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/dlls/winealsa.drv/midi.c b/dlls/winealsa.drv/midi.c index 8009b23ce3d..4cc906b03ca 100644 --- a/dlls/winealsa.drv/midi.c +++ b/dlls/winealsa.drv/midi.c @@ -158,33 +158,21 @@ static int midiCloseSeq(void) static DWORD WINAPI midRecThread(void *arg) { snd_seq_t *midi_seq = arg; - int npfd; - struct pollfd *pfd; + int num_fds; + struct pollfd *pollfd; int ret; - TRACE("Thread startup\n"); + num_fds = snd_seq_poll_descriptors_count(midi_seq, POLLIN); + pollfd = malloc(num_fds * sizeof(struct pollfd)); while(!end_thread) { - TRACE("Thread loop\n"); seq_lock(); - npfd = snd_seq_poll_descriptors_count(midi_seq, POLLIN); - pfd = HeapAlloc(GetProcessHeap(), 0, npfd * sizeof(struct pollfd)); - snd_seq_poll_descriptors(midi_seq, pfd, npfd, POLLIN); + snd_seq_poll_descriptors(midi_seq, pollfd, num_fds, POLLIN); seq_unlock(); /* Check if an event is present */ - if (poll(pfd, npfd, 250) <= 0) { - HeapFree(GetProcessHeap(), 0, pfd); - continue; - } - - /* Note: This definitely does not work. - * while(snd_seq_event_input_pending(midi_seq, 0) > 0) { - snd_seq_event_t* ev; - snd_seq_event_input(midi_seq, &ev); - .................... - snd_seq_free_event(ev); - }*/ + if (poll(pollfd, num_fds, 250) <= 0) + continue; do { snd_seq_event_t *ev; @@ -202,9 +190,9 @@ static DWORD WINAPI midRecThread(void *arg) ret = snd_seq_event_input_pending(midi_seq, 0); seq_unlock(); } while(ret > 0); - - HeapFree(GetProcessHeap(), 0, pfd); } + + free(pollfd); return 0; }
1
0
0
0
Huw Davies : winealsa: Introduce a helper to retrieve the time.
by Alexandre Julliard
25 Mar '22
25 Mar '22
Module: wine Branch: master Commit: be6004f895ef82e5bf7fb3bef6da212c4552cf81 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=be6004f895ef82e5bf7fb3be…
Author: Huw Davies <huw(a)codeweavers.com> Date: Fri Mar 25 08:42:14 2022 +0000 winealsa: Introduce a helper to retrieve the time. The motivation is that this will need to be called from a non-Win32 thread and so shouldn't use the Win32 API. An added benefit is that it will eliminate the 16ms jitter associated with GetTickCount(). Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winealsa.drv/alsamidi.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/dlls/winealsa.drv/alsamidi.c b/dlls/winealsa.drv/alsamidi.c index 30c46eee64d..1633268b533 100644 --- a/dlls/winealsa.drv/alsamidi.c +++ b/dlls/winealsa.drv/alsamidi.c @@ -31,6 +31,7 @@ #include <stdarg.h> #include <stdio.h> #include <pthread.h> +#include <time.h> #include <alsa/asoundlib.h> #include "ntstatus.h" @@ -104,6 +105,18 @@ static void in_buffer_unlock(void) pthread_mutex_unlock(&in_buffer_mutex); } +static uint64_t get_time_msec(void) +{ + struct timespec now = {0, 0}; + +#ifdef CLOCK_MONOTONIC_RAW + if (!clock_gettime(CLOCK_MONOTONIC_RAW, &now)) + return (uint64_t)now.tv_sec * 1000 + now.tv_nsec / 1000000; +#endif + clock_gettime(CLOCK_MONOTONIC, &now); + return (uint64_t)now.tv_sec * 1000 + now.tv_nsec / 1000000; +} + static void set_in_notify(struct notify_context *notify, struct midi_src *src, WORD dev_id, WORD msg, UINT_PTR param_1, UINT_PTR param_2) { @@ -924,7 +937,7 @@ static UINT midi_out_reset(WORD dev_id) static void handle_sysex_event(struct midi_src *src, BYTE *data, UINT len) { - UINT pos = 0, copy_len, current_time = NtGetTickCount() - src->startTime; + UINT pos = 0, copy_len, current_time = get_time_msec() - src->startTime; struct notify_context notify; MIDIHDR *hdr; @@ -957,7 +970,7 @@ static void handle_sysex_event(struct midi_src *src, BYTE *data, UINT len) static void handle_regular_event(struct midi_src *src, snd_seq_event_t *ev) { - UINT data = 0, value, current_time = NtGetTickCount() - src->startTime; + UINT data = 0, value, current_time = get_time_msec() - src->startTime; struct notify_context notify; switch (ev->type) @@ -1127,7 +1140,7 @@ static UINT midi_in_start(WORD dev_id) if (src->state == -1) return MIDIERR_NODEVICE; src->state = 1; - src->startTime = NtGetTickCount(); + src->startTime = get_time_msec(); return MMSYSERR_NOERROR; } @@ -1147,7 +1160,7 @@ static UINT midi_in_stop(WORD dev_id) static DWORD midi_in_reset(WORD dev_id, struct notify_context *notify) { - UINT cur_time = NtGetTickCount(); + UINT cur_time = get_time_msec(); UINT err = MMSYSERR_NOERROR; struct midi_src *src; MIDIHDR *hdr;
1
0
0
0
Alexandre Julliard : configure: Try to detect a C99 flag for the cross compiler.
by Alexandre Julliard
25 Mar '22
25 Mar '22
Module: wine Branch: master Commit: 0aa31b735cc18dbc643cb9ab2849223ae0e89ad6 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0aa31b735cc18dbc643cb9ab…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Mar 25 11:18:37 2022 +0100 configure: Try to detect a C99 flag for the cross compiler. Similar to what AC_PROC_CC does for the host compiler. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=52723
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- configure | 35 +++++++++++++++++++++++++++++++++++ configure.ac | 17 +++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/configure b/configure index 6a3a43a9e97..b2bec4e5b6d 100755 --- a/configure +++ b/configure @@ -10707,6 +10707,41 @@ then : CFLAGS="$CFLAGS $llvm_cflags" fi fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CROSSCC option to enable C99 features" >&5 +printf %s "checking for $CROSSCC option to enable C99 features... " >&6; } + if test ${wine_cv_crosscc_c99+y} +then : + printf %s "(cached) " >&6 +else $as_nop + wine_cv_crosscc_c99=no + for arg in '' '-std=gnu99' + do + CC="$CROSSCC $arg" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c99_program +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + wine_cv_crosscc_c99=$arg +else $as_nop + wine_cv_crosscc_c99=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + test "x$wine_cv_crosscc_c99" != xno && break + done +fi + + case "x$wine_cv_crosscc_c99" in + x) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } ;; + xno) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } ;; + x*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $wine_cv_crosscc_c99" >&5 +printf "%s\n" "$wine_cv_crosscc_c99" >&6; } + CROSSCC="$CROSSCC $wine_cv_crosscc_c99" ;; + esac + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the cross-compiler supports -fno-strict-aliasing" >&5 printf %s "checking whether the cross-compiler supports -fno-strict-aliasing... " >&6; } if test ${ac_cv_crosscflags__fno_strict_aliasing+y} diff --git a/configure.ac b/configure.ac index 5a85fce12a4..e509b232d11 100644 --- a/configure.ac +++ b/configure.ac @@ -913,6 +913,23 @@ then AC_SUBST(DELAYLOADFLAG,["-Wl,-delayload,"]) CFLAGS="$CFLAGS $llvm_cflags"]) fi + AC_MSG_CHECKING([for $CROSSCC option to enable C99 features]) + AC_CACHE_VAL([wine_cv_crosscc_c99], + [wine_cv_crosscc_c99=no + for arg in '' '-std=gnu99' + do + CC="$CROSSCC $arg" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([$ac_c_conftest_c99_program])], + [wine_cv_crosscc_c99=$arg],[wine_cv_crosscc_c99=no]) + test "x$wine_cv_crosscc_c99" != xno && break + done]) + case "x$wine_cv_crosscc_c99" in + x) AC_MSG_RESULT([none needed]) ;; + xno) AC_MSG_RESULT([unsupported]) ;; + x*) AC_MSG_RESULT([$wine_cv_crosscc_c99]) + CROSSCC="$CROSSCC $wine_cv_crosscc_c99" ;; + esac + WINE_TRY_CROSSCFLAGS([-fno-strict-aliasing]) dnl clang needs to be told to fail on unknown options WINE_TRY_CROSSCFLAGS([-Werror=unknown-warning-option],[CFLAGS="$CFLAGS -Werror=unknown-warning-option"])
1
0
0
0
← Newer
1
...
19
20
21
22
23
24
25
...
114
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
Results per page:
10
25
50
100
200