From 4f4df208a9f00771f88abeb9f36b636f09ed3437 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Thu, 8 Jan 2015 02:12:38 +0100 Subject: [PATCH] patchupdate.py: Fix issue when detecting dependencies, make wined3d-CSMT_Main depend on wined3d-Color_Key. --- debian/tools/patchupdate.py | 26 ++++-- patches/patchinstall.sh | 90 ++++++++++--------- ...ontext-to-surface_load_drawable-and-.patch | 24 ++--- ...d3d-Remove-surface_validate_location.patch | 16 ++-- .../wined3d-CSMT_Main/9999-IfDefined.patch | 4 +- patches/wined3d-CSMT_Main/definition | 1 + 6 files changed, 87 insertions(+), 74 deletions(-) diff --git a/debian/tools/patchupdate.py b/debian/tools/patchupdate.py index a64238f7..83c70367 100755 --- a/debian/tools/patchupdate.py +++ b/debian/tools/patchupdate.py @@ -474,16 +474,24 @@ def generate_script(all_patches): for k, bitstring in enumerate(itertools.product([0,1], repeat=len(indices))): progress.update(k) - to_apply = [i for u, i in zip(bitstring, indices) if u] - applied = set() - for i, patch in [(i, all_patches[i]) for i in to_apply]: - if not applied.issuperset(patch.depends): + set_apply = [(i, all_patches[i]) for u, i in zip(bitstring, indices) if u] + set_skip = [(i, all_patches[i]) for u, i in zip(bitstring, indices) if not u] + test_apply = True + + # Check if there is any patch2 which depends directly or indirectly on patch1. + # If this is the case we found an impossible situation, we can be skipped in this test. + for i, patch1 in set_apply: + for j, patch2 in set_skip: + if causal_time_smaller(patch2.verify_time, patch1.verify_time): + test_apply = False + break + if not test_apply: break - applied.add(i) - else: + + if test_apply: try: original = original_content - for i, patch in [(i, all_patches[i]) for i in to_apply]: + for i, patch in set_apply: original = patchutils.apply_patch(original, selected_patches[i][1], fuzz=0) except patchutils.PatchApplyError: progress.finish("") @@ -495,7 +503,7 @@ def generate_script(all_patches): lines.append("# Enable or disable all patchsets\n") lines.append("patch_enable_all ()\n") lines.append("{\n") - for i, patch in [(i, all_patches[i]) for i in resolved]: + for i, patch in sorted([(i, all_patches[i]) for i in resolved], key=lambda x:x[1].name): patch.variable = "enable_%s" % patch.name.replace("-","_") lines.append("\t%s=\"$1\"\n" % patch.variable) lines.append("}\n") @@ -504,7 +512,7 @@ def generate_script(all_patches): lines.append("patch_enable ()\n") lines.append("{\n") lines.append("\tcase \"$1\" in\n") - for i, patch in [(i, all_patches[i]) for i in resolved]: + for i, patch in sorted([(i, all_patches[i]) for i in resolved], key=lambda x:x[1].name): lines.append("\t\t%s)\n" % patch.name) lines.append("\t\t\t%s=\"$2\"\n" % patch.variable) lines.append("\t\t\t;;\n") diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 351f7281..649c0252 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -52,8 +52,6 @@ abort() # Enable or disable all patchsets patch_enable_all () { - enable_ws2_32_WriteWatches="$1" - enable_ntdll_WRITECOPY="$1" enable_Exagear="$1" enable_Miscellaneous="$1" enable_Pipelight="$1" @@ -64,7 +62,6 @@ patch_enable_all () enable_d3d9_Surface_Refcount="$1" enable_d3dx9_36_ConvertToIndexedBlended="$1" enable_d3dx9_36_D3DXStubs="$1" - enable_wined3d_DXTn="$1" enable_d3dx9_36_DXTn="$1" enable_d3dx9_36_DrawText="$1" enable_d3dx9_36_Filter_Warnings="$1" @@ -121,24 +118,25 @@ patch_enable_all () enable_ntdll_RtlIpv4StringToAddressExA="$1" enable_ntdll_ThreadTime="$1" enable_ntdll_User_Shared_Data="$1" + enable_ntdll_WRITECOPY="$1" enable_ntdll_WinSqm="$1" enable_ntoskrnl_Emulator="$1" enable_ntoskrnl_Irp_Status="$1" enable_ntoskrnl_Stub_FileObject="$1" - enable_nvcuda_CUDA_Support="$1" enable_nvapi_Stub_DLL="$1" + enable_nvcuda_CUDA_Support="$1" enable_nvcuvid_CUDA_Video_Support="$1" enable_ole32_CoWaitForMultipleHandles="$1" enable_quartz_MediaSeeking_Positions="$1" enable_riched20_IText_Interface="$1" enable_secur32_Schannel_ContextAttr="$1" - enable_server_Stored_ACLs="$1" - enable_server_Inherited_ACLs="$1" enable_server_ACL_Compat="$1" enable_server_Address_Change_Notification="$1" enable_server_CreateProcess_ACLs="$1" + enable_server_Inherited_ACLs="$1" enable_server_Misc_ACL="$1" enable_server_OpenProcess="$1" + enable_server_Stored_ACLs="$1" enable_server_Unexpected_Wakeup="$1" enable_setupapi_SetupPromptForDisk="$1" enable_shdocvw_ParseURLFromOutsideSource_Tests="$1" @@ -162,10 +160,11 @@ patch_enable_all () enable_user32_WndProc="$1" enable_wineboot_HKEY_DYN_DATA="$1" enable_winebuild_LinkerVersion="$1" + enable_winecfg_Staging="$1" enable_wined3d_CSMT_Helper="$1" enable_wined3d_CSMT_Main="$1" - enable_winecfg_Staging="$1" enable_wined3d_Color_Key="$1" + enable_wined3d_DXTn="$1" enable_wined3d_Revert_PixelFormat="$1" enable_winedevice_Fix_Relocation="$1" enable_winemenubuilder_Desktop_Icon_Path="$1" @@ -182,6 +181,7 @@ patch_enable_all () enable_ws2_32_Connect_Time="$1" enable_ws2_32_TransmitFile="$1" enable_ws2_32_WSARecv_Last_Error="$1" + enable_ws2_32_WriteWatches="$1" enable_ws2_32_getaddrinfo="$1" enable_wtsapi32_EnumerateProcesses="$1" } @@ -190,12 +190,6 @@ patch_enable_all () patch_enable () { case "$1" in - ws2_32-WriteWatches) - enable_ws2_32_WriteWatches="$2" - ;; - ntdll-WRITECOPY) - enable_ntdll_WRITECOPY="$2" - ;; Exagear) enable_Exagear="$2" ;; @@ -226,9 +220,6 @@ patch_enable () d3dx9_36-D3DXStubs) enable_d3dx9_36_D3DXStubs="$2" ;; - wined3d-DXTn) - enable_wined3d_DXTn="$2" - ;; d3dx9_36-DXTn) enable_d3dx9_36_DXTn="$2" ;; @@ -397,6 +388,9 @@ patch_enable () ntdll-User_Shared_Data) enable_ntdll_User_Shared_Data="$2" ;; + ntdll-WRITECOPY) + enable_ntdll_WRITECOPY="$2" + ;; ntdll-WinSqm) enable_ntdll_WinSqm="$2" ;; @@ -409,12 +403,12 @@ patch_enable () ntoskrnl-Stub_FileObject) enable_ntoskrnl_Stub_FileObject="$2" ;; - nvcuda-CUDA_Support) - enable_nvcuda_CUDA_Support="$2" - ;; nvapi-Stub_DLL) enable_nvapi_Stub_DLL="$2" ;; + nvcuda-CUDA_Support) + enable_nvcuda_CUDA_Support="$2" + ;; nvcuvid-CUDA_Video_Support) enable_nvcuvid_CUDA_Video_Support="$2" ;; @@ -430,12 +424,6 @@ patch_enable () secur32-Schannel_ContextAttr) enable_secur32_Schannel_ContextAttr="$2" ;; - server-Stored_ACLs) - enable_server_Stored_ACLs="$2" - ;; - server-Inherited_ACLs) - enable_server_Inherited_ACLs="$2" - ;; server-ACL_Compat) enable_server_ACL_Compat="$2" ;; @@ -445,12 +433,18 @@ patch_enable () server-CreateProcess_ACLs) enable_server_CreateProcess_ACLs="$2" ;; + server-Inherited_ACLs) + enable_server_Inherited_ACLs="$2" + ;; server-Misc_ACL) enable_server_Misc_ACL="$2" ;; server-OpenProcess) enable_server_OpenProcess="$2" ;; + server-Stored_ACLs) + enable_server_Stored_ACLs="$2" + ;; server-Unexpected_Wakeup) enable_server_Unexpected_Wakeup="$2" ;; @@ -520,18 +514,21 @@ patch_enable () winebuild-LinkerVersion) enable_winebuild_LinkerVersion="$2" ;; + winecfg-Staging) + enable_winecfg_Staging="$2" + ;; wined3d-CSMT_Helper) enable_wined3d_CSMT_Helper="$2" ;; wined3d-CSMT_Main) enable_wined3d_CSMT_Main="$2" ;; - winecfg-Staging) - enable_winecfg_Staging="$2" - ;; wined3d-Color_Key) enable_wined3d_Color_Key="$2" ;; + wined3d-DXTn) + enable_wined3d_DXTn="$2" + ;; wined3d-Revert_PixelFormat) enable_wined3d_Revert_PixelFormat="$2" ;; @@ -580,6 +577,9 @@ patch_enable () ws2_32-WSARecv_Last_Error) enable_ws2_32_WSARecv_Last_Error="$2" ;; + ws2_32-WriteWatches) + enable_ws2_32_WriteWatches="$2" + ;; ws2_32-getaddrinfo) enable_ws2_32_getaddrinfo="$2" ;; @@ -704,7 +704,11 @@ if [ "$enable_wined3d_CSMT_Main" -eq 1 ]; then if [ "$enable_wined3d_CSMT_Helper" -gt 1 ]; then abort "Patchset wined3d-CSMT_Helper disabled, but wined3d-CSMT_Main depends on that." fi + if [ "$enable_wined3d_Color_Key" -gt 1 ]; then + abort "Patchset wined3d-Color_Key disabled, but wined3d-CSMT_Main depends on that." + fi enable_wined3d_CSMT_Helper=1 + enable_wined3d_Color_Key=1 fi if [ "$enable_wined3d_CSMT_Helper" -eq 1 ]; then @@ -2665,6 +2669,21 @@ if [ "$enable_winebuild_LinkerVersion" -eq 1 ]; then ) >> "$patchlist" fi +# Patchset wined3d-Color_Key +# | +# | This patchset fixes the following Wine bugs: +# | * [#37748] Fix color key regression causing pink rectangles around text +# | +# | Modified files: +# | * dlls/wined3d/surface.c +# | +if [ "$enable_wined3d_Color_Key" -eq 1 ]; then + patch_apply wined3d-Color_Key/0001-wined3d-Use-proper-color-key-type-define-when-callin.patch + ( + echo '+ { "Christian Costa", "wined3d: Use proper color key type define when calling wined3d_texture_set_color_key.", 1 },'; + ) >> "$patchlist" +fi + # Patchset wined3d-CSMT_Helper # | # | Modified files: @@ -3064,21 +3083,6 @@ if [ "$enable_winecfg_Staging" -eq 1 ]; then ) >> "$patchlist" fi -# Patchset wined3d-Color_Key -# | -# | This patchset fixes the following Wine bugs: -# | * [#37748] Fix color key regression causing pink rectangles around text -# | -# | Modified files: -# | * dlls/wined3d/surface.c -# | -if [ "$enable_wined3d_Color_Key" -eq 1 ]; then - patch_apply wined3d-Color_Key/0001-wined3d-Use-proper-color-key-type-define-when-callin.patch - ( - echo '+ { "Christian Costa", "wined3d: Use proper color key type define when calling wined3d_texture_set_color_key.", 1 },'; - ) >> "$patchlist" -fi - # Patchset wined3d-Revert_PixelFormat # | # | This patchset fixes the following Wine bugs: diff --git a/patches/wined3d-CSMT_Main/0003-wined3d-Pass-a-context-to-surface_load_drawable-and-.patch b/patches/wined3d-CSMT_Main/0003-wined3d-Pass-a-context-to-surface_load_drawable-and-.patch index b225c80b..4032d969 100644 --- a/patches/wined3d-CSMT_Main/0003-wined3d-Pass-a-context-to-surface_load_drawable-and-.patch +++ b/patches/wined3d-CSMT_Main/0003-wined3d-Pass-a-context-to-surface_load_drawable-and-.patch @@ -1,4 +1,4 @@ -From da5210457d0a852e97fd20fed4b33030585b0549 Mon Sep 17 00:00:00 2001 +From b41b544254e1074c64732e641d8eaa962418a7d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Sun, 17 Nov 2013 19:34:26 +0100 Subject: wined3d: Pass a context to surface_load_drawable and @@ -9,10 +9,10 @@ Subject: wined3d: Pass a context to surface_load_drawable and 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index ef6a233..7a32f7f 100644 +index 9731368..93ea13b 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -3452,19 +3452,35 @@ void surface_translate_drawable_coords(const struct wined3d_surface *surface, HW +@@ -3597,19 +3597,35 @@ void surface_translate_drawable_coords(const struct wined3d_surface *surface, HW rect->bottom = drawable_height - rect->bottom; } @@ -49,7 +49,7 @@ index ef6a233..7a32f7f 100644 gl_info = context->gl_info; /* Make sure the surface is up-to-date. This should probably use -@@ -3517,7 +3533,12 @@ static void surface_blt_to_drawable(const struct wined3d_device *device, +@@ -3662,7 +3678,12 @@ static void surface_blt_to_drawable(const struct wined3d_device *device, && dst_surface->container->swapchain->front_buffer == dst_surface->container)) gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ @@ -63,7 +63,7 @@ index ef6a233..7a32f7f 100644 } HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const struct wined3d_color *color) -@@ -3668,6 +3689,7 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE +@@ -3813,6 +3834,7 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE /* Blit from offscreen surface to render target */ struct wined3d_color_key old_blt_key = src_surface->container->src_blt_color_key; DWORD old_color_key_flags = src_surface->container->color_key_flags; @@ -71,8 +71,8 @@ index ef6a233..7a32f7f 100644 TRACE("Blt from surface %p to rendertarget %p\n", src_surface, dst_surface); -@@ -3701,9 +3723,11 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE - wined3d_texture_set_color_key(src_surface->container, WINEDDSD_CKSRCBLT, NULL); +@@ -3846,9 +3868,11 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE + wined3d_texture_set_color_key(src_surface->container, WINEDDCKEY_SRCBLT, NULL); } - surface_blt_to_drawable(device, filter, @@ -83,8 +83,8 @@ index ef6a233..7a32f7f 100644 + context_release(context); /* Restore the color key parameters */ - wined3d_texture_set_color_key(src_surface->container, WINEDDSD_CKSRCBLT, -@@ -4066,8 +4090,9 @@ static void surface_load_sysmem(struct wined3d_surface *surface, + wined3d_texture_set_color_key(src_surface->container, WINEDDCKEY_SRCBLT, +@@ -4211,8 +4235,9 @@ static void surface_load_sysmem(struct wined3d_surface *surface, surface, wined3d_debug_location(surface->locations)); } @@ -95,7 +95,7 @@ index ef6a233..7a32f7f 100644 { RECT r; -@@ -4080,7 +4105,7 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface, +@@ -4225,7 +4250,7 @@ static HRESULT surface_load_drawable(struct wined3d_surface *surface, surface_get_rect(surface, NULL, &r); surface_load_location(surface, WINED3D_LOCATION_TEXTURE_RGB); @@ -104,7 +104,7 @@ index ef6a233..7a32f7f 100644 WINED3D_TEXF_POINT, FALSE, surface, &r, surface, &r); return WINED3D_OK; -@@ -4345,7 +4370,10 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location) +@@ -4491,7 +4516,10 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location) break; case WINED3D_LOCATION_DRAWABLE: @@ -117,5 +117,5 @@ index ef6a233..7a32f7f 100644 break; -- -2.1.3 +2.2.1 diff --git a/patches/wined3d-CSMT_Main/0012-wined3d-Remove-surface_validate_location.patch b/patches/wined3d-CSMT_Main/0012-wined3d-Remove-surface_validate_location.patch index 441b40d5..971958f9 100644 --- a/patches/wined3d-CSMT_Main/0012-wined3d-Remove-surface_validate_location.patch +++ b/patches/wined3d-CSMT_Main/0012-wined3d-Remove-surface_validate_location.patch @@ -1,4 +1,4 @@ -From c24cea315381bd5666541f3717079e3d09c02ff4 Mon Sep 17 00:00:00 2001 +From 988e5a90aab7988d0b301c438c101d9c0a04f699 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Sat, 4 Jan 2014 00:53:47 +0100 Subject: wined3d: Remove surface_validate_location. @@ -39,7 +39,7 @@ index 4ac9c3e..99f4e96 100644 } } diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 1ed3e46..f756621 100644 +index 93c93bc..d2bbd44 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -1224,7 +1224,7 @@ static void surface_unload(struct wined3d_resource *resource) @@ -97,7 +97,7 @@ index 1ed3e46..f756621 100644 } @@ -3932,7 +3932,7 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE - wined3d_texture_set_color_key(src_surface->container, WINEDDSD_CKSRCBLT, + wined3d_texture_set_color_key(src_surface->container, WINEDDCKEY_SRCBLT, (old_color_key_flags & WINEDDSD_CKSRCBLT) ? &old_blt_key : NULL); - surface_validate_location(dst_surface, dst_surface->container->resource.draw_binding); @@ -156,10 +156,10 @@ index 1ed3e46..f756621 100644 } diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c -index 4d7eb32..3b0c6b3 100644 +index 601d3ad..bdb4b67 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c -@@ -574,19 +574,19 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT +@@ -569,19 +569,19 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT /* Tell the front buffer surface that is has been modified. However, * the other locations were preserved during that, so keep the flags. * This serves to update the emulated overlay, if any. */ @@ -183,7 +183,7 @@ index 4d7eb32..3b0c6b3 100644 surface_invalidate_location(front, ~WINED3D_LOCATION_DRAWABLE); /* If the swapeffect is DISCARD, the back buffer is undefined. That means the SYSMEM * and INTEXTURE copies can keep their old content if they have any defined content. -@@ -595,7 +595,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT +@@ -590,7 +590,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT */ if (swapchain->desc.swap_effect == WINED3D_SWAP_EFFECT_FLIP) { @@ -192,7 +192,7 @@ index 4d7eb32..3b0c6b3 100644 surface_invalidate_location(back_buffer, ~back_buffer->container->resource.draw_binding); } } -@@ -870,7 +870,7 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3 +@@ -865,7 +865,7 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3 wined3d_texture_set_swapchain(swapchain->front_buffer, swapchain); if (!(device->wined3d->flags & WINED3D_NO3D)) { @@ -227,5 +227,5 @@ index 8203200..1a5cc7b 100644 GLenum target, unsigned int level, unsigned int layer, DWORD flags, struct wined3d_surface **surface) DECLSPEC_HIDDEN; -- -1.9.1 +2.2.1 diff --git a/patches/wined3d-CSMT_Main/9999-IfDefined.patch b/patches/wined3d-CSMT_Main/9999-IfDefined.patch index acf7ca23..0e4d5ad9 100644 --- a/patches/wined3d-CSMT_Main/9999-IfDefined.patch +++ b/patches/wined3d-CSMT_Main/9999-IfDefined.patch @@ -7678,7 +7678,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c TRACE("Blt from surface %p to rendertarget %p\n", src_surface, dst_surface); @@ -3603,6 +4426,7 @@ - wined3d_texture_set_color_key(src_surface->container, WINEDDSD_CKSRCBLT, NULL); + wined3d_texture_set_color_key(src_surface->container, WINEDDCKEY_SRCBLT, NULL); } +#if defined(STAGING_CSMT) @@ -7695,7 +7695,7 @@ diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c + src_surface, src_rect, dst_surface, dst_rect); + + /* Restore the color key parameters */ -+ wined3d_texture_set_color_key(src_surface->container, WINEDDSD_CKSRCBLT, ++ wined3d_texture_set_color_key(src_surface->container, WINEDDCKEY_SRCBLT, + (old_color_key_flags & WINEDDSD_CKSRCBLT) ? &old_blt_key : NULL); + + surface_validate_location(dst_surface, dst_surface->container->resource.draw_binding); diff --git a/patches/wined3d-CSMT_Main/definition b/patches/wined3d-CSMT_Main/definition index 1770a0ab..d188b099 100644 --- a/patches/wined3d-CSMT_Main/definition +++ b/patches/wined3d-CSMT_Main/definition @@ -1,3 +1,4 @@ Fixes: [11674] Support for CSMT (command stream) to increase graphic performance Depends: wined3d-CSMT_Helper +Depends: wined3d-Color_Key IfDefined: STAGING_CSMT