From d26ea2f474c48afa7d3c261572da5d85b7b62bd8 Mon Sep 17 00:00:00 2001 From: marha Date: Wed, 23 Apr 2014 22:41:48 +0200 Subject: fontconfig mesa xserver xkeyboard-config pixman git update 23 Apr 2014 xserver commit 99f0365b1fbdfd9238b9f5cc28491e4e6c7324f1 xkeyboard-config commit b5eb5418e5a9d76b172faadf6901bc9c83f2ddad pixman commit 5f661ee719be25c3aa0eb0d45e0db23a37e76468 fontconfig commit 81664fe54f117e4781fda5a30429b51858302e91 mesa commit fd92346c53ed32709c7b56ce58fb9c9bf43ce9a8 --- fontconfig/fc-lang/ja.orth | 4234 +------------------- mesalib/common.py | 1 + mesalib/docs/index.html | 17 + mesalib/docs/relnotes.html | 2 + mesalib/docs/relnotes/10.0.5.html | 173 + mesalib/docs/relnotes/10.1.1.html | 254 ++ mesalib/include/GL/glext.h | 82 +- mesalib/scons/gallium.py | 50 +- mesalib/src/gallium/auxiliary/util/u_debug.c | 13 +- mesalib/src/gallium/auxiliary/util/u_debug.h | 9 +- mesalib/src/glsl/ast_to_hir.cpp | 1564 ++++---- mesalib/src/glsl/builtin_functions.cpp | 20 +- mesalib/src/glsl/link_uniform_initializers.cpp | 4 +- mesalib/src/glsl/linker.cpp | 2 +- mesalib/src/glsl/lower_named_interface_blocks.cpp | 8 +- mesalib/src/glsl/opt_if_simplification.cpp | 10 +- mesalib/src/mesa/drivers/common/meta.c | 134 +- mesalib/src/mesa/drivers/common/meta.h | 14 +- mesalib/src/mesa/drivers/common/meta_blit.c | 329 +- .../src/mesa/drivers/common/meta_generate_mipmap.c | 40 +- mesalib/src/mesa/drivers/dri/common/utils.c | 7 +- mesalib/src/mesa/drivers/dri/common/utils.h | 4 +- mesalib/src/mesa/main/fbobject.c | 18 +- mesalib/src/mesa/main/formats.c | 9 + mesalib/src/mesa/main/formats.h | 3 + mesalib/src/mesa/main/getstring.c | 2 +- mesalib/src/mesa/main/glformats.c | 16 + mesalib/src/mesa/main/mtypes.h | 3 + mesalib/src/mesa/main/texgetimage.c | 5 + mesalib/src/mesa/main/teximage.c | 16 +- mesalib/src/mesa/main/texstate.c | 2 + mesalib/src/mesa/main/varray.c | 2 +- .../src/mesa/state_tracker/st_atom_framebuffer.c | 35 +- mesalib/src/mesa/state_tracker/st_extensions.c | 4 + mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 5 +- mesalib/src/mesa/state_tracker/st_texture.c | 6 +- mesalib/src/mesa/swrast/s_blit.c | 8 + pixman/pixman/pixman-arm-neon-asm.h | 20 +- pixman/pixman/pixman-arm-simd-asm.S | 370 ++ pixman/pixman/pixman-arm-simd-asm.h | 89 +- pixman/pixman/pixman-arm-simd.c | 15 + pixman/pixman/pixman-bits-image.c | 2 +- xorg-server/.gitignore | 1 + xorg-server/Xext/xres.c | 4 +- xorg-server/composite/compwindow.c | 1 + xorg-server/configure.ac | 7 +- xorg-server/dix/dixfonts.c | 2 +- xorg-server/dix/dixutils.c | 25 + xorg-server/fb/fbpict.c | 2 +- xorg-server/glamor/Makefile.am | 6 +- xorg-server/glamor/glamor.c | 25 +- xorg-server/glamor/glamor_context.h | 9 +- xorg-server/glamor/glamor_copyarea.c | 18 +- xorg-server/glamor/glamor_core.c | 11 +- xorg-server/glamor/glamor_egl.c | 61 +- xorg-server/glamor/glamor_fbo.c | 42 +- xorg-server/glamor/glamor_fill.c | 13 +- xorg-server/glamor/glamor_font.c | 7 +- xorg-server/glamor/glamor_getimage.c | 96 - xorg-server/glamor/glamor_glx.c | 26 +- xorg-server/glamor/glamor_glyphblt.c | 10 +- xorg-server/glamor/glamor_glyphs.c | 3 +- xorg-server/glamor/glamor_gradient.c | 24 +- xorg-server/glamor/glamor_image.c | 180 + xorg-server/glamor/glamor_pixmap.c | 22 +- xorg-server/glamor/glamor_points.c | 5 +- xorg-server/glamor/glamor_priv.h | 23 +- xorg-server/glamor/glamor_putimage.c | 161 - xorg-server/glamor/glamor_rects.c | 4 +- xorg-server/glamor/glamor_render.c | 64 +- xorg-server/glamor/glamor_spans.c | 10 +- xorg-server/glamor/glamor_text.c | 10 +- xorg-server/glamor/glamor_tile.c | 13 +- xorg-server/glamor/glamor_transfer.c | 6 +- xorg-server/glamor/glamor_trapezoid.c | 20 +- xorg-server/glamor/glamor_utils.h | 13 +- xorg-server/glamor/glamor_vbo.c | 17 +- xorg-server/glamor/glamor_xv.c | 7 +- xorg-server/glx/glxcmds.c | 22 +- xorg-server/glx/glxdri2.c | 124 +- xorg-server/glx/glxdriswrast.c | 10 + xorg-server/glx/glxext.c | 27 +- xorg-server/glx/glxserver.h | 1 - xorg-server/hw/dmx/config/xdmxconfig.c | 3 +- xorg-server/hw/kdrive/linux/linux.c | 7 +- xorg-server/hw/kdrive/src/kdrive.c | 9 +- xorg-server/hw/xfree86/.gitignore | 1 + xorg-server/hw/xfree86/common/compiler.h | 3 +- xorg-server/hw/xfree86/dri/dri.c | 14 +- xorg-server/hw/xfree86/dri2/dri2.c | 23 +- xorg-server/hw/xfree86/man/Makefile.am | 2 + xorg-server/hw/xfree86/man/Xorg.wrap.man | 4 +- xorg-server/hw/xfree86/man/Xwrapper.config.man | 2 +- xorg-server/hw/xfree86/modes/xf86RandR12.c | 7 +- xorg-server/hw/xfree86/shadowfb/shadow.c | 1590 +------- xorg-server/hw/xfree86/xorg-wrapper.c | 75 +- xorg-server/hw/xwayland/xwayland.c | 10 +- xorg-server/include/dix.h | 2 + xorg-server/include/opaque.h | 1 + xorg-server/os/busfault.c | 1 + xorg-server/os/connection.c | 7 +- xorg-server/os/log.c | 10 +- xorg-server/os/utils.c | 11 +- xorg-server/randr/randr.c | 2 +- xorg-server/randr/rrprovider.c | 4 +- xorg-server/randr/rrsdispatch.c | 138 + xorg-server/render/render.c | 2 +- xorg-server/test/.gitignore | 3 + xorg-server/test/Makefile.am | 8 +- xorg-server/test/signal-logging.c | 11 +- xorg-server/xfixes/region.c | 6 + xorg-server/xkb/xkmread.c | 6 +- xorg-server/xkeyboard-config/rules/base.xml.in | 2 +- xorg-server/xkeyboard-config/symbols/fi | 16 +- xorg-server/xkeyboard-config/symbols/hr | 56 +- xorg-server/xkeyboard-config/symbols/jp | 2 +- xorg-server/xkeyboard-config/symbols/keypad | 2 +- xorg-server/xkeyboard-config/symbols/me | 2 +- xorg-server/xkeyboard-config/symbols/rs | 479 ++- xorg-server/xkeyboard-config/symbols/ru | 14 +- 120 files changed, 3396 insertions(+), 7872 deletions(-) create mode 100644 mesalib/docs/relnotes/10.0.5.html create mode 100644 mesalib/docs/relnotes/10.1.1.html delete mode 100644 xorg-server/glamor/glamor_getimage.c create mode 100644 xorg-server/glamor/glamor_image.c delete mode 100644 xorg-server/glamor/glamor_putimage.c diff --git a/fontconfig/fc-lang/ja.orth b/fontconfig/fc-lang/ja.orth index e87269b85..dbc16d4d7 100644 --- a/fontconfig/fc-lang/ja.orth +++ b/fontconfig/fc-lang/ja.orth @@ -21,13 +21,14 @@ # TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR # PERFORMANCE OF THIS SOFTWARE. # -# Coverage from JIS X 0208 (1990) +# Coverage from JIS X 0208 (1997) for non kanji characters, and +# Joyo Kanji List (2010, cabinet notification of regular-use chinese characters) # 0x3000 # IDEOGRAPHIC SPACE 0x3001 # IDEOGRAPHIC COMMA 0x3002 # IDEOGRAPHIC FULL STOP 0x3005 # IDEOGRAPHIC ITERATION MARK -0x3006 # IDEOGRAPHIC CLOSING MARK +#0x3006 # IDEOGRAPHIC CLOSING MARK # not in Sawarabi Gothic 0x3007 # IDEOGRAPHIC NUMBER ZERO 0x3041 # HIRAGANA LETTER SMALL A 0x3042 # HIRAGANA LETTER A @@ -216,171 +217,88 @@ 0x4E0B # 0x4E0D # 0x4E0E # -0x4E10 # -0x4E11 # 0x4E14 # -0x4E15 # 0x4E16 # -0x4E17 # 0x4E18 # 0x4E19 # -0x4E1E # 0x4E21 # 0x4E26 # -0x4E2A # 0x4E2D # -0x4E31 # 0x4E32 # -0x4E36 # 0x4E38 # 0x4E39 # 0x4E3B # 0x4E3C # -0x4E3F # -0x4E42 # -0x4E43 # 0x4E45 # -0x4E4B # -0x4E4D # -0x4E4E # 0x4E4F # -0x4E55 # -0x4E56 # 0x4E57 # -0x4E58 # 0x4E59 # 0x4E5D # 0x4E5E # -0x4E5F # -0x4E62 # 0x4E71 # 0x4E73 # 0x4E7E # 0x4E80 # -0x4E82 # -0x4E85 # 0x4E86 # 0x4E88 # 0x4E89 # -0x4E8A # 0x4E8B # 0x4E8C # -0x4E8E # -0x4E91 # 0x4E92 # 0x4E94 # 0x4E95 # -0x4E98 # -0x4E99 # -0x4E9B # 0x4E9C # -0x4E9E # -0x4E9F # -0x4EA0 # 0x4EA1 # -0x4EA2 # 0x4EA4 # -0x4EA5 # -0x4EA6 # -0x4EA8 # 0x4EAB # 0x4EAC # 0x4EAD # -0x4EAE # -0x4EB0 # -0x4EB3 # -0x4EB6 # 0x4EBA # -0x4EC0 # 0x4EC1 # -0x4EC2 # -0x4EC4 # -0x4EC6 # -0x4EC7 # 0x4ECA # 0x4ECB # -0x4ECD # -0x4ECE # 0x4ECF # -0x4ED4 # 0x4ED5 # 0x4ED6 # -0x4ED7 # 0x4ED8 # 0x4ED9 # -0x4EDD # -0x4EDE # -0x4EDF # 0x4EE3 # 0x4EE4 # 0x4EE5 # -0x4EED # 0x4EEE # 0x4EF0 # 0x4EF2 # 0x4EF6 # -0x4EF7 # 0x4EFB # 0x4F01 # -0x4F09 # -0x4F0A # -0x4F0D # 0x4F0E # 0x4F0F # 0x4F10 # 0x4F11 # 0x4F1A # -0x4F1C # 0x4F1D # 0x4F2F # -0x4F30 # 0x4F34 # -0x4F36 # 0x4F38 # 0x4F3A # 0x4F3C # -0x4F3D # -0x4F43 # 0x4F46 # -0x4F47 # 0x4F4D # 0x4F4E # 0x4F4F # 0x4F50 # -0x4F51 # 0x4F53 # 0x4F55 # -0x4F57 # 0x4F59 # -0x4F5A # -0x4F5B # 0x4F5C # -0x4F5D # -0x4F5E # -0x4F69 # -0x4F6F # -0x4F70 # 0x4F73 # 0x4F75 # -0x4F76 # -0x4F7B # -0x4F7C # 0x4F7F # -0x4F83 # -0x4F86 # -0x4F88 # 0x4F8B # 0x4F8D # -0x4F8F # -0x4F91 # -0x4F96 # -0x4F98 # 0x4F9B # 0x4F9D # -0x4FA0 # 0x4FA1 # -0x4FAB # -0x4FAD # 0x4FAE # 0x4FAF # 0x4FB5 # @@ -388,364 +306,165 @@ 0x4FBF # 0x4FC2 # 0x4FC3 # -0x4FC4 # 0x4FCA # -0x4FCE # -0x4FD0 # -0x4FD1 # -0x4FD4 # 0x4FD7 # -0x4FD8 # -0x4FDA # -0x4FDB # 0x4FDD # -0x4FDF # 0x4FE1 # -0x4FE3 # -0x4FE4 # -0x4FE5 # 0x4FEE # -0x4FEF # 0x4FF3 # 0x4FF5 # -0x4FF6 # 0x4FF8 # 0x4FFA # -0x4FFE # -0x5005 # -0x5006 # 0x5009 # 0x500B # 0x500D # -0x500F # -0x5011 # 0x5012 # -0x5014 # -0x5016 # 0x5019 # -0x501A # 0x501F # -0x5021 # 0x5023 # 0x5024 # -0x5025 # -0x5026 # -0x5028 # -0x5029 # -0x502A # 0x502B # -0x502C # -0x502D # -0x5036 # 0x5039 # -0x5043 # -0x5047 # -0x5048 # 0x5049 # 0x504F # -0x5050 # -0x5055 # -0x5056 # -0x505A # 0x505C # 0x5065 # -0x506C # -0x5072 # 0x5074 # 0x5075 # 0x5076 # -0x5078 # 0x507D # -0x5080 # -0x5085 # 0x508D # 0x5091 # 0x5098 # 0x5099 # -0x509A # 0x50AC # -0x50AD # 0x50B2 # -0x50B3 # -0x50B4 # 0x50B5 # 0x50B7 # 0x50BE # -0x50C2 # 0x50C5 # -0x50C9 # -0x50CA # 0x50CD # 0x50CF # -0x50D1 # 0x50D5 # -0x50D6 # 0x50DA # -0x50DE # -0x50E3 # -0x50E5 # 0x50E7 # -0x50ED # -0x50EE # -0x50F5 # -0x50F9 # -0x50FB # 0x5100 # -0x5101 # -0x5102 # 0x5104 # -0x5109 # 0x5112 # -0x5114 # -0x5115 # -0x5116 # -0x5118 # -0x511A # 0x511F # -0x5121 # 0x512A # -0x5132 # -0x5137 # -0x513A # -0x513B # -0x513C # -0x513F # -0x5140 # -0x5141 # 0x5143 # 0x5144 # 0x5145 # 0x5146 # -0x5147 # 0x5148 # 0x5149 # 0x514B # -0x514C # 0x514D # -0x514E # 0x5150 # -0x5152 # -0x5154 # 0x515A # -0x515C # -0x5162 # 0x5165 # 0x5168 # -0x5169 # -0x516A # 0x516B # 0x516C # 0x516D # -0x516E # 0x5171 # 0x5175 # -0x5176 # 0x5177 # 0x5178 # 0x517C # -0x5180 # -0x5182 # 0x5185 # 0x5186 # -0x5189 # 0x518A # -0x518C # 0x518D # -0x518F # -0x5190 # -0x5191 # 0x5192 # -0x5193 # -0x5195 # -0x5196 # 0x5197 # 0x5199 # 0x51A0 # -0x51A2 # -0x51A4 # 0x51A5 # -0x51A6 # -0x51A8 # -0x51A9 # -0x51AA # -0x51AB # 0x51AC # -0x51B0 # -0x51B1 # -0x51B2 # -0x51B3 # -0x51B4 # -0x51B5 # 0x51B6 # 0x51B7 # -0x51BD # 0x51C4 # -0x51C5 # 0x51C6 # -0x51C9 # -0x51CB # -0x51CC # 0x51CD # -0x51D6 # -0x51DB # -#0x51DC # # not in kochi fonts 0x51DD # -0x51E0 # 0x51E1 # 0x51E6 # -0x51E7 # -0x51E9 # -0x51EA # -0x51ED # -0x51F0 # -0x51F1 # -0x51F5 # 0x51F6 # 0x51F8 # 0x51F9 # 0x51FA # -0x51FD # -0x51FE # 0x5200 # 0x5203 # -0x5204 # 0x5206 # 0x5207 # 0x5208 # 0x520A # -0x520B # -0x520E # 0x5211 # -0x5214 # 0x5217 # 0x521D # 0x5224 # 0x5225 # -0x5227 # 0x5229 # -0x522A # -0x522E # 0x5230 # -0x5233 # 0x5236 # 0x5237 # 0x5238 # 0x5239 # 0x523A # 0x523B # -0x5243 # -0x5244 # 0x5247 # 0x524A # -0x524B # -0x524C # 0x524D # -0x524F # -0x5254 # 0x5256 # 0x525B # -0x525E # +#0x525D # # not in sazanami gothic/mincho, DroidSansJapanese 0x5263 # 0x5264 # -0x5265 # -0x5269 # -0x526A # 0x526F # 0x5270 # -0x5271 # 0x5272 # -0x5273 # -0x5274 # 0x5275 # -0x527D # -0x527F # -0x5283 # 0x5287 # -0x5288 # -0x5289 # -0x528D # -0x5291 # -0x5292 # -0x5294 # 0x529B # 0x529F # 0x52A0 # 0x52A3 # 0x52A9 # 0x52AA # -0x52AB # -0x52AC # -0x52AD # 0x52B1 # 0x52B4 # -0x52B5 # 0x52B9 # -0x52BC # 0x52BE # -0x52C1 # 0x52C3 # 0x52C5 # 0x52C7 # 0x52C9 # -0x52CD # -0x52D2 # 0x52D5 # -0x52D7 # 0x52D8 # 0x52D9 # 0x52DD # -0x52DE # 0x52DF # -0x52E0 # 0x52E2 # -0x52E3 # 0x52E4 # -0x52E6 # 0x52E7 # 0x52F2 # -0x52F3 # -0x52F5 # -0x52F8 # -0x52F9 # -0x52FA # 0x52FE # -0x52FF # -0x5301 # 0x5302 # 0x5305 # -0x5306 # -0x5308 # -0x530D # -0x530F # -0x5310 # -0x5315 # 0x5316 # 0x5317 # -0x5319 # -0x531A # -0x531D # 0x5320 # -0x5321 # -0x5323 # -0x532A # -0x532F # -0x5331 # -0x5333 # -0x5338 # 0x5339 # 0x533A # 0x533B # 0x533F # -0x5340 # 0x5341 # 0x5343 # -0x5345 # -0x5346 # 0x5347 # 0x5348 # -0x5349 # 0x534A # -0x534D # 0x5351 # 0x5352 # 0x5353 # @@ -753,43 +472,21 @@ 0x5357 # 0x5358 # 0x535A # -0x535C # -0x535E # 0x5360 # -0x5366 # -0x5369 # -0x536E # -0x536F # 0x5370 # 0x5371 # 0x5373 # 0x5374 # 0x5375 # -0x5377 # 0x5378 # -0x537B # -0x537F # -0x5382 # 0x5384 # -0x5396 # 0x5398 # 0x539A # 0x539F # -0x53A0 # -0x53A5 # -0x53A6 # -0x53A8 # -0x53A9 # -0x53AD # -0x53AE # -0x53B0 # 0x53B3 # -0x53B6 # 0x53BB # 0x53C2 # -0x53C3 # 0x53C8 # -0x53C9 # 0x53CA # 0x53CB # 0x53CC # @@ -799,36 +496,20 @@ 0x53D6 # 0x53D7 # 0x53D9 # -0x53DB # -0x53DF # -0x53E1 # -0x53E2 # 0x53E3 # 0x53E4 # 0x53E5 # -0x53E8 # -0x53E9 # -0x53EA # 0x53EB # 0x53EC # -0x53ED # -0x53EE # 0x53EF # 0x53F0 # -0x53F1 # 0x53F2 # 0x53F3 # -0x53F6 # 0x53F7 # 0x53F8 # -0x53FA # -0x5401 # -0x5403 # 0x5404 # 0x5408 # 0x5409 # -0x540A # -0x540B # 0x540C # 0x540D # 0x540E # @@ -836,273 +517,82 @@ 0x5410 # 0x5411 # 0x541B # -0x541D # 0x541F # -0x5420 # 0x5426 # -0x5429 # 0x542B # -0x542C # -0x542D # -0x542E # -0x5436 # 0x5438 # 0x5439 # -0x543B # -0x543C # -0x543D # -0x543E # -0x5440 # 0x5442 # -0x5446 # 0x5448 # 0x5449 # 0x544A # -0x544E # -0x5451 # -0x545F # 0x5468 # 0x546A # -0x5470 # -0x5471 # 0x5473 # -0x5475 # -0x5476 # -0x5477 # -0x547B # 0x547C # 0x547D # -0x5480 # -0x5484 # -0x5486 # -0x548B # 0x548C # -0x548E # -0x548F # -0x5490 # -0x5492 # -0x54A2 # -0x54A4 # -0x54A5 # -0x54A8 # -0x54AB # -0x54AC # -0x54AF # 0x54B2 # -0x54B3 # -0x54B8 # -0x54BC # 0x54BD # -0x54BE # 0x54C0 # 0x54C1 # -0x54C2 # -0x54C4 # -0x54C7 # -0x54C8 # -0x54C9 # -0x54D8 # 0x54E1 # -0x54E2 # -0x54E5 # -0x54E6 # -0x54E8 # -0x54E9 # -0x54ED # -0x54EE # 0x54F2 # 0x54FA # -0x54FD # 0x5504 # 0x5506 # 0x5507 # -0x550F # 0x5510 # -0x5514 # -0x5516 # -0x552E # 0x552F # 0x5531 # -0x5533 # -0x5538 # -0x5539 # 0x553E # -0x5540 # -0x5544 # -0x5545 # 0x5546 # -0x554C # 0x554F # 0x5553 # -0x5556 # -0x5557 # -0x555C # -0x555D # -0x5563 # -0x557B # -0x557C # -0x557E # -0x5580 # -0x5583 # 0x5584 # -0x5587 # 0x5589 # -0x558A # -0x558B # -0x5598 # -0x5599 # 0x559A # 0x559C # 0x559D # -0x559E # -0x559F # -0x55A7 # -0x55A8 # 0x55A9 # 0x55AA # 0x55AB # -0x55AC # -0x55AE # -0x55B0 # 0x55B6 # -0x55C4 # 0x55C5 # -0x55C7 # -0x55D4 # -0x55DA # -0x55DC # -0x55DF # 0x55E3 # -0x55E4 # -0x55F7 # -0x55F9 # -0x55FD # -0x55FE # 0x5606 # -0x5609 # -0x5614 # -0x5616 # -0x5617 # -0x5618 # -0x561B # -0x5629 # -0x562F # 0x5631 # 0x5632 # -0x5634 # -0x5636 # -0x5638 # -0x5642 # -0x564C # -0x564E # -0x5650 # -0x565B # -0x5664 # 0x5668 # -0x566A # -0x566B # -0x566C # 0x5674 # -0x5678 # -0x567A # -0x5680 # -0x5686 # 0x5687 # -0x568A # -0x568F # -0x5694 # -0x56A0 # -0x56A2 # -0x56A5 # -0x56AE # -0x56B4 # -0x56B6 # -0x56BC # -0x56C0 # -0x56C1 # -0x56C2 # -0x56C3 # -0x56C8 # -0x56CE # -0x56D1 # -0x56D3 # -0x56D7 # -0x56D8 # 0x56DA # 0x56DB # 0x56DE # 0x56E0 # 0x56E3 # -0x56EE # 0x56F0 # 0x56F2 # 0x56F3 # -0x56F9 # 0x56FA # 0x56FD # -0x56FF # -0x5700 # -0x5703 # -0x5704 # -0x5708 # -0x5709 # -0x570B # -0x570D # 0x570F # 0x5712 # -0x5713 # -0x5716 # -0x5718 # -0x571C # 0x571F # -0x5726 # 0x5727 # 0x5728 # -0x572D # 0x5730 # -0x5737 # -0x5738 # -0x573B # -0x5740 # 0x5742 # 0x5747 # 0x574A # -0x574E # -0x574F # -0x5750 # 0x5751 # -0x5761 # -0x5764 # -0x5766 # -0x5769 # 0x576A # -0x577F # 0x5782 # -0x5788 # -0x5789 # 0x578B # -0x5793 # -0x57A0 # -0x57A2 # 0x57A3 # -0x57A4 # -0x57AA # -0x57B0 # -0x57B3 # -0x57C0 # -0x57C3 # -0x57C6 # 0x57CB # 0x57CE # -0x57D2 # -0x57D3 # -0x57D4 # -0x57D6 # -0x57DC # 0x57DF # -0x57E0 # -0x57E3 # -0x57F4 # 0x57F7 # 0x57F9 # 0x57FA # @@ -1111,267 +601,111 @@ 0x5802 # 0x5805 # 0x5806 # -0x580A # -0x580B # 0x5815 # -0x5819 # -0x581D # -0x5821 # 0x5824 # 0x582A # -0x582F # -0x5830 # 0x5831 # 0x5834 # -0x5835 # -0x583A # -0x583D # 0x5840 # 0x5841 # 0x584A # -0x584B # 0x5851 # -0x5852 # 0x5854 # 0x5857 # -0x5858 # -0x5859 # 0x585A # 0x585E # -0x5862 # +#0x5861 # # not in DroidSansJapanese 0x5869 # -0x586B # -0x5870 # -0x5872 # -0x5875 # -0x5879 # 0x587E # 0x5883 # -0x5885 # 0x5893 # 0x5897 # 0x589C # -0x589F # 0x58A8 # -0x58AB # -0x58AE # 0x58B3 # -0x58B8 # -0x58B9 # -0x58BA # -0x58BB # 0x58BE # 0x58C1 # -0x58C5 # 0x58C7 # 0x58CA # 0x58CC # -0x58D1 # -0x58D3 # -0x58D5 # -0x58D7 # -0x58D8 # -0x58D9 # -0x58DC # -0x58DE # -0x58DF # -0x58E4 # -0x58E5 # 0x58EB # -0x58EC # 0x58EE # -0x58EF # 0x58F0 # 0x58F1 # 0x58F2 # -0x58F7 # -0x58F9 # -0x58FA # -0x58FB # -0x58FC # -0x58FD # -0x5902 # 0x5909 # -0x590A # 0x590F # -0x5910 # 0x5915 # 0x5916 # -0x5918 # -0x5919 # 0x591A # -0x591B # 0x591C # 0x5922 # -0x5925 # 0x5927 # 0x5929 # 0x592A # 0x592B # -0x592C # -0x592D # 0x592E # 0x5931 # -0x5932 # -0x5937 # -0x5938 # -0x593E # -0x5944 # 0x5947 # 0x5948 # 0x5949 # -0x594E # 0x594F # -0x5950 # 0x5951 # 0x5954 # -0x5955 # -0x5957 # -0x5958 # -0x595A # -0x5960 # -0x5962 # 0x5965 # -0x5967 # 0x5968 # -0x5969 # 0x596A # -0x596C # 0x596E # 0x5973 # 0x5974 # -0x5978 # 0x597D # -0x5981 # 0x5982 # 0x5983 # 0x5984 # 0x598A # -0x598D # -0x5993 # 0x5996 # 0x5999 # -0x599B # -0x599D # -0x59A3 # 0x59A5 # 0x59A8 # 0x59AC # -0x59B2 # 0x59B9 # 0x59BB # -0x59BE # -0x59C6 # 0x59C9 # 0x59CB # -0x59D0 # -0x59D1 # 0x59D3 # 0x59D4 # -0x59D9 # -0x59DA # -0x59DC # -0x59E5 # -0x59E6 # -0x59E8 # -0x59EA # 0x59EB # -0x59F6 # 0x59FB # 0x59FF # 0x5A01 # -0x5A03 # -0x5A09 # -0x5A11 # 0x5A18 # -0x5A1A # -0x5A1C # -0x5A1F # 0x5A20 # -0x5A25 # -0x5A29 # 0x5A2F # -0x5A35 # -0x5A36 # -0x5A3C # -0x5A40 # -0x5A41 # 0x5A46 # -0x5A49 # 0x5A5A # -0x5A62 # 0x5A66 # -0x5A6A # -0x5A6C # 0x5A7F # 0x5A92 # -0x5A9A # 0x5A9B # -0x5ABC # -0x5ABD # -0x5ABE # 0x5AC1 # -0x5AC2 # 0x5AC9 # -0x5ACB # 0x5ACC # -0x5AD0 # -0x5AD6 # -0x5AD7 # 0x5AE1 # -0x5AE3 # -0x5AE6 # -0x5AE9 # -0x5AFA # -0x5AFB # -0x5B09 # -0x5B0B # -0x5B0C # -0x5B16 # 0x5B22 # -0x5B2A # -0x5B2C # -0x5B30 # -0x5B32 # -0x5B36 # -0x5B3E # -0x5B40 # -0x5B43 # -0x5B45 # 0x5B50 # -0x5B51 # 0x5B54 # -0x5B55 # 0x5B57 # 0x5B58 # -0x5B5A # -0x5B5B # -0x5B5C # 0x5B5D # -0x5B5F # 0x5B63 # 0x5B64 # -0x5B65 # 0x5B66 # -0x5B69 # 0x5B6B # -0x5B70 # -0x5B71 # -0x5B73 # -0x5B75 # -0x5B78 # -0x5B7A # -0x5B80 # -0x5B83 # 0x5B85 # 0x5B87 # 0x5B88 # 0x5B89 # -0x5B8B # 0x5B8C # -0x5B8D # -0x5B8F # -0x5B95 # 0x5B97 # 0x5B98 # 0x5B99 # @@ -1383,47 +717,26 @@ 0x5BA2 # 0x5BA3 # 0x5BA4 # -0x5BA5 # -0x5BA6 # 0x5BAE # 0x5BB0 # 0x5BB3 # 0x5BB4 # 0x5BB5 # 0x5BB6 # -0x5BB8 # 0x5BB9 # 0x5BBF # 0x5BC2 # -0x5BC3 # 0x5BC4 # -0x5BC5 # 0x5BC6 # -0x5BC7 # -0x5BC9 # 0x5BCC # -0x5BD0 # 0x5BD2 # -0x5BD3 # -0x5BD4 # 0x5BDB # 0x5BDD # -0x5BDE # 0x5BDF # 0x5BE1 # -0x5BE2 # -0x5BE4 # -0x5BE5 # -0x5BE6 # 0x5BE7 # -0x5BE8 # 0x5BE9 # -0x5BEB # 0x5BEE # -0x5BF0 # -0x5BF3 # -0x5BF5 # -0x5BF6 # 0x5BF8 # 0x5BFA # 0x5BFE # @@ -1431,28 +744,15 @@ 0x5C01 # 0x5C02 # 0x5C04 # -0x5C05 # 0x5C06 # -0x5C07 # -0x5C08 # 0x5C09 # 0x5C0A # 0x5C0B # -0x5C0D # 0x5C0E # 0x5C0F # 0x5C11 # -0x5C13 # -0x5C16 # 0x5C1A # -0x5C20 # -0x5C22 # -0x5C24 # -0x5C28 # -0x5C2D # 0x5C31 # -0x5C38 # -0x5C39 # 0x5C3A # 0x5C3B # 0x5C3C # @@ -1460,109 +760,31 @@ 0x5C3E # 0x5C3F # 0x5C40 # -0x5C41 # 0x5C45 # -0x5C46 # 0x5C48 # 0x5C4A # 0x5C4B # -0x5C4D # -0x5C4E # -0x5C4F # -0x5C50 # -0x5C51 # -0x5C53 # 0x5C55 # 0x5C5E # -0x5C60 # -0x5C61 # 0x5C64 # 0x5C65 # -0x5C6C # -0x5C6E # 0x5C6F # 0x5C71 # -0x5C76 # -0x5C79 # -0x5C8C # 0x5C90 # -0x5C91 # -0x5C94 # 0x5CA1 # -0x5CA8 # 0x5CA9 # -0x5CAB # 0x5CAC # -0x5CB1 # 0x5CB3 # -0x5CB6 # -0x5CB7 # 0x5CB8 # -0x5CBB # -0x5CBC # -0x5CBE # -0x5CC5 # -0x5CC7 # -0x5CD9 # 0x5CE0 # 0x5CE1 # -0x5CE8 # -0x5CE9 # -0x5CEA # -0x5CED # -0x5CEF # 0x5CF0 # 0x5CF6 # -0x5CFA # -0x5CFB # -0x5CFD # 0x5D07 # -0x5D0B # 0x5D0E # -0x5D11 # -0x5D14 # -0x5D15 # 0x5D16 # -0x5D17 # -0x5D18 # -0x5D19 # -0x5D1A # -0x5D1B # -0x5D1F # -0x5D22 # 0x5D29 # -0x5D4B # -0x5D4C # -0x5D4E # 0x5D50 # -0x5D52 # -0x5D5C # -0x5D69 # -0x5D6C # -0x5D6F # -0x5D73 # -0x5D76 # -0x5D82 # -0x5D84 # -0x5D87 # -0x5D8B # -0x5D8C # -0x5D90 # -0x5D9D # -0x5DA2 # -0x5DAC # -0x5DAE # -0x5DB7 # -0x5DBA # -0x5DBC # -0x5DBD # -0x5DC9 # -0x5DCC # -0x5DCD # -0x5DD2 # -0x5DD3 # -0x5DD6 # -0x5DDB # 0x5DDD # 0x5DDE # 0x5DE1 # @@ -1571,27 +793,14 @@ 0x5DE6 # 0x5DE7 # 0x5DE8 # -0x5DEB # 0x5DEE # 0x5DF1 # -0x5DF2 # -0x5DF3 # -0x5DF4 # -0x5DF5 # -0x5DF7 # 0x5DFB # -0x5DFD # 0x5DFE # 0x5E02 # 0x5E03 # 0x5E06 # -0x5E0B # 0x5E0C # -0x5E11 # -0x5E16 # -0x5E19 # -0x5E1A # -0x5E1B # 0x5E1D # 0x5E25 # 0x5E2B # @@ -1599,738 +808,301 @@ 0x5E2F # 0x5E30 # 0x5E33 # -0x5E36 # -0x5E37 # 0x5E38 # 0x5E3D # -0x5E40 # -0x5E43 # -0x5E44 # 0x5E45 # -0x5E47 # -0x5E4C # -0x5E4E # -0x5E54 # 0x5E55 # -0x5E57 # -0x5E5F # -0x5E61 # -0x5E62 # 0x5E63 # -0x5E64 # 0x5E72 # 0x5E73 # 0x5E74 # -0x5E75 # -0x5E76 # 0x5E78 # 0x5E79 # -0x5E7A # 0x5E7B # 0x5E7C # 0x5E7D # 0x5E7E # -0x5E7F # 0x5E81 # 0x5E83 # -0x5E84 # -0x5E87 # 0x5E8A # 0x5E8F # 0x5E95 # -0x5E96 # 0x5E97 # -0x5E9A # 0x5E9C # -0x5EA0 # 0x5EA6 # 0x5EA7 # 0x5EAB # 0x5EAD # -0x5EB5 # 0x5EB6 # 0x5EB7 # 0x5EB8 # -0x5EC1 # -0x5EC2 # 0x5EC3 # -0x5EC8 # 0x5EC9 # 0x5ECA # -0x5ECF # -0x5ED0 # -0x5ED3 # -0x5ED6 # -0x5EDA # -0x5EDB # -0x5EDD # -0x5EDF # -0x5EE0 # -0x5EE1 # -0x5EE2 # -0x5EE3 # -0x5EE8 # -0x5EE9 # -0x5EEC # -0x5EF0 # -0x5EF1 # -0x5EF3 # -0x5EF4 # 0x5EF6 # 0x5EF7 # -0x5EF8 # 0x5EFA # -0x5EFB # -0x5EFC # -0x5EFE # -0x5EFF # 0x5F01 # -0x5F03 # 0x5F04 # -0x5F09 # 0x5F0A # -0x5F0B # -0x5F0C # -0x5F0D # 0x5F0F # 0x5F10 # -0x5F11 # 0x5F13 # 0x5F14 # 0x5F15 # -0x5F16 # -0x5F17 # -0x5F18 # -0x5F1B # 0x5F1F # 0x5F25 # 0x5F26 # 0x5F27 # -0x5F29 # -0x5F2D # -0x5F2F # 0x5F31 # 0x5F35 # 0x5F37 # -0x5F38 # -0x5F3C # 0x5F3E # -0x5F41 # -0x5F48 # -0x5F4A # -0x5F4C # -0x5F4E # -0x5F51 # 0x5F53 # -0x5F56 # -0x5F57 # 0x5F59 # -0x5F5C # -0x5F5D # -0x5F61 # 0x5F62 # -0x5F66 # 0x5F69 # -0x5F6A # 0x5F6B # -0x5F6C # -0x5F6D # 0x5F70 # 0x5F71 # -0x5F73 # -0x5F77 # 0x5F79 # 0x5F7C # -0x5F7F # 0x5F80 # 0x5F81 # -0x5F82 # -0x5F83 # 0x5F84 # 0x5F85 # -0x5F87 # -0x5F88 # -0x5F8A # 0x5F8B # 0x5F8C # 0x5F90 # -0x5F91 # 0x5F92 # 0x5F93 # 0x5F97 # -0x5F98 # -0x5F99 # -0x5F9E # -0x5FA0 # 0x5FA1 # -0x5FA8 # 0x5FA9 # 0x5FAA # -0x5FAD # 0x5FAE # 0x5FB3 # 0x5FB4 # 0x5FB9 # -0x5FBC # -0x5FBD # 0x5FC3 # 0x5FC5 # 0x5FCC # 0x5FCD # -0x5FD6 # 0x5FD7 # 0x5FD8 # 0x5FD9 # 0x5FDC # -0x5FDD # 0x5FE0 # -0x5FE4 # 0x5FEB # -0x5FF0 # -0x5FF1 # 0x5FF5 # -0x5FF8 # -0x5FFB # -0x5FFD # -0x5FFF # -0x600E # -0x600F # -0x6010 # 0x6012 # -0x6015 # 0x6016 # -0x6019 # -0x601B # -0x601C # 0x601D # 0x6020 # -0x6021 # 0x6025 # -0x6026 # 0x6027 # 0x6028 # -0x6029 # 0x602A # -0x602B # -0x602F # -0x6031 # -0x603A # -0x6041 # -0x6042 # -0x6043 # -0x6046 # -0x604A # 0x604B # -0x604D # 0x6050 # 0x6052 # -0x6055 # -0x6059 # -0x605A # -0x605F # -0x6060 # -0x6062 # 0x6063 # -0x6064 # 0x6065 # 0x6068 # 0x6069 # -0x606A # -0x606B # -0x606C # 0x606D # 0x606F # -0x6070 # 0x6075 # -0x6077 # -0x6081 # -0x6083 # -0x6084 # -0x6089 # -0x608B # -0x608C # -0x608D # -0x6092 # 0x6094 # -0x6096 # -0x6097 # -0x609A # -0x609B # 0x609F # 0x60A0 # 0x60A3 # 0x60A6 # -0x60A7 # 0x60A9 # 0x60AA # 0x60B2 # -0x60B3 # -0x60B4 # -0x60B5 # -0x60B6 # -0x60B8 # 0x60BC # -0x60BD # 0x60C5 # -0x60C6 # -0x60C7 # 0x60D1 # -0x60D3 # -0x60D8 # -0x60DA # 0x60DC # -0x60DF # -0x60E0 # -0x60E1 # -0x60E3 # 0x60E7 # 0x60E8 # 0x60F0 # -0x60F1 # 0x60F3 # -0x60F4 # -0x60F6 # -0x60F7 # -0x60F9 # -0x60FA # -0x60FB # -0x6100 # 0x6101 # -0x6103 # -0x6106 # -0x6108 # 0x6109 # -0x610D # -0x610E # 0x610F # -0x6115 # 0x611A # 0x611B # 0x611F # -0x6121 # -0x6127 # -0x6128 # -0x612C # -0x6134 # -0x613C # -0x613D # -0x613E # -0x613F # -0x6142 # 0x6144 # -0x6147 # 0x6148 # -0x614A # 0x614B # 0x614C # -0x614D # 0x614E # -0x6153 # 0x6155 # -0x6158 # -0x6159 # -0x615A # -0x615D # -0x615F # 0x6162 # 0x6163 # -0x6165 # -0x6167 # 0x6168 # -0x616B # 0x616E # -0x616F # 0x6170 # -0x6171 # -0x6173 # -0x6174 # -0x6175 # 0x6176 # -0x6177 # -0x617E # 0x6182 # -0x6187 # -0x618A # 0x618E # -0x6190 # -0x6191 # -0x6194 # -0x6196 # -0x6199 # -0x619A # 0x61A4 # 0x61A7 # 0x61A9 # -0x61AB # 0x61AC # -0x61AE # 0x61B2 # 0x61B6 # -0x61BA # 0x61BE # -0x61C3 # -0x61C6 # 0x61C7 # -0x61C8 # -0x61C9 # -0x61CA # -0x61CB # -0x61CC # -0x61CD # 0x61D0 # -0x61E3 # -0x61E6 # 0x61F2 # -0x61F4 # -0x61F6 # -0x61F7 # 0x61F8 # -0x61FA # -0x61FC # -0x61FD # -0x61FE # -0x61FF # -0x6200 # -0x6208 # -0x6209 # -0x620A # -0x620C # -0x620D # -0x620E # 0x6210 # 0x6211 # 0x6212 # -0x6214 # -0x6216 # 0x621A # -0x621B # -0x621D # -0x621E # -0x621F # -0x6221 # 0x6226 # -0x622A # -0x622E # 0x622F # -0x6230 # -0x6232 # -0x6233 # 0x6234 # 0x6238 # 0x623B # 0x623F # 0x6240 # -0x6241 # 0x6247 # -0x6248 # 0x6249 # 0x624B # 0x624D # -0x624E # 0x6253 # 0x6255 # -0x6258 # -0x625B # -0x625E # -0x6260 # -0x6263 # -0x6268 # -0x626E # 0x6271 # 0x6276 # 0x6279 # -0x627C # -0x627E # 0x627F # 0x6280 # -0x6282 # -0x6283 # 0x6284 # -0x6289 # 0x628A # 0x6291 # -0x6292 # -0x6293 # -0x6294 # 0x6295 # -0x6296 # 0x6297 # 0x6298 # -0x629B # 0x629C # 0x629E # 0x62AB # -0x62AC # 0x62B1 # 0x62B5 # 0x62B9 # -0x62BB # 0x62BC # 0x62BD # -0x62C2 # 0x62C5 # -0x62C6 # -0x62C7 # -0x62C8 # 0x62C9 # -0x62CA # -0x62CC # 0x62CD # -0x62CF # 0x62D0 # -0x62D1 # 0x62D2 # 0x62D3 # -0x62D4 # -0x62D7 # 0x62D8 # 0x62D9 # 0x62DB # -0x62DC # 0x62DD # 0x62E0 # 0x62E1 # 0x62EC # 0x62ED # -0x62EE # -0x62EF # -0x62F1 # 0x62F3 # -0x62F5 # 0x62F6 # 0x62F7 # 0x62FE # -0x62FF # 0x6301 # -0x6302 # 0x6307 # -0x6308 # -0x6309 # -0x630C # 0x6311 # 0x6319 # 0x631F # -0x6327 # 0x6328 # 0x632B # 0x632F # -0x633A # -0x633D # -0x633E # 0x633F # 0x6349 # -0x634C # -0x634D # -0x634F # -0x6350 # 0x6355 # 0x6357 # 0x635C # -0x6367 # 0x6368 # -0x6369 # -0x636B # 0x636E # -0x6372 # -0x6376 # -0x6377 # -0x637A # 0x637B # -0x6380 # 0x6383 # 0x6388 # -0x6389 # 0x638C # -0x638E # -0x638F # 0x6392 # -0x6396 # 0x6398 # 0x639B # -0x639F # -0x63A0 # 0x63A1 # 0x63A2 # -0x63A3 # 0x63A5 # 0x63A7 # 0x63A8 # -0x63A9 # 0x63AA # -0x63AB # -0x63AC # 0x63B2 # -0x63B4 # -0x63B5 # -0x63BB # -0x63BE # -0x63C0 # -0x63C3 # -0x63C4 # -0x63C6 # -0x63C9 # 0x63CF # 0x63D0 # -0x63D2 # -0x63D6 # 0x63DA # 0x63DB # 0x63E1 # -0x63E3 # -0x63E9 # 0x63EE # 0x63F4 # -0x63F6 # 0x63FA # -0x6406 # 0x640D # -0x640F # -0x6413 # -0x6416 # -0x6417 # -0x641C # -0x6426 # -0x6428 # 0x642C # 0x642D # -0x6434 # -0x6436 # 0x643A # 0x643E # 0x6442 # -0x644E # 0x6458 # -0x6467 # 0x6469 # 0x646F # -0x6476 # -0x6478 # -0x647A # 0x6483 # -0x6488 # -0x6492 # -0x6493 # -0x6495 # -0x649A # -0x649E # 0x64A4 # -0x64A5 # -0x64A9 # -0x64AB # -0x64AD # 0x64AE # -0x64B0 # 0x64B2 # -0x64B9 # -0x64BB # -0x64BC # 0x64C1 # -0x64C2 # -0x64C5 # -0x64C7 # 0x64CD # -0x64D2 # -0x64D4 # -0x64D8 # -0x64DA # -0x64E0 # -0x64E1 # -0x64E2 # -0x64E3 # 0x64E6 # -0x64E7 # 0x64EC # -0x64EF # -0x64F1 # -0x64F2 # -0x64F4 # -0x64F6 # -0x64FA # -0x64FD # -0x64FE # -0x6500 # -0x6505 # -0x6518 # -0x651C # -0x651D # -0x6523 # -0x6524 # -0x652A # -0x652B # -0x652C # 0x652F # -0x6534 # -0x6535 # -0x6536 # -0x6537 # -0x6538 # 0x6539 # 0x653B # 0x653E # 0x653F # 0x6545 # -0x6548 # -0x654D # 0x654F # 0x6551 # -0x6555 # -0x6556 # 0x6557 # -0x6558 # 0x6559 # -0x655D # -0x655E # 0x6562 # 0x6563 # -0x6566 # 0x656C # 0x6570 # -0x6572 # 0x6574 # 0x6575 # 0x6577 # -0x6578 # -0x6582 # -0x6583 # 0x6587 # -0x6588 # 0x6589 # -0x658C # 0x658E # -0x6590 # 0x6591 # 0x6597 # 0x6599 # -0x659B # 0x659C # -0x659F # -0x65A1 # 0x65A4 # 0x65A5 # -0x65A7 # -0x65AB # 0x65AC # 0x65AD # -0x65AF # 0x65B0 # -0x65B7 # 0x65B9 # -0x65BC # 0x65BD # -0x65C1 # -0x65C3 # -0x65C4 # 0x65C5 # -0x65C6 # 0x65CB # -0x65CC # 0x65CF # -0x65D2 # 0x65D7 # -0x65D9 # -0x65DB # -0x65E0 # -0x65E1 # 0x65E2 # 0x65E5 # 0x65E6 # @@ -2338,21 +1110,12 @@ 0x65E8 # 0x65E9 # 0x65EC # -0x65ED # -0x65F1 # 0x65FA # -0x65FB # -0x6602 # -0x6603 # 0x6606 # 0x6607 # -0x660A # -0x660C # 0x660E # -0x660F # 0x6613 # 0x6614 # -0x661C # 0x661F # 0x6620 # 0x6625 # @@ -2360,146 +1123,59 @@ 0x6628 # 0x662D # 0x662F # -0x6634 # -0x6635 # -0x6636 # 0x663C # -0x663F # -0x6641 # 0x6642 # -0x6643 # -0x6644 # -0x6649 # -0x664B # -0x664F # -0x6652 # -0x665D # -0x665E # -0x665F # -0x6662 # -0x6664 # -0x6666 # -0x6667 # -0x6668 # 0x6669 # 0x666E # 0x666F # -0x6670 # 0x6674 # 0x6676 # -0x667A # 0x6681 # -0x6683 # -0x6684 # 0x6687 # -0x6688 # -0x6689 # -0x668E # 0x6691 # 0x6696 # 0x6697 # -0x6698 # -0x669D # -0x66A2 # 0x66A6 # 0x66AB # 0x66AE # 0x66B4 # -0x66B8 # -0x66B9 # -0x66BC # -0x66BE # -0x66C1 # -0x66C4 # 0x66C7 # -0x66C9 # 0x66D6 # -0x66D9 # -0x66DA # 0x66DC # -0x66DD # -0x66E0 # -0x66E6 # -0x66E9 # -0x66F0 # 0x66F2 # -0x66F3 # 0x66F4 # -0x66F5 # -0x66F7 # 0x66F8 # 0x66F9 # -0x66FC # 0x66FD # -0x66FE # 0x66FF # 0x6700 # -0x6703 # 0x6708 # 0x6709 # -0x670B # 0x670D # -0x670F # -0x6714 # 0x6715 # -0x6716 # 0x6717 # 0x671B # 0x671D # -0x671E # 0x671F # -0x6726 # -0x6727 # 0x6728 # 0x672A # 0x672B # 0x672C # 0x672D # -0x672E # 0x6731 # 0x6734 # -0x6736 # -0x6737 # -0x6738 # 0x673A # 0x673D # -0x673F # -0x6741 # -0x6746 # 0x6749 # -0x674E # -0x674F # 0x6750 # 0x6751 # -0x6753 # -0x6756 # -0x6759 # -0x675C # -0x675E # 0x675F # -0x6760 # 0x6761 # -0x6762 # -0x6763 # -0x6764 # 0x6765 # -0x676A # -0x676D # 0x676F # -0x6770 # 0x6771 # -0x6772 # -0x6773 # -0x6775 # -0x6777 # -0x677C # 0x677E # 0x677F # -0x6785 # -0x6787 # -0x6789 # -0x678B # -0x678C # 0x6790 # 0x6795 # 0x6797 # @@ -2507,2836 +1183,820 @@ 0x679C # 0x679D # 0x67A0 # -0x67A1 # 0x67A2 # -0x67A6 # -0x67A9 # 0x67AF # -0x67B3 # -0x67B4 # 0x67B6 # -0x67B7 # -0x67B8 # -0x67B9 # -0x67C1 # 0x67C4 # -0x67C6 # -0x67CA # -0x67CE # -0x67CF # 0x67D0 # -0x67D1 # 0x67D3 # 0x67D4 # -0x67D8 # -0x67DA # -0x67DD # -0x67DE # -0x67E2 # -0x67E4 # -0x67E7 # -0x67E9 # -0x67EC # -0x67EE # -0x67EF # 0x67F1 # 0x67F3 # -0x67F4 # 0x67F5 # 0x67FB # -0x67FE # 0x67FF # -0x6802 # 0x6803 # 0x6804 # 0x6813 # -0x6816 # -0x6817 # -0x681E # 0x6821 # -0x6822 # -0x6829 # 0x682A # -0x682B # -0x6832 # -0x6834 # 0x6838 # 0x6839 # 0x683C # 0x683D # -0x6840 # 0x6841 # -0x6842 # 0x6843 # -0x6846 # 0x6848 # -0x684D # -0x684E # -0x6850 # 0x6851 # -0x6853 # -0x6854 # -0x6859 # 0x685C # -0x685D # 0x685F # -0x6863 # -0x6867 # -0x6874 # -0x6876 # -0x6877 # -0x687E # -0x687F # -0x6881 # -0x6883 # 0x6885 # -0x688D # -0x688F # -0x6893 # -0x6894 # 0x6897 # -0x689B # -0x689D # -0x689F # -0x68A0 # -0x68A2 # -0x68A6 # -0x68A7 # 0x68A8 # -0x68AD # -0x68AF # 0x68B0 # -0x68B1 # -0x68B3 # -0x68B5 # -0x68B6 # -0x68B9 # -0x68BA # -0x68BC # 0x68C4 # -0x68C6 # -0x68C9 # -0x68CA # 0x68CB # -0x68CD # 0x68D2 # -0x68D4 # -0x68D5 # -0x68D7 # -0x68D8 # 0x68DA # 0x68DF # -0x68E0 # -0x68E1 # -0x68E3 # -0x68E7 # 0x68EE # -0x68EF # -0x68F2 # -0x68F9 # 0x68FA # -0x6900 # -0x6901 # -0x6904 # 0x6905 # -0x6908 # -0x690B # -0x690C # 0x690D # 0x690E # -0x690F # -0x6912 # -0x6919 # -0x691A # -0x691B # 0x691C # -0x6921 # -0x6922 # -0x6923 # -0x6925 # -0x6926 # -0x6928 # -0x692A # -0x6930 # -0x6934 # -0x6936 # -0x6939 # -0x693D # -0x693F # -0x694A # -0x6953 # -0x6954 # -0x6955 # -0x6959 # -0x695A # -0x695C # -0x695D # -0x695E # -0x6960 # -0x6961 # -0x6962 # -0x696A # -0x696B # 0x696D # -0x696E # -0x696F # -0x6973 # -0x6974 # 0x6975 # 0x6977 # -0x6978 # -0x6979 # 0x697C # 0x697D # -0x697E # -0x6981 # 0x6982 # -0x698A # -0x698E # -0x6991 # -0x6994 # -0x6995 # -0x699B # -0x699C # -0x69A0 # -0x69A7 # -0x69AE # -0x69B1 # -0x69B2 # -0x69B4 # -0x69BB # -0x69BE # -0x69BF # -0x69C1 # -0x69C3 # -0x69C7 # -0x69CA # 0x69CB # -0x69CC # -0x69CD # -0x69CE # -0x69D0 # -0x69D3 # 0x69D8 # -0x69D9 # -0x69DD # -0x69DE # -0x69E7 # -0x69E8 # -0x69EB # -0x69ED # -0x69F2 # -0x69F9 # -0x69FB # 0x69FD # -0x69FF # -0x6A02 # -0x6A05 # -0x6A0A # -0x6A0B # -0x6A0C # -0x6A12 # -0x6A13 # -0x6A14 # -0x6A17 # 0x6A19 # -0x6A1B # -0x6A1E # -0x6A1F # 0x6A21 # -0x6A22 # -0x6A23 # 0x6A29 # 0x6A2A # -0x6A2B # -0x6A2E # -0x6A35 # -0x6A36 # -0x6A38 # 0x6A39 # -0x6A3A # -0x6A3D # -0x6A44 # -0x6A47 # -0x6A48 # 0x6A4B # -0x6A58 # -0x6A59 # 0x6A5F # -0x6A61 # -0x6A62 # -0x6A66 # -0x6A72 # -0x6A78 # -0x6A7F # -0x6A80 # -0x6A84 # -0x6A8D # -0x6A8E # -0x6A90 # -0x6A97 # -0x6A9C # -0x6AA0 # -0x6AA2 # -0x6AA3 # -0x6AAA # -0x6AAC # -0x6AAE # -0x6AB3 # -0x6AB8 # -0x6ABB # -0x6AC1 # -0x6AC2 # -0x6AC3 # -0x6AD1 # -0x6AD3 # -0x6ADA # -0x6ADB # -0x6ADE # -0x6ADF # -0x6AE8 # -0x6AEA # -0x6AFA # -0x6AFB # 0x6B04 # -0x6B05 # -0x6B0A # -0x6B12 # -0x6B16 # -0x6B1D # -0x6B1F # 0x6B20 # 0x6B21 # -0x6B23 # 0x6B27 # 0x6B32 # -0x6B37 # -0x6B38 # -0x6B39 # 0x6B3A # -0x6B3D # 0x6B3E # -0x6B43 # -0x6B47 # -0x6B49 # 0x6B4C # -0x6B4E # -0x6B50 # 0x6B53 # -0x6B54 # -0x6B59 # -0x6B5B # -0x6B5F # -0x6B61 # 0x6B62 # 0x6B63 # -0x6B64 # 0x6B66 # 0x6B69 # -0x6B6A # 0x6B6F # 0x6B73 # 0x6B74 # -0x6B78 # -0x6B79 # 0x6B7B # -0x6B7F # -0x6B80 # -0x6B83 # -0x6B84 # -0x6B86 # 0x6B89 # 0x6B8A # 0x6B8B # -0x6B8D # -0x6B95 # 0x6B96 # -0x6B98 # -0x6B9E # -0x6BA4 # -0x6BAA # -0x6BAB # -0x6BAF # -0x6BB1 # -0x6BB2 # -0x6BB3 # 0x6BB4 # 0x6BB5 # -0x6BB7 # 0x6BBA # 0x6BBB # -0x6BBC # 0x6BBF # 0x6BC0 # -0x6BC5 # -0x6BC6 # -0x6BCB # 0x6BCD # 0x6BCE # 0x6BD2 # -0x6BD3 # 0x6BD4 # -0x6BD8 # 0x6BDB # -0x6BDF # -0x6BEB # -0x6BEC # -0x6BEF # -0x6BF3 # -0x6C08 # 0x6C0F # 0x6C11 # -0x6C13 # -0x6C14 # 0x6C17 # -0x6C1B # -0x6C23 # -0x6C24 # 0x6C34 # 0x6C37 # 0x6C38 # 0x6C3E # -0x6C40 # 0x6C41 # 0x6C42 # 0x6C4E # -0x6C50 # -0x6C55 # 0x6C57 # 0x6C5A # -0x6C5D # -0x6C5E # 0x6C5F # 0x6C60 # -0x6C62 # -0x6C68 # -0x6C6A # 0x6C70 # -0x6C72 # -0x6C73 # 0x6C7A # 0x6C7D # -0x6C7E # -0x6C81 # -0x6C82 # 0x6C83 # 0x6C88 # -0x6C8C # -0x6C8D # -0x6C90 # -0x6C92 # -0x6C93 # 0x6C96 # 0x6C99 # -0x6C9A # -0x6C9B # 0x6CA1 # 0x6CA2 # -0x6CAB # -0x6CAE # -0x6CB1 # 0x6CB3 # 0x6CB8 # 0x6CB9 # -0x6CBA # 0x6CBB # 0x6CBC # -0x6CBD # -0x6CBE # 0x6CBF # 0x6CC1 # -0x6CC4 # -0x6CC5 # 0x6CC9 # 0x6CCA # 0x6CCC # -0x6CD3 # 0x6CD5 # -0x6CD7 # -0x6CD9 # -0x6CDB # -0x6CDD # 0x6CE1 # 0x6CE2 # 0x6CE3 # 0x6CE5 # 0x6CE8 # -0x6CEA # -0x6CEF # 0x6CF0 # -0x6CF1 # 0x6CF3 # 0x6D0B # -0x6D0C # -0x6D12 # 0x6D17 # -0x6D19 # -0x6D1B # 0x6D1E # -0x6D1F # 0x6D25 # -0x6D29 # 0x6D2A # -0x6D2B # -0x6D32 # -0x6D33 # -0x6D35 # -0x6D36 # -0x6D38 # 0x6D3B # -0x6D3D # 0x6D3E # 0x6D41 # 0x6D44 # 0x6D45 # -0x6D59 # -0x6D5A # 0x6D5C # -0x6D63 # -0x6D64 # 0x6D66 # -0x6D69 # 0x6D6A # -0x6D6C # 0x6D6E # 0x6D74 # 0x6D77 # 0x6D78 # -0x6D79 # -0x6D85 # 0x6D88 # -0x6D8C # -0x6D8E # -0x6D93 # -0x6D95 # 0x6D99 # -0x6D9B # -0x6D9C # 0x6DAF # 0x6DB2 # -0x6DB5 # -0x6DB8 # 0x6DBC # -0x6DC0 # -0x6DC5 # -0x6DC6 # -0x6DC7 # -0x6DCB # -0x6DCC # 0x6DD1 # -0x6DD2 # -0x6DD5 # -0x6DD8 # -0x6DD9 # -0x6DDE # 0x6DE1 # -0x6DE4 # -0x6DE6 # -0x6DE8 # -0x6DEA # 0x6DEB # -0x6DEC # -0x6DEE # 0x6DF1 # -0x6DF3 # -0x6DF5 # 0x6DF7 # -0x6DF9 # -0x6DFA # 0x6DFB # 0x6E05 # 0x6E07 # 0x6E08 # 0x6E09 # -0x6E0A # 0x6E0B # 0x6E13 # -0x6E15 # -0x6E19 # -0x6E1A # 0x6E1B # -0x6E1D # -0x6E1F # -0x6E20 # 0x6E21 # -0x6E23 # -0x6E24 # -0x6E25 # 0x6E26 # 0x6E29 # -0x6E2B # 0x6E2C # -0x6E2D # -0x6E2E # 0x6E2F # -0x6E38 # -0x6E3A # -0x6E3E # -0x6E43 # -0x6E4A # -0x6E4D # -0x6E4E # 0x6E56 # -0x6E58 # -0x6E5B # -0x6E5F # 0x6E67 # -0x6E6B # -0x6E6E # 0x6E6F # -0x6E72 # -0x6E76 # 0x6E7E # 0x6E7F # 0x6E80 # -0x6E82 # -0x6E8C # -0x6E8F # 0x6E90 # 0x6E96 # -0x6E98 # -0x6E9C # 0x6E9D # -0x6E9F # -0x6EA2 # -0x6EA5 # -0x6EAA # -0x6EAF # -0x6EB2 # 0x6EB6 # -0x6EB7 # 0x6EBA # -0x6EBD # -0x6EC2 # -0x6EC4 # 0x6EC5 # -0x6EC9 # 0x6ECB # -0x6ECC # 0x6ED1 # -0x6ED3 # -0x6ED4 # -0x6ED5 # 0x6EDD # 0x6EDE # -0x6EEC # -0x6EEF # -0x6EF2 # 0x6EF4 # -0x6EF7 # -0x6EF8 # -0x6EFE # -0x6EFF # 0x6F01 # 0x6F02 # 0x6F06 # -0x6F09 # 0x6F0F # -0x6F11 # -0x6F13 # 0x6F14 # -0x6F15 # 0x6F20 # 0x6F22 # -0x6F23 # 0x6F2B # 0x6F2C # -0x6F31 # -0x6F32 # 0x6F38 # -0x6F3E # -0x6F3F # -0x6F41 # -0x6F45 # 0x6F54 # -0x6F58 # -0x6F5B # 0x6F5C # 0x6F5F # 0x6F64 # -0x6F66 # -0x6F6D # 0x6F6E # -0x6F6F # 0x6F70 # -0x6F74 # -0x6F78 # -0x6F7A # -0x6F7C # -0x6F80 # -0x6F81 # -0x6F82 # 0x6F84 # -0x6F86 # -0x6F8E # -0x6F91 # -0x6F97 # -0x6FA1 # -0x6FA3 # -0x6FA4 # -0x6FAA # -0x6FB1 # -0x6FB3 # -0x6FB9 # 0x6FC0 # 0x6FC1 # -0x6FC2 # 0x6FC3 # -0x6FC6 # -0x6FD4 # -0x6FD5 # -0x6FD8 # -0x6FDB # -0x6FDF # -0x6FE0 # -0x6FE1 # -0x6FE4 # 0x6FEB # -0x6FEC # -0x6FEE # 0x6FEF # -0x6FF1 # -0x6FF3 # -0x6FF6 # -0x6FFA # -0x6FFE # -0x7001 # -0x7009 # -0x700B # -0x700F # -0x7011 # -0x7015 # -0x7018 # -0x701A # -0x701B # -0x701D # -0x701E # -0x701F # -0x7026 # -0x7027 # 0x702C # -0x7030 # -0x7032 # -0x703E # -0x704C # -0x7051 # -0x7058 # -0x7063 # 0x706B # 0x706F # 0x7070 # -0x7078 # -0x707C # 0x707D # 0x7089 # 0x708A # 0x708E # -0x7092 # -0x7099 # -0x70AC # 0x70AD # -0x70AE # -0x70AF # -0x70B3 # -0x70B8 # 0x70B9 # 0x70BA # 0x70C8 # -0x70CB # -0x70CF # -0x70D9 # -0x70DD # -0x70DF # -0x70F1 # -0x70F9 # -0x70FD # -0x7109 # -0x7114 # -0x7119 # -0x711A # -0x711C # 0x7121 # 0x7126 # 0x7136 # 0x713C # -0x7149 # -0x714C # 0x714E # -0x7155 # -0x7156 # 0x7159 # -0x7162 # -0x7164 # -0x7165 # -0x7166 # 0x7167 # 0x7169 # -0x716C # 0x716E # -0x717D # -0x7184 # -0x7188 # 0x718A # -0x718F # -0x7194 # -0x7195 # -#0x7199 # # not in kochi fonts 0x719F # -0x71A8 # -0x71AC # 0x71B1 # -0x71B9 # -0x71BE # 0x71C3 # -0x71C8 # -0x71C9 # -0x71CE # -0x71D0 # -0x71D2 # -0x71D4 # -0x71D5 # -0x71D7 # -0x71DF # -0x71E0 # 0x71E5 # -0x71E6 # -0x71E7 # -0x71EC # -0x71ED # -0x71EE # -0x71F5 # -0x71F9 # -0x71FB # -0x71FC # -0x71FF # 0x7206 # -0x720D # -0x7210 # -0x721B # -0x7228 # 0x722A # -0x722C # -0x722D # -0x7230 # -0x7232 # 0x7235 # 0x7236 # -0x723A # -0x723B # -0x723C # 0x723D # -0x723E # -0x723F # -0x7240 # -0x7246 # 0x7247 # 0x7248 # -0x724B # -0x724C # -0x7252 # -0x7258 # 0x7259 # 0x725B # -0x725D # -0x725F # -0x7261 # -0x7262 # 0x7267 # 0x7269 # 0x7272 # -0x7274 # 0x7279 # -0x727D # -0x727E # -0x7280 # -0x7281 # -0x7282 # -0x7287 # -0x7292 # -0x7296 # 0x72A0 # -0x72A2 # -0x72A7 # 0x72AC # 0x72AF # -0x72B2 # 0x72B6 # -0x72B9 # 0x72C2 # -0x72C3 # -0x72C4 # -0x72C6 # -0x72CE # -0x72D0 # -0x72D2 # -0x72D7 # 0x72D9 # -0x72DB # -0x72E0 # -0x72E1 # -0x72E2 # 0x72E9 # 0x72EC # 0x72ED # -0x72F7 # -0x72F8 # -0x72F9 # -0x72FC # -0x72FD # -0x730A # -0x7316 # -0x7317 # 0x731B # -0x731C # -0x731D # 0x731F # -0x7325 # -0x7329 # -0x732A # 0x732B # 0x732E # -0x732F # -0x7334 # 0x7336 # -0x7337 # -0x733E # 0x733F # 0x7344 # -0x7345 # -0x734E # -0x734F # -0x7357 # 0x7363 # -0x7368 # -0x736A # -0x7370 # 0x7372 # -0x7375 # -0x7378 # -0x737A # -0x737B # 0x7384 # 0x7387 # 0x7389 # 0x738B # -0x7396 # 0x73A9 # -0x73B2 # -0x73B3 # -0x73BB # -0x73C0 # -0x73C2 # -0x73C8 # -0x73CA # 0x73CD # -0x73CE # -0x73DE # 0x73E0 # -0x73E5 # -0x73EA # 0x73ED # -0x73EE # -0x73F1 # -0x73F8 # 0x73FE # 0x7403 # -0x7405 # 0x7406 # -0x7409 # -0x7422 # -0x7425 # -0x7432 # -0x7433 # 0x7434 # -0x7435 # -0x7436 # -0x743A # -0x743F # -0x7441 # -0x7455 # -0x7459 # -0x745A # -0x745B # -0x745C # -0x745E # -0x745F # 0x7460 # -0x7463 # -0x7464 # -0x7469 # -0x746A # -0x746F # -0x7470 # -0x7473 # -0x7476 # -0x747E # 0x7483 # -0x748B # -0x749E # -0x74A2 # 0x74A7 # 0x74B0 # 0x74BD # -0x74CA # -0x74CF # -0x74D4 # -0x74DC # -0x74E0 # -0x74E2 # -0x74E3 # 0x74E6 # -0x74E7 # -0x74E9 # -0x74EE # -0x74F0 # -0x74F1 # -0x74F2 # 0x74F6 # -0x74F7 # -0x74F8 # -0x7503 # -0x7504 # -0x7505 # -0x750C # -0x750D # -0x750E # -0x7511 # -0x7513 # -0x7515 # 0x7518 # 0x751A # -0x751C # -0x751E # 0x751F # 0x7523 # -0x7525 # -0x7526 # 0x7528 # -0x752B # -0x752C # 0x7530 # 0x7531 # 0x7532 # 0x7533 # 0x7537 # -0x7538 # 0x753A # 0x753B # -0x753C # -0x7544 # -0x7546 # -0x7549 # -0x754A # -0x754B # 0x754C # -0x754D # 0x754F # 0x7551 # 0x7554 # 0x7559 # -0x755A # -0x755B # 0x755C # 0x755D # -0x7560 # -0x7562 # -0x7564 # 0x7565 # -0x7566 # -0x7567 # -0x7569 # 0x756A # -0x756B # -0x756D # 0x7570 # 0x7573 # -0x7574 # -0x7576 # -0x7577 # -0x7578 # 0x757F # -0x7582 # -0x7586 # -0x7587 # -0x7589 # -0x758A # -0x758B # 0x758E # -0x758F # 0x7591 # -0x7594 # -0x759A # -0x759D # -0x75A3 # -0x75A5 # 0x75AB # -0x75B1 # 0x75B2 # -0x75B3 # -0x75B5 # -0x75B8 # -0x75B9 # -0x75BC # -0x75BD # 0x75BE # -0x75C2 # -0x75C3 # 0x75C5 # 0x75C7 # -0x75CA # -0x75CD # -0x75D2 # -0x75D4 # 0x75D5 # 0x75D8 # -0x75D9 # 0x75DB # -0x75DE # 0x75E2 # -0x75E3 # 0x75E9 # -0x75F0 # -0x75F2 # -0x75F3 # 0x75F4 # -0x75FA # -0x75FC # -0x75FE # -0x75FF # -0x7601 # -0x7609 # -0x760B # 0x760D # -0x761F # -0x7620 # -0x7621 # -0x7622 # -0x7624 # -0x7627 # -0x7630 # -0x7634 # -0x763B # 0x7642 # -0x7646 # -0x7647 # -0x7648 # -0x764C # 0x7652 # 0x7656 # -0x7658 # -0x765C # -0x7661 # -0x7662 # -0x7667 # -0x7668 # -0x7669 # -0x766A # -0x766C # -0x7670 # -0x7672 # -0x7676 # -0x7678 # 0x767A # 0x767B # -0x767C # 0x767D # 0x767E # -0x7680 # -0x7683 # 0x7684 # 0x7686 # 0x7687 # -0x7688 # -0x768B # -0x768E # -0x7690 # -0x7693 # -0x7696 # -0x7699 # -0x769A # 0x76AE # -0x76B0 # -0x76B4 # -0x76B7 # -0x76B8 # -0x76B9 # -0x76BA # 0x76BF # -0x76C2 # -0x76C3 # 0x76C6 # -0x76C8 # 0x76CA # -0x76CD # -0x76D2 # -0x76D6 # 0x76D7 # 0x76DB # -0x76DC # -0x76DE # 0x76DF # -0x76E1 # 0x76E3 # 0x76E4 # -0x76E5 # -0x76E7 # -0x76EA # 0x76EE # 0x76F2 # 0x76F4 # 0x76F8 # -0x76FB # 0x76FE # 0x7701 # -0x7704 # -0x7707 # -0x7708 # 0x7709 # 0x770B # 0x770C # -0x771B # -0x771E # 0x771F # 0x7720 # -0x7724 # -0x7725 # -0x7726 # -0x7729 # -0x7737 # -0x7738 # 0x773A # 0x773C # 0x7740 # -0x7747 # -0x775A # -0x775B # 0x7761 # 0x7763 # -0x7765 # 0x7766 # -0x7768 # -0x776B # -0x7779 # -0x777E # -0x777F # -0x778B # -0x778E # -0x7791 # -0x779E # -0x77A0 # -0x77A5 # 0x77AC # 0x77AD # -0x77B0 # 0x77B3 # -0x77B6 # -0x77B9 # -0x77BB # -0x77BC # -0x77BD # -0x77BF # -0x77C7 # -0x77CD # -0x77D7 # -0x77DA # 0x77DB # -0x77DC # 0x77E2 # -0x77E3 # 0x77E5 # -0x77E7 # -0x77E9 # 0x77ED # -0x77EE # 0x77EF # 0x77F3 # -0x77FC # 0x7802 # -0x780C # -0x7812 # 0x7814 # 0x7815 # -0x7820 # -0x7825 # -0x7826 # -0x7827 # 0x7832 # 0x7834 # -0x783A # -0x783F # -0x7845 # 0x785D # 0x786B # 0x786C # -0x786F # -0x7872 # -0x7874 # -0x787C # 0x7881 # -0x7886 # -0x7887 # -0x788C # -0x788D # -0x788E # 0x7891 # -0x7893 # -0x7895 # -0x7897 # -0x789A # -0x78A3 # -0x78A7 # -0x78A9 # -0x78AA # -0x78AF # -0x78B5 # 0x78BA # -0x78BC # -0x78BE # 0x78C1 # -0x78C5 # -0x78C6 # -0x78CA # -0x78CB # -0x78D0 # -0x78D1 # -0x78D4 # -0x78DA # -0x78E7 # 0x78E8 # -0x78EC # -0x78EF # -0x78F4 # -0x78FD # 0x7901 # -0x7907 # 0x790E # -0x7911 # -0x7912 # -0x7919 # -0x7926 # -0x792A # -0x792B # -0x792C # 0x793A # 0x793C # 0x793E # -0x7940 # -0x7941 # -0x7947 # 0x7948 # 0x7949 # -0x7950 # -0x7953 # -0x7955 # 0x7956 # -0x7957 # -0x795A # 0x795D # 0x795E # -0x795F # -0x7960 # -0x7962 # 0x7965 # 0x7968 # 0x796D # -0x7977 # -0x797A # -0x797F # -0x7980 # 0x7981 # -0x7984 # 0x7985 # -0x798A # 0x798D # -0x798E # 0x798F # -0x799D # -0x79A6 # -0x79A7 # -0x79AA # -0x79AE # -0x79B0 # -0x79B3 # -0x79B9 # -0x79BA # -0x79BD # -0x79BE # -0x79BF # 0x79C0 # 0x79C1 # -0x79C9 # 0x79CB # 0x79D1 # 0x79D2 # -0x79D5 # 0x79D8 # 0x79DF # -0x79E1 # -0x79E3 # -0x79E4 # -0x79E6 # -0x79E7 # 0x79E9 # -0x79EC # 0x79F0 # 0x79FB # -0x7A00 # -0x7A08 # 0x7A0B # -0x7A0D # 0x7A0E # -0x7A14 # -0x7A17 # -0x7A18 # -0x7A19 # 0x7A1A # -0x7A1C # -0x7A1F # -0x7A20 # 0x7A2E # -0x7A31 # 0x7A32 # -0x7A37 # -0x7A3B # 0x7A3C # 0x7A3D # -0x7A3E # 0x7A3F # 0x7A40 # 0x7A42 # -0x7A43 # -0x7A46 # -0x7A49 # 0x7A4D # -0x7A4E # 0x7A4F # -0x7A50 # -0x7A57 # -0x7A61 # -0x7A62 # -0x7A63 # -0x7A69 # 0x7A6B # -0x7A70 # 0x7A74 # 0x7A76 # -0x7A79 # 0x7A7A # -0x7A7D # -0x7A7F # 0x7A81 # 0x7A83 # -0x7A84 # -0x7A88 # 0x7A92 # 0x7A93 # -0x7A95 # -0x7A96 # -0x7A97 # -0x7A98 # 0x7A9F # -0x7AA9 # -0x7AAA # 0x7AAE # 0x7AAF # -0x7AB0 # -0x7AB6 # -0x7ABA # -0x7ABF # -0x7AC3 # -0x7AC4 # -0x7AC5 # -0x7AC7 # -0x7AC8 # -0x7ACA # 0x7ACB # -0x7ACD # -0x7ACF # -0x7AD2 # -0x7AD3 # -0x7AD5 # -0x7AD9 # -0x7ADA # 0x7ADC # -0x7ADD # -0x7ADF # 0x7AE0 # -0x7AE1 # -0x7AE2 # -0x7AE3 # 0x7AE5 # -0x7AE6 # -0x7AEA # -0x7AED # 0x7AEF # -0x7AF0 # 0x7AF6 # -0x7AF8 # 0x7AF9 # -0x7AFA # -0x7AFF # -0x7B02 # -0x7B04 # -0x7B06 # -0x7B08 # -0x7B0A # -0x7B0B # -0x7B0F # 0x7B11 # -0x7B18 # -0x7B19 # 0x7B1B # -0x7B1E # -0x7B20 # -0x7B25 # 0x7B26 # -0x7B28 # 0x7B2C # -0x7B33 # -0x7B35 # -0x7B36 # -0x7B39 # -0x7B45 # 0x7B46 # -0x7B48 # 0x7B49 # 0x7B4B # -0x7B4C # -0x7B4D # -0x7B4F # -0x7B50 # -0x7B51 # 0x7B52 # 0x7B54 # 0x7B56 # -0x7B5D # -0x7B65 # -0x7B67 # -0x7B6C # -0x7B6E # -0x7B70 # -0x7B71 # -0x7B74 # -0x7B75 # -0x7B7A # -0x7B86 # 0x7B87 # 0x7B8B # -0x7B8D # -0x7B8F # -0x7B92 # -0x7B94 # -0x7B95 # 0x7B97 # -0x7B98 # -0x7B99 # -0x7B9A # -0x7B9C # -0x7B9D # -0x7B9F # 0x7BA1 # -0x7BAA # -0x7BAD # 0x7BB1 # -0x7BB4 # 0x7BB8 # 0x7BC0 # -0x7BC1 # 0x7BC4 # -0x7BC6 # -0x7BC7 # 0x7BC9 # -0x7BCB # -0x7BCC # -0x7BCF # -0x7BDD # -0x7BE0 # 0x7BE4 # -0x7BE5 # -0x7BE6 # -0x7BE9 # -0x7BED # -0x7BF3 # -0x7BF6 # -0x7BF7 # -0x7C00 # -0x7C07 # -0x7C0D # -0x7C11 # -0x7C12 # -0x7C13 # -0x7C14 # -0x7C17 # -0x7C1F # 0x7C21 # -0x7C23 # -0x7C27 # -0x7C2A # -0x7C2B # -0x7C37 # -0x7C38 # -0x7C3D # -0x7C3E # 0x7C3F # -0x7C40 # -0x7C43 # -0x7C4C # 0x7C4D # -0x7C4F # -0x7C50 # -0x7C54 # -0x7C56 # -0x7C58 # -0x7C5F # 0x7C60 # -0x7C64 # -0x7C65 # -0x7C6C # 0x7C73 # -0x7C75 # -0x7C7E # -0x7C81 # -0x7C82 # -0x7C83 # 0x7C89 # 0x7C8B # -0x7C8D # -0x7C90 # 0x7C92 # -0x7C95 # 0x7C97 # 0x7C98 # 0x7C9B # -0x7C9F # -0x7CA1 # -0x7CA2 # -0x7CA4 # -0x7CA5 # 0x7CA7 # -0x7CA8 # -0x7CAB # -0x7CAD # -0x7CAE # -0x7CB1 # -0x7CB2 # -0x7CB3 # -0x7CB9 # -0x7CBD # 0x7CBE # -0x7CC0 # -0x7CC2 # -0x7CC5 # -0x7CCA # -0x7CCE # -0x7CD2 # 0x7CD6 # -0x7CD8 # -0x7CDC # -0x7CDE # -0x7CDF # -0x7CE0 # -0x7CE2 # 0x7CE7 # -0x7CEF # -0x7CF2 # -0x7CF4 # -0x7CF6 # 0x7CF8 # -0x7CFA # 0x7CFB # 0x7CFE # 0x7D00 # -0x7D02 # 0x7D04 # 0x7D05 # -0x7D06 # -0x7D0A # 0x7D0B # 0x7D0D # -0x7D10 # 0x7D14 # -0x7D15 # -0x7D17 # -0x7D18 # 0x7D19 # 0x7D1A # 0x7D1B # -0x7D1C # 0x7D20 # 0x7D21 # 0x7D22 # 0x7D2B # -0x7D2C # -0x7D2E # 0x7D2F # 0x7D30 # -0x7D32 # 0x7D33 # -0x7D35 # 0x7D39 # 0x7D3A # -0x7D3F # 0x7D42 # -0x7D43 # 0x7D44 # -0x7D45 # -0x7D46 # -0x7D4B # 0x7D4C # -0x7D4E # -0x7D4F # 0x7D50 # -0x7D56 # -0x7D5B # 0x7D5E # 0x7D61 # -0x7D62 # -0x7D63 # 0x7D66 # -0x7D68 # -0x7D6E # 0x7D71 # -0x7D72 # -0x7D73 # 0x7D75 # 0x7D76 # 0x7D79 # -0x7D7D # -0x7D89 # -0x7D8F # -0x7D93 # 0x7D99 # 0x7D9A # -0x7D9B # -0x7D9C # -0x7D9F # -0x7DA2 # -0x7DA3 # -0x7DAB # -0x7DAC # 0x7DAD # -0x7DAE # -0x7DAF # -0x7DB0 # 0x7DB1 # 0x7DB2 # -0x7DB4 # -0x7DB5 # -0x7DB8 # -0x7DBA # 0x7DBB # -0x7DBD # -0x7DBE # 0x7DBF # -0x7DC7 # 0x7DCA # -0x7DCB # 0x7DCF # 0x7DD1 # 0x7DD2 # -0x7DD5 # -0x7DD8 # 0x7DDA # -0x7DDC # -0x7DDD # -0x7DDE # 0x7DE0 # -0x7DE1 # -0x7DE4 # 0x7DE8 # 0x7DE9 # -0x7DEC # 0x7DEF # -0x7DF2 # 0x7DF4 # 0x7DFB # 0x7E01 # 0x7E04 # -0x7E05 # -0x7E09 # -0x7E0A # -0x7E0B # -0x7E12 # 0x7E1B # -0x7E1E # -0x7E1F # -0x7E21 # -0x7E22 # -0x7E23 # 0x7E26 # 0x7E2B # 0x7E2E # -0x7E31 # -0x7E32 # -0x7E35 # -0x7E37 # -0x7E39 # -0x7E3A # -0x7E3B # -0x7E3D # 0x7E3E # 0x7E41 # -0x7E43 # -0x7E46 # 0x7E4A # -0x7E4B # -0x7E4D # 0x7E54 # 0x7E55 # -0x7E56 # -0x7E59 # -0x7E5A # -0x7E5D # -0x7E5E # -0x7E66 # -0x7E67 # -0x7E69 # -0x7E6A # 0x7E6D # 0x7E70 # -0x7E79 # -0x7E7B # -0x7E7C # -0x7E7D # -0x7E7F # -0x7E82 # -0x7E83 # -0x7E88 # -0x7E89 # -0x7E8C # -0x7E8E # -0x7E8F # -0x7E90 # -0x7E92 # -0x7E93 # -0x7E94 # -0x7E96 # -0x7E9B # -0x7E9C # 0x7F36 # -0x7F38 # -0x7F3A # -0x7F45 # -0x7F4C # -0x7F4D # -0x7F4E # -0x7F50 # -0x7F51 # -0x7F54 # -0x7F55 # -0x7F58 # -0x7F5F # -0x7F60 # -0x7F67 # -0x7F68 # -0x7F69 # 0x7F6A # -0x7F6B # 0x7F6E # 0x7F70 # 0x7F72 # 0x7F75 # 0x7F77 # -0x7F78 # -0x7F79 # -0x7F82 # -0x7F83 # 0x7F85 # -0x7F86 # -0x7F87 # -0x7F88 # 0x7F8A # -0x7F8C # 0x7F8E # -0x7F94 # -0x7F9A # -0x7F9D # 0x7F9E # -0x7FA3 # 0x7FA4 # 0x7FA8 # 0x7FA9 # -0x7FAE # -0x7FAF # -0x7FB2 # -0x7FB6 # -0x7FB8 # -0x7FB9 # 0x7FBD # 0x7FC1 # -0x7FC5 # -0x7FC6 # -0x7FCA # 0x7FCC # 0x7FD2 # -0x7FD4 # -0x7FD5 # -0x7FE0 # -0x7FE1 # -0x7FE6 # -0x7FE9 # -0x7FEB # -0x7FF0 # -0x7FF3 # -0x7FF9 # 0x7FFB # 0x7FFC # -0x8000 # 0x8001 # 0x8003 # -0x8004 # 0x8005 # -0x8006 # -0x800B # -0x800C # 0x8010 # -0x8012 # 0x8015 # 0x8017 # -0x8018 # -0x8019 # -0x801C # -0x8021 # -0x8028 # 0x8033 # -0x8036 # -0x803B # -0x803D # -0x803F # -0x8046 # -0x804A # -0x8052 # 0x8056 # -0x8058 # -0x805A # 0x805E # -0x805F # -0x8061 # -0x8062 # -0x8068 # -0x806F # -0x8070 # -0x8072 # -0x8073 # 0x8074 # -0x8076 # 0x8077 # -0x8079 # -0x807D # -0x807E # -0x807F # -0x8084 # -0x8085 # -0x8086 # -0x8087 # 0x8089 # -0x808B # 0x808C # -0x8093 # 0x8096 # 0x8098 # -0x809A # -0x809B # 0x809D # 0x80A1 # 0x80A2 # 0x80A5 # 0x80A9 # 0x80AA # -0x80AC # -0x80AD # 0x80AF # -0x80B1 # 0x80B2 # -0x80B4 # 0x80BA # 0x80C3 # -0x80C4 # 0x80C6 # 0x80CC # 0x80CE # -0x80D6 # -0x80D9 # -0x80DA # -0x80DB # -0x80DD # 0x80DE # -0x80E1 # -0x80E4 # -0x80E5 # -0x80EF # -0x80F1 # 0x80F4 # 0x80F8 # -0x80FC # 0x80FD # 0x8102 # 0x8105 # -0x8106 # 0x8107 # 0x8108 # -0x8109 # 0x810A # 0x811A # -0x811B # -0x8123 # -0x8129 # -0x812F # 0x8131 # 0x8133 # -0x8139 # -0x813E # -0x8146 # -0x814B # 0x814E # 0x8150 # -0x8151 # -0x8153 # -0x8154 # 0x8155 # -0x815F # -0x8165 # -0x8166 # 0x816B # -0x816E # 0x8170 # -0x8171 # -0x8174 # 0x8178 # 0x8179 # 0x817A # -0x817F # -0x8180 # -0x8182 # -0x8183 # -0x8188 # -0x818A # -0x818F # -0x8193 # -0x8195 # 0x819A # 0x819C # 0x819D # -0x81A0 # -0x81A3 # -0x81A4 # 0x81A8 # -0x81A9 # -0x81B0 # 0x81B3 # -0x81B5 # -0x81B8 # -0x81BA # -0x81BD # -0x81BE # -0x81BF # -0x81C0 # -0x81C2 # 0x81C6 # -0x81C8 # -0x81C9 # -0x81CD # -0x81D1 # 0x81D3 # -0x81D8 # -0x81D9 # -0x81DA # -0x81DF # -0x81E0 # 0x81E3 # -0x81E5 # -0x81E7 # 0x81E8 # 0x81EA # 0x81ED # 0x81F3 # 0x81F4 # -0x81FA # -0x81FB # 0x81FC # -0x81FE # -0x8201 # -0x8202 # -0x8205 # -0x8207 # 0x8208 # -0x8209 # -0x820A # 0x820C # -0x820D # 0x820E # -0x8210 # -0x8212 # -0x8216 # 0x8217 # -0x8218 # -0x821B # -0x821C # 0x821E # 0x821F # -0x8229 # 0x822A # -0x822B # 0x822C # -0x822E # -0x8233 # -0x8235 # 0x8236 # 0x8237 # -0x8238 # 0x8239 # -0x8240 # 0x8247 # -0x8258 # -0x8259 # -0x825A # -0x825D # -0x825F # -0x8262 # -0x8264 # 0x8266 # -0x8268 # -0x826A # -0x826B # -0x826E # 0x826F # -0x8271 # 0x8272 # 0x8276 # -0x8277 # -0x8278 # -0x827E # 0x828B # -0x828D # -0x8292 # -0x8299 # 0x829D # -0x829F # -0x82A5 # -0x82A6 # -0x82AB # -0x82AC # -0x82AD # 0x82AF # 0x82B1 # 0x82B3 # 0x82B8 # -0x82B9 # -0x82BB # 0x82BD # -0x82C5 # -0x82D1 # -0x82D2 # -0x82D3 # -0x82D4 # 0x82D7 # -0x82D9 # 0x82DB # -0x82DC # -0x82DE # -0x82DF # -0x82E1 # -0x82E3 # 0x82E5 # 0x82E6 # -0x82E7 # -0x82EB # 0x82F1 # -0x82F3 # -0x82F4 # -0x82F9 # -0x82FA # -0x82FB # 0x8302 # -0x8303 # -0x8304 # -0x8305 # -0x8306 # -0x8309 # 0x830E # -0x8316 # -0x8317 # -0x8318 # -0x831C # -0x8323 # 0x8328 # -0x832B # -0x832F # -0x8331 # -0x8332 # -0x8334 # -0x8335 # 0x8336 # -0x8338 # -0x8339 # -0x8340 # -0x8345 # 0x8349 # -0x834A # -0x834F # -0x8350 # 0x8352 # 0x8358 # -0x8373 # -0x8375 # 0x8377 # -0x837B # -0x837C # -0x8385 # -0x8387 # -0x8389 # -0x838A # -0x838E # -0x8393 # -0x8396 # -0x839A # -0x839E # -0x839F # -0x83A0 # -0x83A2 # -0x83A8 # -0x83AA # -0x83AB # -0x83B1 # -0x83B5 # -0x83BD # -0x83C1 # -0x83C5 # 0x83CA # 0x83CC # -0x83CE # 0x83D3 # -0x83D6 # -0x83D8 # 0x83DC # -0x83DF # -0x83E0 # -0x83E9 # -0x83EB # 0x83EF # -0x83F0 # -0x83F1 # -0x83F2 # -0x83F4 # -0x83F7 # -0x83FB # -0x83FD # -0x8403 # -0x8404 # -0x8407 # -0x840B # -0x840C # -0x840D # 0x840E # -0x8413 # -0x8420 # -0x8422 # -0x8429 # -0x842A # -0x842C # -0x8431 # -0x8435 # -0x8438 # -0x843C # 0x843D # -0x8446 # 0x8449 # -0x844E # 0x8457 # 0x845B # -0x8461 # -0x8462 # -0x8463 # -0x8466 # -0x8469 # -0x846B # 0x846C # -0x846D # -0x846E # -0x846F # -0x8471 # -0x8475 # -0x8477 # -0x8479 # -0x847A # -0x8482 # -0x8484 # -0x848B # -0x8490 # -0x8494 # -0x8499 # -0x849C # -0x849F # -0x84A1 # -0x84AD # -0x84B2 # 0x84B8 # -0x84B9 # -0x84BB # -0x84BC # -0x84BF # -0x84C1 # 0x84C4 # -0x84C6 # -0x84C9 # -0x84CA # 0x84CB # -0x84CD # -0x84D0 # -0x84D1 # -0x84D6 # -0x84D9 # -0x84DA # -0x84EC # -0x84EE # -0x84F4 # -0x84FC # -0x84FF # -0x8500 # -0x8506 # 0x8511 # -0x8513 # -0x8514 # -0x8515 # -0x8517 # -0x8518 # -0x851A # -0x851F # -0x8521 # -0x8526 # -0x852C # -0x852D # 0x8535 # 0x853D # -0x8540 # -0x8541 # -0x8543 # -0x8548 # -0x8549 # -0x854A # -0x854B # -0x854E # -0x8555 # -0x8557 # -0x8558 # -0x855A # -0x8563 # -0x8568 # -0x8569 # -0x856A # -0x856D # -0x8577 # -0x857E # -0x8580 # 0x8584 # -0x8587 # -0x8588 # -0x858A # -0x8590 # -0x8591 # -0x8594 # -0x8597 # -0x8599 # -0x859B # -0x859C # -0x85A4 # 0x85A6 # -0x85A8 # -0x85A9 # 0x85AA # 0x85AB # 0x85AC # -0x85AE # -0x85AF # -0x85B9 # -0x85BA # -0x85C1 # -0x85C9 # 0x85CD # -0x85CF # -0x85D0 # -0x85D5 # -0x85DC # -0x85DD # 0x85E4 # -0x85E5 # 0x85E9 # -0x85EA # -0x85F7 # -0x85F9 # -0x85FA # 0x85FB # -0x85FE # -0x8602 # -0x8606 # -0x8607 # -0x860A # -0x860B # -0x8613 # -0x8616 # -0x8617 # -0x861A # -0x8622 # -0x862D # -0x862F # -0x8630 # -0x863F # -0x864D # 0x864E # 0x8650 # -0x8654 # -0x8655 # 0x865A # 0x865C # 0x865E # -0x865F # -0x8667 # 0x866B # -0x8671 # 0x8679 # -0x867B # 0x868A # -0x868B # -0x868C # -0x8693 # 0x8695 # -0x86A3 # -0x86A4 # -0x86A9 # -0x86AA # -0x86AB # -0x86AF # -0x86B0 # -0x86B6 # -0x86C4 # -0x86C6 # 0x86C7 # -0x86C9 # -0x86CB # 0x86CD # -0x86CE # -0x86D4 # -0x86D9 # -0x86DB # -0x86DE # -0x86DF # -0x86E4 # -0x86E9 # -0x86EC # -0x86ED # 0x86EE # -0x86EF # -0x86F8 # -0x86F9 # -0x86FB # -0x86FE # -0x8700 # 0x8702 # -0x8703 # -0x8706 # -0x8708 # -0x8709 # -0x870A # -0x870D # -0x8711 # -0x8712 # -0x8718 # -0x871A # 0x871C # -0x8725 # -0x8729 # -0x8734 # -0x8737 # -0x873B # -0x873F # -0x8749 # -0x874B # -0x874C # -0x874E # -0x8753 # -0x8755 # -0x8757 # -0x8759 # -0x875F # -0x8760 # -0x8763 # -0x8766 # -0x8768 # -0x876A # -0x876E # -0x8774 # -0x8776 # -0x8778 # -0x877F # -0x8782 # 0x878D # -0x879F # -0x87A2 # -0x87AB # -0x87AF # -0x87B3 # -0x87BA # -0x87BB # -0x87BD # -0x87C0 # -0x87C4 # -0x87C6 # -0x87C7 # -0x87CB # -0x87D0 # -0x87D2 # -0x87E0 # -0x87EF # -0x87F2 # -0x87F6 # -0x87F7 # -0x87F9 # -0x87FB # -0x87FE # -0x8805 # -0x880D # -0x880E # -0x880F # -0x8811 # -0x8815 # -0x8816 # -0x8821 # -0x8822 # -0x8823 # -0x8827 # -0x8831 # -0x8836 # -0x8839 # -0x883B # 0x8840 # -0x8842 # -0x8844 # 0x8846 # 0x884C # -0x884D # -0x8852 # 0x8853 # 0x8857 # -0x8859 # 0x885B # 0x885D # -0x885E # 0x8861 # -0x8862 # 0x8863 # 0x8868 # -0x886B # 0x8870 # -0x8872 # -0x8875 # 0x8877 # -0x887D # -0x887E # -0x887F # -0x8881 # -0x8882 # -0x8888 # 0x888B # -0x888D # -0x8892 # 0x8896 # -0x8897 # -0x8899 # -0x889E # -0x88A2 # -0x88A4 # 0x88AB # -0x88AE # -0x88B0 # -0x88B1 # -0x88B4 # -0x88B5 # -0x88B7 # -0x88BF # 0x88C1 # 0x88C2 # -0x88C3 # -0x88C4 # 0x88C5 # 0x88CF # -0x88D4 # 0x88D5 # -0x88D8 # -0x88D9 # 0x88DC # -0x88DD # -0x88DF # -0x88E1 # -0x88E8 # -0x88F2 # -0x88F3 # -0x88F4 # 0x88F8 # -0x88F9 # -0x88FC # 0x88FD # 0x88FE # -0x8902 # -0x8904 # 0x8907 # -0x890A # -0x890C # 0x8910 # 0x8912 # -0x8913 # -0x891D # -0x891E # -0x8925 # -0x892A # -0x892B # -0x8936 # -0x8938 # -0x893B # -0x8941 # -0x8943 # -0x8944 # -0x894C # -0x894D # -0x8956 # -0x895E # 0x895F # -0x8960 # -0x8964 # -0x8966 # -0x896A # -0x896D # -0x896F # 0x8972 # -0x8974 # -0x8977 # -0x897E # 0x897F # 0x8981 # -0x8983 # 0x8986 # 0x8987 # -0x8988 # -0x898A # 0x898B # 0x898F # -0x8993 # 0x8996 # -0x8997 # -0x8998 # 0x899A # -0x89A1 # -0x89A6 # 0x89A7 # -0x89A9 # 0x89AA # -0x89AC # -0x89AF # -0x89B2 # 0x89B3 # -0x89BA # -0x89BD # -0x89BF # -0x89C0 # 0x89D2 # -0x89DA # -0x89DC # -0x89DD # 0x89E3 # 0x89E6 # -0x89E7 # -0x89F4 # -0x89F8 # 0x8A00 # 0x8A02 # 0x8A03 # 0x8A08 # -0x8A0A # -0x8A0C # 0x8A0E # -0x8A10 # 0x8A13 # -0x8A16 # 0x8A17 # 0x8A18 # -0x8A1B # -0x8A1D # 0x8A1F # -0x8A23 # -0x8A25 # 0x8A2A # 0x8A2D # 0x8A31 # 0x8A33 # 0x8A34 # -0x8A36 # 0x8A3A # -0x8A3B # 0x8A3C # -0x8A41 # -0x8A46 # -0x8A48 # 0x8A50 # -0x8A51 # -0x8A52 # 0x8A54 # 0x8A55 # -0x8A5B # 0x8A5E # 0x8A60 # -0x8A62 # 0x8A63 # 0x8A66 # 0x8A69 # -0x8A6B # -0x8A6C # -0x8A6D # 0x8A6E # 0x8A70 # 0x8A71 # 0x8A72 # 0x8A73 # -0x8A7C # -0x8A82 # -0x8A84 # -0x8A85 # 0x8A87 # 0x8A89 # 0x8A8C # 0x8A8D # -0x8A91 # 0x8A93 # 0x8A95 # 0x8A98 # -0x8A9A # 0x8A9E # 0x8AA0 # -0x8AA1 # -0x8AA3 # 0x8AA4 # -0x8AA5 # -0x8AA6 # -0x8AA8 # 0x8AAC # 0x8AAD # 0x8AB0 # 0x8AB2 # -0x8AB9 # -0x8ABC # 0x8ABF # -0x8AC2 # -0x8AC4 # 0x8AC7 # 0x8ACB # -0x8ACC # -0x8ACD # -0x8ACF # -0x8AD2 # 0x8AD6 # -0x8ADA # -0x8ADB # -0x8ADC # -0x8ADE # -0x8AE0 # -0x8AE1 # -0x8AE2 # -0x8AE4 # 0x8AE6 # 0x8AE7 # -0x8AEB # 0x8AED # 0x8AEE # -0x8AF1 # -0x8AF3 # -0x8AF7 # 0x8AF8 # -0x8AFA # 0x8AFE # 0x8B00 # 0x8B01 # -0x8B02 # 0x8B04 # -0x8B07 # -0x8B0C # 0x8B0E # -0x8B10 # -0x8B14 # -0x8B16 # -0x8B17 # 0x8B19 # -0x8B1A # 0x8B1B # 0x8B1D # -0x8B20 # 0x8B21 # -0x8B26 # -0x8B28 # -0x8B2B # -0x8B2C # -0x8B33 # 0x8B39 # -0x8B3E # -0x8B41 # -0x8B49 # -0x8B4C # -0x8B4E # -0x8B4F # -0x8B56 # 0x8B58 # -0x8B5A # -0x8B5B # 0x8B5C # -0x8B5F # 0x8B66 # -0x8B6B # -0x8B6C # -0x8B6F # 0x8B70 # -0x8B71 # 0x8B72 # -0x8B74 # 0x8B77 # -0x8B7D # -0x8B80 # -0x8B83 # -0x8B8A # -0x8B8C # -0x8B8E # -0x8B90 # -0x8B92 # -0x8B93 # -0x8B96 # -0x8B99 # -0x8B9A # 0x8C37 # -0x8C3A # -0x8C3F # -0x8C41 # 0x8C46 # -0x8C48 # 0x8C4A # -0x8C4C # -0x8C4E # -0x8C50 # -0x8C55 # 0x8C5A # 0x8C61 # -0x8C62 # 0x8C6A # -0x8C6B # -0x8C6C # -0x8C78 # -0x8C79 # -0x8C7A # -0x8C7C # -0x8C82 # -0x8C85 # -0x8C89 # -0x8C8A # 0x8C8C # -0x8C8D # -0x8C8E # -0x8C94 # -0x8C98 # 0x8C9D # 0x8C9E # 0x8CA0 # @@ -5348,1218 +2008,338 @@ 0x8CAA # 0x8CAB # 0x8CAC # -0x8CAD # -0x8CAE # 0x8CAF # -0x8CB0 # -0x8CB2 # -0x8CB3 # 0x8CB4 # -0x8CB6 # 0x8CB7 # 0x8CB8 # 0x8CBB # 0x8CBC # -0x8CBD # 0x8CBF # 0x8CC0 # -0x8CC1 # 0x8CC2 # 0x8CC3 # 0x8CC4 # 0x8CC7 # -0x8CC8 # 0x8CCA # -0x8CCD # -0x8CCE # -0x8CD1 # 0x8CD3 # -0x8CDA # 0x8CDB # 0x8CDC # 0x8CDE # 0x8CE0 # 0x8CE2 # -0x8CE3 # -0x8CE4 # 0x8CE6 # 0x8CEA # 0x8CED # -0x8CFA # -0x8CFB # 0x8CFC # -0x8CFD # -0x8D04 # -0x8D05 # -0x8D07 # 0x8D08 # -0x8D0A # -0x8D0B # -0x8D0D # -0x8D0F # -0x8D10 # -0x8D13 # -0x8D14 # -0x8D16 # 0x8D64 # 0x8D66 # -0x8D67 # -0x8D6B # -0x8D6D # 0x8D70 # -0x8D71 # -0x8D73 # 0x8D74 # 0x8D77 # -0x8D81 # 0x8D85 # 0x8D8A # -0x8D99 # 0x8DA3 # -0x8DA8 # 0x8DB3 # -0x8DBA # -0x8DBE # -0x8DC2 # -0x8DCB # -0x8DCC # -0x8DCF # -0x8DD6 # -0x8DDA # -0x8DDB # 0x8DDD # -0x8DDF # 0x8DE1 # -0x8DE3 # -0x8DE8 # -0x8DEA # -0x8DEB # 0x8DEF # 0x8DF3 # 0x8DF5 # -0x8DFC # -0x8DFF # -0x8E08 # -0x8E09 # 0x8E0A # 0x8E0F # -0x8E10 # -0x8E1D # -0x8E1E # -0x8E1F # 0x8E2A # -0x8E30 # -0x8E34 # -0x8E35 # -0x8E42 # -0x8E44 # -0x8E47 # -0x8E48 # -0x8E49 # -0x8E4A # -0x8E4C # -0x8E50 # -0x8E55 # -0x8E59 # -0x8E5F # -0x8E60 # -0x8E63 # -0x8E64 # -0x8E72 # 0x8E74 # -0x8E76 # -0x8E7C # -0x8E81 # -0x8E84 # -0x8E85 # -0x8E87 # -0x8E8A # -0x8E8B # 0x8E8D # -0x8E91 # -0x8E93 # -0x8E94 # -0x8E99 # -0x8EA1 # -0x8EAA # 0x8EAB # -0x8EAC # -0x8EAF # -0x8EB0 # -0x8EB1 # -0x8EBE # -0x8EC5 # -0x8EC6 # -0x8EC8 # 0x8ECA # -0x8ECB # 0x8ECC # 0x8ECD # 0x8ED2 # -0x8EDB # 0x8EDF # 0x8EE2 # -0x8EE3 # -0x8EEB # 0x8EF8 # -0x8EFB # -0x8EFC # 0x8EFD # -0x8EFE # 0x8F03 # -0x8F05 # 0x8F09 # -0x8F0A # -0x8F0C # -0x8F12 # -0x8F13 # -0x8F14 # -0x8F15 # -0x8F19 # -0x8F1B # -0x8F1C # 0x8F1D # -0x8F1F # -0x8F26 # 0x8F29 # 0x8F2A # -0x8F2F # -0x8F33 # 0x8F38 # -0x8F39 # -0x8F3B # -0x8F3E # -0x8F3F # -0x8F42 # 0x8F44 # -0x8F45 # -0x8F46 # -0x8F49 # -0x8F4C # -0x8F4D # -0x8F4E # -0x8F57 # -0x8F5C # -0x8F5F # -0x8F61 # -0x8F62 # -0x8F63 # -0x8F64 # 0x8F9B # -0x8F9C # 0x8F9E # -0x8F9F # 0x8FA3 # -0x8FA7 # -0x8FA8 # -0x8FAD # -0x8FAE # -0x8FAF # -0x8FB0 # 0x8FB1 # 0x8FB2 # -0x8FB7 # 0x8FBA # -0x8FBB # 0x8FBC # -0x8FBF # -0x8FC2 # -0x8FC4 # 0x8FC5 # 0x8FCE # 0x8FD1 # 0x8FD4 # -0x8FDA # -0x8FE2 # -0x8FE5 # -0x8FE6 # -0x8FE9 # -0x8FEA # 0x8FEB # 0x8FED # -0x8FEF # 0x8FF0 # -0x8FF4 # 0x8FF7 # -0x8FF8 # -0x8FF9 # -0x8FFA # 0x8FFD # 0x9000 # 0x9001 # 0x9003 # -0x9005 # 0x9006 # -0x900B # -0x900D # -0x900E # 0x900F # 0x9010 # -0x9011 # 0x9013 # 0x9014 # -0x9015 # -0x9016 # -0x9017 # -0x9019 # 0x901A # 0x901D # -0x901E # 0x901F # 0x9020 # -0x9021 # -0x9022 # 0x9023 # -0x9027 # 0x902E # 0x9031 # 0x9032 # -0x9035 # -0x9036 # 0x9038 # -0x9039 # -0x903C # -0x903E # -0x9041 # 0x9042 # 0x9045 # 0x9047 # -0x9049 # 0x904A # 0x904B # 0x904D # 0x904E # -0x904F # -0x9050 # -0x9051 # -0x9052 # 0x9053 # 0x9054 # 0x9055 # -0x9056 # -0x9058 # -0x9059 # 0x905C # -0x905E # 0x9060 # 0x9061 # 0x9063 # -0x9065 # -0x9068 # 0x9069 # 0x906D # 0x906E # -0x906F # -0x9072 # 0x9075 # -0x9076 # 0x9077 # 0x9078 # 0x907A # -0x907C # -0x907D # 0x907F # -0x9080 # -0x9081 # -0x9082 # -0x9083 # 0x9084 # -0x9087 # -0x9089 # -0x908A # -0x908F # -0x9091 # 0x90A3 # 0x90A6 # -0x90A8 # 0x90AA # -0x90AF # -0x90B1 # -0x90B5 # 0x90B8 # -0x90C1 # 0x90CA # 0x90CE # -0x90DB # 0x90E1 # -0x90E2 # -0x90E4 # 0x90E8 # 0x90ED # 0x90F5 # 0x90F7 # 0x90FD # -0x9102 # -0x9112 # -0x9119 # -0x912D # -0x9130 # -0x9132 # -0x9149 # -0x914A # -0x914B # 0x914C # 0x914D # 0x914E # 0x9152 # 0x9154 # -0x9156 # -0x9158 # 0x9162 # -0x9163 # -0x9165 # -0x9169 # 0x916A # 0x916C # -0x9172 # -0x9173 # 0x9175 # 0x9177 # 0x9178 # -0x9182 # -0x9187 # -0x9189 # -0x918B # -0x918D # -0x9190 # 0x9192 # -0x9197 # 0x919C # -0x91A2 # -0x91A4 # -0x91AA # -0x91AB # -0x91AF # -0x91B4 # -0x91B5 # 0x91B8 # -0x91BA # -0x91C0 # -0x91C1 # -0x91C6 # 0x91C7 # 0x91C8 # -0x91C9 # -0x91CB # 0x91CC # 0x91CD # 0x91CE # 0x91CF # -0x91D0 # 0x91D1 # -0x91D6 # -0x91D8 # -0x91DB # 0x91DC # 0x91DD # -0x91DF # -0x91E1 # 0x91E3 # -0x91E6 # -0x91E7 # -0x91F5 # -0x91F6 # -0x91FC # -0x91FF # 0x920D # -0x920E # -0x9211 # -0x9214 # -0x9215 # -0x921E # -0x9229 # -0x922C # 0x9234 # -0x9237 # -0x923F # 0x9244 # -0x9245 # -0x9248 # -0x9249 # -0x924B # -0x9250 # -0x9257 # -0x925A # 0x925B # -0x925E # 0x9262 # -0x9264 # -0x9266 # 0x9271 # -0x927E # 0x9280 # 0x9283 # 0x9285 # -0x9291 # -0x9293 # -0x9295 # -0x9296 # 0x9298 # -0x929A # -0x929B # -0x929C # 0x92AD # -0x92B7 # -0x92B9 # -0x92CF # -0x92D2 # -0x92E4 # -0x92E9 # -0x92EA # 0x92ED # -0x92F2 # 0x92F3 # -0x92F8 # -0x92FA # 0x92FC # -0x9306 # -0x930F # -0x9310 # -0x9318 # -0x9319 # -0x931A # 0x9320 # -0x9322 # -0x9323 # 0x9326 # -0x9328 # -0x932B # 0x932C # 0x932E # 0x932F # 0x9332 # -0x9335 # -0x933A # -0x933B # -0x9344 # 0x934B # -0x934D # -0x9354 # -0x9356 # 0x935B # -0x935C # -0x9360 # -0x936C # -0x936E # 0x9375 # -0x937C # -0x937E # 0x938C # -0x9394 # 0x9396 # -0x9397 # -0x939A # -0x93A7 # -0x93AC # -0x93AD # 0x93AE # -0x93B0 # -0x93B9 # -0x93C3 # -0x93C8 # -0x93D0 # -0x93D1 # -0x93D6 # -0x93D7 # -0x93D8 # -0x93DD # 0x93E1 # -0x93E4 # -0x93E5 # -0x93E8 # -0x9403 # -0x9407 # -0x9410 # -0x9413 # -0x9414 # 0x9418 # -0x9419 # -0x941A # -0x9421 # -0x942B # -0x9435 # -0x9436 # -0x9438 # -0x943A # -0x9441 # -0x9444 # 0x9451 # -0x9452 # -0x9453 # -0x945A # -0x945B # -0x945E # -0x9460 # -0x9462 # -0x946A # -0x9470 # -0x9475 # -0x9477 # -0x947C # -0x947D # -0x947E # -0x947F # -0x9481 # 0x9577 # 0x9580 # -0x9582 # -0x9583 # -0x9587 # 0x9589 # -0x958A # 0x958B # -0x958F # 0x9591 # 0x9593 # -0x9594 # -0x9596 # -0x9598 # -0x9599 # -0x95A0 # 0x95A2 # 0x95A3 # -0x95A4 # 0x95A5 # -0x95A7 # -0x95A8 # -0x95AD # 0x95B2 # -0x95B9 # -0x95BB # -0x95BC # -0x95BE # -0x95C3 # 0x95C7 # -0x95CA # -0x95CC # -0x95CD # -0x95D4 # -0x95D5 # -0x95D6 # 0x95D8 # -0x95DC # -0x95E1 # -0x95E2 # -0x95E5 # 0x961C # -0x9621 # -0x9628 # 0x962A # -0x962E # -0x962F # 0x9632 # 0x963B # -0x963F # -0x9640 # -0x9642 # 0x9644 # -0x964B # -0x964C # 0x964D # -0x964F # 0x9650 # 0x965B # -0x965C # -0x965D # -0x965E # -0x965F # 0x9662 # 0x9663 # 0x9664 # 0x9665 # -0x9666 # 0x966A # -0x966C # 0x9670 # -0x9672 # 0x9673 # 0x9675 # 0x9676 # -0x9677 # 0x9678 # 0x967A # 0x967D # 0x9685 # 0x9686 # -0x9688 # 0x968A # -0x968B # -0x968D # 0x968E # 0x968F # 0x9694 # -0x9695 # -0x9697 # -0x9698 # 0x9699 # 0x969B # 0x969C # 0x96A0 # 0x96A3 # -0x96A7 # -0x96A8 # -0x96AA # -0x96B0 # -0x96B1 # -0x96B2 # -0x96B4 # -0x96B6 # 0x96B7 # -0x96B8 # -0x96B9 # 0x96BB # -0x96BC # -0x96C0 # -0x96C1 # 0x96C4 # 0x96C5 # 0x96C6 # 0x96C7 # -0x96C9 # -0x96CB # 0x96CC # -0x96CD # -0x96CE # 0x96D1 # -0x96D5 # -0x96D6 # -0x96D9 # -0x96DB # -0x96DC # 0x96E2 # 0x96E3 # 0x96E8 # 0x96EA # -0x96EB # 0x96F0 # 0x96F2 # 0x96F6 # 0x96F7 # -0x96F9 # 0x96FB # 0x9700 # -0x9704 # -0x9706 # 0x9707 # -0x9708 # 0x970A # -0x970D # -0x970E # -0x970F # -0x9711 # -0x9713 # -0x9716 # -0x9719 # 0x971C # -0x971E # -0x9724 # 0x9727 # -0x972A # -0x9730 # 0x9732 # -0x9738 # -0x9739 # -0x973D # -0x973E # -0x9742 # -0x9744 # -0x9746 # -0x9748 # -0x9749 # 0x9752 # -0x9756 # 0x9759 # -0x975C # 0x975E # -0x9760 # -0x9761 # 0x9762 # -0x9764 # -0x9766 # -0x9768 # 0x9769 # -0x976B # -0x976D # -0x9771 # 0x9774 # -0x9779 # -0x977A # -0x977C # -0x9781 # -0x9784 # -0x9785 # -0x9786 # -0x978B # -0x978D # -0x978F # -0x9790 # -0x9798 # -0x979C # -0x97A0 # -0x97A3 # -0x97A6 # -0x97A8 # -0x97AB # -0x97AD # -0x97B3 # -0x97B4 # -0x97C3 # -0x97C6 # -0x97C8 # -0x97CB # 0x97D3 # -0x97DC # -0x97ED # -0x97EE # -0x97F2 # 0x97F3 # -0x97F5 # -0x97F6 # 0x97FB # 0x97FF # -0x9801 # 0x9802 # 0x9803 # 0x9805 # 0x9806 # 0x9808 # -0x980C # -0x980F # 0x9810 # 0x9811 # 0x9812 # 0x9813 # -0x9817 # 0x9818 # -0x981A # -0x9821 # -0x9824 # -0x982C # 0x982D # -0x9834 # -0x9837 # -0x9838 # +#0x9830 # # not in DroidSansJapanese 0x983B # 0x983C # -0x983D # -0x9846 # -0x984B # 0x984C # 0x984D # 0x984E # -0x984F # 0x9854 # 0x9855 # 0x9858 # -0x985B # 0x985E # 0x9867 # -0x986B # -0x986F # -0x9870 # -0x9871 # -0x9873 # -0x9874 # 0x98A8 # -0x98AA # -0x98AF # -0x98B1 # -0x98B6 # -0x98C3 # -0x98C4 # -0x98C6 # 0x98DB # -0x98DC # 0x98DF # 0x98E2 # -0x98E9 # -0x98EB # -0x98ED # -0x98EE # 0x98EF # 0x98F2 # -0x98F4 # 0x98FC # 0x98FD # 0x98FE # -0x9903 # 0x9905 # -0x9909 # 0x990A # 0x990C # -0x9910 # -0x9912 # 0x9913 # -0x9914 # -0x9918 # -0x991D # -0x991E # -0x9920 # -0x9921 # -0x9924 # 0x9928 # -0x992C # -0x992E # -0x993D # -0x993E # -0x9942 # -0x9945 # -0x9949 # -0x994B # -0x994C # -0x9950 # -0x9951 # -0x9952 # -0x9955 # -0x9957 # 0x9996 # -0x9997 # -0x9998 # 0x9999 # -0x99A5 # -0x99A8 # 0x99AC # -0x99AD # -0x99AE # -0x99B3 # -0x99B4 # -0x99BC # -0x99C1 # 0x99C4 # 0x99C5 # 0x99C6 # -0x99C8 # 0x99D0 # -0x99D1 # 0x99D2 # -0x99D5 # -0x99D8 # -0x99DB # -0x99DD # -0x99DF # -0x99E2 # -0x99ED # -0x99EE # -0x99F1 # -0x99F2 # -0x99F8 # -0x99FB # -0x99FF # -0x9A01 # -0x9A05 # 0x9A0E # -0x9A0F # 0x9A12 # 0x9A13 # -0x9A19 # -0x9A28 # -0x9A2B # 0x9A30 # -0x9A37 # -0x9A3E # -0x9A40 # -0x9A42 # -0x9A43 # -0x9A45 # -0x9A4D # -0x9A55 # -0x9A57 # 0x9A5A # -0x9A5B # -0x9A5F # -0x9A62 # -0x9A64 # -0x9A65 # -0x9A69 # -0x9A6A # -0x9A6B # 0x9AA8 # -0x9AAD # -0x9AB0 # 0x9AB8 # -0x9ABC # -0x9AC0 # 0x9AC4 # -0x9ACF # -0x9AD1 # -0x9AD3 # -0x9AD4 # 0x9AD8 # -0x9ADE # -0x9ADF # -0x9AE2 # -0x9AE3 # -0x9AE6 # 0x9AEA # -0x9AEB # -0x9AED # -0x9AEE # -0x9AEF # -0x9AF1 # -0x9AF4 # -0x9AF7 # -0x9AFB # -0x9B06 # -0x9B18 # -0x9B1A # -0x9B1F # -0x9B22 # -0x9B23 # -0x9B25 # -0x9B27 # -0x9B28 # -0x9B29 # -0x9B2A # -0x9B2E # -0x9B2F # 0x9B31 # -0x9B32 # -0x9B3B # 0x9B3C # -0x9B41 # 0x9B42 # -0x9B43 # -0x9B44 # 0x9B45 # -0x9B4D # -0x9B4E # -0x9B4F # -0x9B51 # 0x9B54 # -0x9B58 # 0x9B5A # -0x9B6F # -0x9B74 # -0x9B83 # -0x9B8E # -0x9B91 # -0x9B92 # -0x9B93 # -0x9B96 # -0x9B97 # -0x9B9F # -0x9BA0 # -0x9BA8 # -0x9BAA # -0x9BAB # -0x9BAD # 0x9BAE # -0x9BB4 # -0x9BB9 # -0x9BC0 # -0x9BC6 # -0x9BC9 # -0x9BCA # -0x9BCF # -0x9BD1 # -0x9BD2 # -0x9BD4 # -0x9BD6 # -0x9BDB # -0x9BE1 # -0x9BE2 # -0x9BE3 # -0x9BE4 # 0x9BE8 # -0x9BF0 # -0x9BF1 # -0x9BF2 # -0x9BF5 # -0x9C04 # -0x9C06 # -0x9C08 # -0x9C09 # -0x9C0A # -0x9C0C # -0x9C0D # -0x9C10 # -0x9C12 # -0x9C13 # -0x9C14 # -0x9C15 # -0x9C1B # -0x9C21 # -0x9C24 # -0x9C25 # -0x9C2D # -0x9C2E # -0x9C2F # -0x9C30 # -0x9C32 # -0x9C39 # -0x9C3A # -0x9C3B # -0x9C3E # -0x9C46 # -0x9C47 # -0x9C48 # -0x9C52 # -0x9C57 # -0x9C5A # -0x9C60 # -0x9C67 # -0x9C76 # -0x9C78 # 0x9CE5 # -0x9CE7 # -0x9CE9 # -0x9CEB # -0x9CEC # -0x9CF0 # -0x9CF3 # 0x9CF4 # -0x9CF6 # -0x9D03 # -0x9D06 # -0x9D07 # -0x9D08 # -0x9D09 # -0x9D0E # -0x9D12 # -0x9D15 # -0x9D1B # -0x9D1F # -0x9D23 # -0x9D26 # -0x9D28 # -0x9D2A # -0x9D2B # -0x9D2C # -0x9D3B # -0x9D3E # -0x9D3F # -0x9D41 # -0x9D44 # -0x9D46 # -0x9D48 # -0x9D50 # -0x9D51 # -0x9D59 # -0x9D5C # -0x9D5D # -0x9D5E # -0x9D60 # -0x9D61 # -0x9D64 # -0x9D6C # -0x9D6F # -0x9D72 # -0x9D7A # -0x9D87 # -0x9D89 # 0x9D8F # -0x9D9A # -0x9DA4 # -0x9DA9 # -0x9DAB # -0x9DAF # -0x9DB2 # 0x9DB4 # -0x9DB8 # -0x9DBA # -0x9DBB # -0x9DC1 # -0x9DC2 # -0x9DC4 # -0x9DC6 # -0x9DCF # -0x9DD3 # -0x9DD9 # -0x9DE6 # -0x9DED # -0x9DEF # -0x9DF2 # -0x9DF8 # -0x9DF9 # -0x9DFA # -0x9DFD # -0x9E1A # -0x9E1B # -0x9E1E # -0x9E75 # -0x9E78 # -0x9E79 # -0x9E7D # 0x9E7F # -0x9E81 # -0x9E88 # -0x9E8B # -0x9E8C # -0x9E91 # -0x9E92 # 0x9E93 # -0x9E95 # 0x9E97 # -0x9E9D # -0x9E9F # -0x9EA5 # 0x9EA6 # -0x9EA9 # -0x9EAA # -0x9EAD # -0x9EB8 # -0x9EB9 # 0x9EBA # 0x9EBB # -0x9EBC # -0x9EBE # -0x9EBF # 0x9EC4 # -0x9ECC # -0x9ECD # -0x9ECE # -0x9ECF # -0x9ED0 # 0x9ED2 # -0x9ED4 # -0x9ED8 # 0x9ED9 # -0x9EDB # -0x9EDC # -0x9EDD # -0x9EDE # -0x9EE0 # -0x9EE5 # -0x9EE8 # -0x9EEF # -0x9EF4 # -0x9EF6 # -0x9EF7 # -0x9EF9 # -0x9EFB # -0x9EFC # -0x9EFD # -0x9F07 # -0x9F08 # -0x9F0E # 0x9F13 # -0x9F15 # -0x9F20 # -0x9F21 # -0x9F2C # 0x9F3B # -0x9F3E # -0x9F4A # -0x9F4B # -0x9F4E # -0x9F4F # -0x9F52 # -0x9F54 # -0x9F5F # -0x9F60 # -0x9F61 # 0x9F62 # -0x9F63 # -0x9F66 # -0x9F67 # -0x9F6A # -0x9F6C # -0x9F72 # -0x9F76 # -0x9F77 # -0x9F8D # -0x9F95 # -0x9F9C # -0x9F9D # -0x9FA0 # -#0xFFE5 # FULLWIDTH YEN SIGN +#0x20B9F # diff --git a/mesalib/common.py b/mesalib/common.py index 22c172571..d6e621545 100644 --- a/mesalib/common.py +++ b/mesalib/common.py @@ -91,6 +91,7 @@ def AddOptions(opts): opts.Add(EnumOption('platform', 'target platform', host_platform, allowed_values=('cygwin', 'darwin', 'freebsd', 'haiku', 'linux', 'sunos', 'windows'))) opts.Add(BoolOption('embedded', 'embedded build', 'no')) + opts.Add(BoolOption('analyze', 'enable static code analysis where available', 'no')) opts.Add('toolchain', 'compiler toolchain', default_toolchain) opts.Add(BoolOption('gles', 'EXPERIMENTAL: enable OpenGL ES support', 'no')) opts.Add(BoolOption('llvm', 'use LLVM', default_llvm)) diff --git a/mesalib/docs/index.html b/mesalib/docs/index.html index 3342747e7..186bda28c 100644 --- a/mesalib/docs/index.html +++ b/mesalib/docs/index.html @@ -16,6 +16,23 @@

News

+

April 18, 2014

+

+Mesa 10.1.1 is released. +This is a bug-fix release. +

+ +

April 18, 2014

+

+Mesa 10.0.5 is released. +This is a bug-fix release. +
+NOTE: Since the 10.1.1 release is being released concurrently, it is +anticipated that 10.0.5 will be the final release in the 10.0 +series. Users of 10.0 are encouraged to migrate to the 10.1 series in +order to obtain future fixes. +

+

March 12, 2014

Mesa 10.0.4 is released. diff --git a/mesalib/docs/relnotes.html b/mesalib/docs/relnotes.html index 7ec7296fc..4e2b7d6ff 100644 --- a/mesalib/docs/relnotes.html +++ b/mesalib/docs/relnotes.html @@ -21,7 +21,9 @@ The release notes summarize what's new or changed in each Mesa release.

    +
  • 10.1.1 release notes
  • 10.1 release notes +
  • 10.0.5 release notes
  • 10.0.4 release notes
  • 10.0.3 release notes
  • 10.0.2 release notes diff --git a/mesalib/docs/relnotes/10.0.5.html b/mesalib/docs/relnotes/10.0.5.html new file mode 100644 index 000000000..3e08ee1ed --- /dev/null +++ b/mesalib/docs/relnotes/10.0.5.html @@ -0,0 +1,173 @@ + + + + + Mesa Release Notes + + + + +
    +

    The Mesa 3D Graphics Library

    +
    + + +
    + +

    Mesa 10.0.5 Release Notes / April 18, 2014

    + +

    +Mesa 10.0.5 is a bug fix release which fixes bugs found since the 10.0.4 release. +

    +

    +Mesa 10.0.5 implements the OpenGL 3.3 API, but the version reported by +glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) / +glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used. +Some drivers don't support all the features required in OpenGL 3.3. OpenGL +3.3 is only available if requested at context creation +because compatibility contexts not supported. +

    + + +

    MD5 checksums

    +
    +db606aadd0fe321f3664099677d159bc  MesaLib-10.0.5.tar.gz
    +e6009ccd8898d7104bb325b6af9ec354  MesaLib-10.0.5.tar.bz2
    +c8ab9e502542bf32299a4df85b0b704d  MesaLib-10.0.5.zip
    +
    + + +

    New features

    +

    None

    + +

    Bug fixes

    + +

    This list is likely incomplete.

    + +
      + +
    • Bug 58660 - CAYMAN broken with HyperZ on
    • + +
    • Bug 64471 - Radeon HD6570 lockup in Brütal Legend with HyperZ
    • + +
    • Bug 66352 - GPU lockup in L4D2 on TURKS with HyperZ
    • + +
    • Bug 68799 - [APITRACE] Hyper-Z lockup with Falcon BMS 4.32u6 on CAYMAN
    • + +
    • Bug 71547 - compilation failure :#error "SSE4.1 instruction set not enabled"
    • + +
    • Bug 72685 - [radeonsi hyperz] Artifacts in Unigine Sanctuary
    • + +
    • Bug 73088 - [HyperZ] Juniper (6770): Gone Home / Unigine Heaven 4.0 lock up system after several minutes of use
    • + +
    • Bug 74428 - hyperz causes gpu hang in Counter-strike: Source
    • + +
    • Bug 74803 - [r600g] HyperZ broken on RV630 (Cogs shadows are broken)
    • + +
    • Bug 74863 - [r600g] HyperZ broken on RV770 and CYPRESS (Left 4 Dead 2 trees corruption) bisected!
    • + +
    • Bug 74892 - HyperZ GPU lockup with radeonsi 7970M PITCAIRN and Distance Alpha game
    • + +
    • Bug 74988 - Buffer overrun (segfault) decompressing ETC2 texture in GLBenchmark 3.0 Manhattan
    • + +
    • Bug 75279 - XCloseDisplay() takes one minute around nouveau_dri.so, freezing Firefox startup
    • + +
    • Bug 77102 - gallium nouveau has no profile in vdpau and libva
    • + +
    • Bug 77207 - [ivb/hsw] batch overwritten with garbage
    • + +
    + +

    Changes

    + +

    The full set of changes can be viewed by using the following git command:

    + +
    +  git log mesa-10.0.4..mesa-10.0.5
    +
    + +

    Alex Deucher (1):

    +
      +
    • radeon: reverse DBG_NO_HYPERZ logic
    • +
    + +

    Brian Paul (9):

    +
      +
    • mesa: add unpacking code for MESA_FORMAT_Z32_FLOAT_S8X24_UINT
    • +
    • mesa: fix copy & paste bugs in pack_ubyte_SARGB8()
    • +
    • mesa: fix copy & paste bugs in pack_ubyte_SRGB8()
    • +
    • mesa: fix unpack_Z32_FLOAT_X24S8() / unpack_Z32_FLOAT() mix-up
    • +
    • st/mesa: add null pointer checking in query object functions
    • +
    • mesa: fix glMultiDrawArrays inside a display list
    • +
    • cso: fix sampler view count in cso_set_sampler_views()
    • +
    • svga: replace sampler assertion with conditional
    • +
    • svga: move LIST_INITHEAD(dirty_buffers) earlier in svga_context_create()
    • +
    + +

    Carl Worth (3):

    +
      +
    • docs: Add md5sums for the 10.0.4 release.
    • +
    • Ignore patches which don't apply.
    • +
    • Update version to 10.0.5
    • +
    + +

    Christian König (2):

    +
      +
    • st/mesa: recreate sampler view on context change v3
    • +
    • st/mesa: fix sampler view handling with shared textures v4
    • +
    + +

    Courtney Goeltzenleuchter (1):

    +
      +
    • mesa: add bounds checking to eliminate buffer overrun
    • +
    + +

    Emil Velikov (2):

    +
      +
    • mesa: return v.value_int64 when the requested type is TYPE_INT64
    • +
    • glx: drop obsolete _XUnlock_Mutex in __glXInitialize error path
    • +
    + +

    Eric Anholt (1):

    +
      +
    • i965: Fix buffer overruns in MSAA MCS buffer clearing.
    • +
    + +

    Ilia Mirkin (6):

    +
      +
    • nouveau: fix fence waiting logic in screen destroy
    • +
    • nv50: adjust blit_3d handling of ms output textures
    • +
    • mesa/main: condition GL_DEPTH_STENCIL on ARB_depth_texture
    • +
    • nouveau: add forgotten GL_COMPRESSED_INTENSITY to texture format list
    • +
    • nouveau: there may not have been a texture if the fbo was incomplete
    • +
    • nouveau: fix firmware check on nvd7/nvd9
    • +
    + +

    Johannes Nixdorf (1):

    +
      +
    • configure.ac: fix the detection of expat with pkg-config
    • +
    + +

    Jonathan Gray (1):

    +
      +
    • gallium: add endian detection for OpenBSD
    • +
    + +

    José Fonseca (1):

    +
      +
    • draw: Duplicate TGSI tokens in draw_pipe_pstipple module.
    • +
    + +

    Matt Turner (1):

    +
      +
    • mesa: Wrap SSE4.1 code in #ifdef __SSE4_1__.
    • +
    + +

    Paul Berry (1):

    +
      +
    • i965/gen7: Prefer vertical alignment of 4 when possible.
    • +
    + +
    + + diff --git a/mesalib/docs/relnotes/10.1.1.html b/mesalib/docs/relnotes/10.1.1.html new file mode 100644 index 000000000..88997485b --- /dev/null +++ b/mesalib/docs/relnotes/10.1.1.html @@ -0,0 +1,254 @@ + + + + + Mesa Release Notes + + + + +
    +

    The Mesa 3D Graphics Library

    +
    + + +
    + +

    Mesa 10.1.1 Release Notes / April 18, 2014

    + +

    +Mesa 10.1.1 is a bug fix release which fixes bugs found since the 10.1 release. +

    +

    +Mesa 10.1.1 implements the OpenGL 3.3 API, but the version reported by +glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) / +glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used. +Some drivers don't support all the features required in OpenGL 3.3. OpenGL +3.3 is only available if requested at context creation +because compatibility contexts are not supported. +

    + + +

    MD5 checksums

    +
    +96e63674ccfa98e7ec6eb4fee3f770c3  MesaLib-10.1.1.tar.gz
    +1fde7ed079df7aeb9b6a744ca033de8d  MesaLib-10.1.1.tar.bz2
    +e64d0a562638664b13d2edf22321df59  MesaLib-10.1.1.zip
    +
    + + +

    New features

    +

    None

    + +

    Bug fixes

    + +
      + +
    • Bug 71547 - compilation failure :#error "SSE4.1 instruction set not enabled"
    • + +
    • Bug 74868 - r600g: Diablo III Crashes After a few minutes
    • + +
    • Bug 74988 - Buffer overrun (segfault) decompressing ETC2 texture in GLBenchmark 3.0 Manhattan
    • + +
    • Bug 75279 - XCloseDisplay() takes one minute around nouveau_dri.so, freezing Firefox startup
    • + +
    • Bug 75543 - OSMesa Gallium OSMesaMakeCurrent
    • + +
    • Bug 75660 - u_inlines.h:277:pipe_buffer_map_range: Assertion `length' failed.
    • + +
    • Bug 76323 - GLSL compiler ignores layout(binding=N) on uniform blocks
    • + +
    • Bug 76377 - DRI3 should only be enabled on Linux due to a udev dependency
    • + +
    • Bug 76749 - [HSW] DOTA world lighting has no effect
    • + +
    • Bug 77102 - gallium nouveau has no profile in vdpau and libva
    • + +
    • Bug 77207 - [ivb/hsw] batch overwritten with garbage
    • + +
    + +

    Changes

    + +

    Aaron Watry (1):

    +
      +
    • gallium/util: Fix memory leak
    • +
    + +

    Alexander von Gluck IV (1):

    +
      +
    • haiku: Fix build through scons corrections and viewport fixes
    • +
    + +

    Anuj Phogat (2):

    +
      +
    • mesa: Set initial internal format of a texture to GL_RGBA
    • +
    • mesa: Allow GL_DEPTH_COMPONENT and GL_DEPTH_STENCIL combinations in glTexImage{123}D()
    • +
    + +

    Brian Paul (12):

    +
      +
    • softpipe: use 64-bit arithmetic in softpipe_resource_layout()
    • +
    • mesa: don't call ctx->Driver.ClearBufferSubData() if size==0
    • +
    • st/osmesa: check buffer size when searching for buffers
    • +
    • mesa: fix copy & paste bugs in pack_ubyte_SARGB8()
    • +
    • mesa: fix copy & paste bugs in pack_ubyte_SRGB8()
    • +
    • c11/threads: don't include assert.h if the assert macro is already defined
    • +
    • mesa: fix unpack_Z32_FLOAT_X24S8() / unpack_Z32_FLOAT() mix-up
    • +
    • st/mesa: add null pointer checking in query object functions
    • +
    • mesa: fix glMultiDrawArrays inside a display list
    • +
    • cso: fix sampler view count in cso_set_sampler_views()
    • +
    • svga: replace sampler assertion with conditional
    • +
    • svga: move LIST_INITHEAD(dirty_buffers) earlier in svga_context_create()
    • +
    + +

    Carl Worth (3):

    +
      +
    • cherry-ignore: Ignore a few patches
    • +
    • glsl: Allow explicit binding on atomics again
    • +
    • Update VERSION to 10.1.1
    • +
    + +

    Chia-I Wu (1):

    +
      +
    • i965/vec4: fix record clearing in copy propagation
    • +
    + +

    Christian König (2):

    +
      +
    • st/mesa: recreate sampler view on context change v3
    • +
    • st/mesa: fix sampler view handling with shared textures v4
    • +
    + +

    Courtney Goeltzenleuchter (1):

    +
      +
    • mesa: add bounds checking to eliminate buffer overrun
    • +
    + +

    Emil Velikov (5):

    +
      +
    • nv50: add missing brackets when handling the samplers array
    • +
    • mesa: return v.value_int64 when the requested type is TYPE_INT64
    • +
    • configure: enable dri3 only for linux
    • +
    • glx: drop obsolete _XUnlock_Mutex in __glXInitialize error path
    • +
    • configure: cleanup libudev handling
    • +
    + +

    Eric Anholt (1):

    +
      +
    • i965: Fix buffer overruns in MSAA MCS buffer clearing.
    • +
    + +

    Hans (2):

    +
      +
    • util: don't define isfinite(), isnan() for MSVC >= 1800
    • +
    • mesa: don't define c99 math functions for MSVC >= 1800
    • +
    + +

    Ian Romanick (7):

    +
      +
    • linker: Split set_uniform_binding into separate functions for blocks and samplers
    • +
    • linker: Various trivial clean-ups in set_sampler_binding
    • +
    • linker: Fold set_uniform_binding into call site
    • +
    • linker: Clean up "unused parameter" warnings
    • +
    • linker: Set block bindings based on UniformBlocks rather than UniformStorage
    • +
    • linker: Set binding for all elements of UBO array
    • +
    • glsl: Propagate explicit binding information from the AST all the way to the linker
    • +
    + +

    Ilia Mirkin (8):

    +
      +
    • nouveau: fix fence waiting logic in screen destroy
    • +
    • nv50: adjust blit_3d handling of ms output textures
    • +
    • loader: add special logic to distinguish nouveau from nouveau_vieux
    • +
    • mesa/main: condition GL_DEPTH_STENCIL on ARB_depth_texture
    • +
    • nouveau: add forgotten GL_COMPRESSED_INTENSITY to texture format list
    • +
    • nouveau: there may not have been a texture if the fbo was incomplete
    • +
    • nvc0/ir: move sample id to second source arg to fix sampler2DMS
    • +
    • nouveau: fix firmware check on nvd7/nvd9
    • +
    + +

    Johannes Nixdorf (1):

    +
      +
    • configure.ac: fix the detection of expat with pkg-config
    • +
    + +

    Jonathan Gray (7):

    +
      +
    • gallium: add endian detection for OpenBSD
    • +
    • loader: use 0 instead of FALSE which isn't defined
    • +
    • loader: don't limit the non-udev path to only android
    • +
    • megadriver_stub.c: don't use _GNU_SOURCE to gate the compat code
    • +
    • egl/dri2: don't require libudev to build drm/wayland platforms
    • +
    • egl/dri2: use drm macros to construct device name
    • +
    • configure: don't require libudev for gbm or egl drm/wayland
    • +
    + +

    José Fonseca (4):

    +
      +
    • c11/threads: Fix nano to milisecond conversion.
    • +
    • mapi/u_thread: Use GetCurrentThreadId
    • +
    • c11/threads: Don't implement thrd_current on Windows.
    • +
    • draw: Duplicate TGSI tokens in draw_pipe_pstipple module.
    • +
    + +

    Kenneth Graunke (4):

    +
      +
    • i965/fs: Fix register comparisons in saturate propagation.
    • +
    • glsl: Fix lack of i2u in lower_ubo_reference.
    • +
    • i965: Stop advertising GL_MESA_ycbcr_texture.
    • +
    • glsl: Try vectorizing when seeing a repeated assignment to a channel.
    • +
    + +

    Marek Olšák (13):

    +
      +
    • r600g: fix texelFetchOffset GLSL functions
    • +
    • r600g: fix blitting the last 2 mipmap levels for Evergreen
    • +
    • mesa: fix the format of glEdgeFlagPointer
    • +
    • r600g,radeonsi: fix MAX_TEXTURE_3D_LEVELS and MAX_TEXTURE_ARRAY_LAYERS limits
    • +
    • st/mesa: fix per-vertex edge flags and GLSL support (v2)
    • +
    • mesa: mark GL_RGB9_E5 as not color-renderable
    • +
    • mesa: fix texture border handling for cube arrays
    • +
    • mesa: allow generating mipmaps for cube arrays
    • +
    • mesa: fix software fallback for generating mipmaps for cube arrays
    • +
    • mesa: fix software fallback for generating mipmaps for 3D textures
    • +
    • st/mesa: fix generating mipmaps for cube arrays
    • +
    • st/mesa: drop the lowering of quad strips to triangle strips
    • +
    • r600g: implement edge flags
    • +
    + +

    Matt Turner (4):

    +
      +
    • mesa: Wrap SSE4.1 code in #ifdef __SSE4_1__.
    • +
    • i965/fs: Fix off-by-one in saturate propagation.
    • +
    • i965/fs: Don't propagate saturate modifiers into partial writes.
    • +
    • i965/fs: Don't propagate saturation modifiers if there are source modifiers.
    • +
    + +

    Michel Dänzer (1):

    +
      +
    • r600g: Don't leak bytecode on shader compile failure
    • +
    + +

    Mike Stroyan (1):

    +
      +
    • i965: Avoid dependency hints on math opcodes
    • +
    + +

    Thomas Hellstrom (5):

    +
      +
    • winsys/svga: Replace the query mm buffer pool with a slab pool v3
    • +
    • winsys/svga: Update the vmwgfx_drm.h header to latest version from kernel
    • +
    • winsys/svga: Fix prime surface references also for guest-backed surfaces
    • +
    • st/xa: Bind destination before setting new state
    • +
    • st/xa: Make sure unused samplers are set to NULL
    • +
    + +

    Tom Stellard (1):

    +
      +
    • configure: Use LLVM shared libraries by default
    • +
    + +
    + + diff --git a/mesalib/include/GL/glext.h b/mesalib/include/GL/glext.h index 62bae4c4a..a626580bc 100644 --- a/mesalib/include/GL/glext.h +++ b/mesalib/include/GL/glext.h @@ -6,7 +6,7 @@ extern "C" { #endif /* -** Copyright (c) 2013 The Khronos Group Inc. +** Copyright (c) 2013-2014 The Khronos Group Inc. ** ** Permission is hereby granted, free of charge, to any person obtaining a ** copy of this software and/or associated documentation files (the @@ -33,7 +33,7 @@ extern "C" { ** used to make the header, and the header can be found at ** http://www.opengl.org/registry/ ** -** Khronos $Revision: 24502 $ on $Date: 2013-12-12 13:14:39 -0800 (Thu, 12 Dec 2013) $ +** Khronos $Revision: 25853 $ on $Date: 2014-03-13 03:40:45 -0700 (Thu, 13 Mar 2014) $ */ #if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) @@ -53,7 +53,7 @@ extern "C" { #define GLAPI extern #endif -#define GL_GLEXT_VERSION 20131212 +#define GL_GLEXT_VERSION 20140313 /* Generated C header for: * API: gl @@ -1485,7 +1485,7 @@ typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum target, GLenum atta typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVPROC) (GLenum pname, GLuint index, GLfloat *val); -typedef void (APIENTRYP PFNGLSAMPLEMASKIPROC) (GLuint index, GLbitfield mask); +typedef void (APIENTRYP PFNGLSAMPLEMASKIPROC) (GLuint maskNumber, GLbitfield mask); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glDrawElementsBaseVertex (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); GLAPI void APIENTRY glDrawRangeElementsBaseVertex (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); @@ -1505,7 +1505,7 @@ GLAPI void APIENTRY glFramebufferTexture (GLenum target, GLenum attachment, GLui GLAPI void APIENTRY glTexImage2DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); GLAPI void APIENTRY glTexImage3DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); GLAPI void APIENTRY glGetMultisamplefv (GLenum pname, GLuint index, GLfloat *val); -GLAPI void APIENTRY glSampleMaski (GLuint index, GLbitfield mask); +GLAPI void APIENTRY glSampleMaski (GLuint maskNumber, GLbitfield mask); #endif #endif /* GL_VERSION_3_2 */ @@ -7080,6 +7080,10 @@ GLAPI GLuint APIENTRY glCreateShaderProgramEXT (GLenum type, const GLchar *strin #define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA #endif /* GL_EXT_separate_specular_color */ +#ifndef GL_EXT_shader_image_load_formatted +#define GL_EXT_shader_image_load_formatted 1 +#endif /* GL_EXT_shader_image_load_formatted */ + #ifndef GL_EXT_shader_image_load_store #define GL_EXT_shader_image_load_store 1 #define GL_MAX_IMAGE_UNITS_EXT 0x8F38 @@ -8126,6 +8130,52 @@ GLAPI void APIENTRY glTexCoordPointervINTEL (GLint size, GLenum type, const void #endif #endif /* GL_INTEL_parallel_arrays */ +#ifndef GL_INTEL_performance_query +#define GL_INTEL_performance_query 1 +#define GL_PERFQUERY_SINGLE_CONTEXT_INTEL 0x00000000 +#define GL_PERFQUERY_GLOBAL_CONTEXT_INTEL 0x00000001 +#define GL_PERFQUERY_WAIT_INTEL 0x83FB +#define GL_PERFQUERY_FLUSH_INTEL 0x83FA +#define GL_PERFQUERY_DONOT_FLUSH_INTEL 0x83F9 +#define GL_PERFQUERY_COUNTER_EVENT_INTEL 0x94F0 +#define GL_PERFQUERY_COUNTER_DURATION_NORM_INTEL 0x94F1 +#define GL_PERFQUERY_COUNTER_DURATION_RAW_INTEL 0x94F2 +#define GL_PERFQUERY_COUNTER_THROUGHPUT_INTEL 0x94F3 +#define GL_PERFQUERY_COUNTER_RAW_INTEL 0x94F4 +#define GL_PERFQUERY_COUNTER_TIMESTAMP_INTEL 0x94F5 +#define GL_PERFQUERY_COUNTER_DATA_UINT32_INTEL 0x94F8 +#define GL_PERFQUERY_COUNTER_DATA_UINT64_INTEL 0x94F9 +#define GL_PERFQUERY_COUNTER_DATA_FLOAT_INTEL 0x94FA +#define GL_PERFQUERY_COUNTER_DATA_DOUBLE_INTEL 0x94FB +#define GL_PERFQUERY_COUNTER_DATA_BOOL32_INTEL 0x94FC +#define GL_PERFQUERY_QUERY_NAME_LENGTH_MAX_INTEL 0x94FD +#define GL_PERFQUERY_COUNTER_NAME_LENGTH_MAX_INTEL 0x94FE +#define GL_PERFQUERY_COUNTER_DESC_LENGTH_MAX_INTEL 0x94FF +#define GL_PERFQUERY_GPA_EXTENDED_COUNTERS_INTEL 0x9500 +typedef void (APIENTRYP PFNGLBEGINPERFQUERYINTELPROC) (GLuint queryHandle); +typedef void (APIENTRYP PFNGLCREATEPERFQUERYINTELPROC) (GLuint queryId, GLuint *queryHandle); +typedef void (APIENTRYP PFNGLDELETEPERFQUERYINTELPROC) (GLuint queryHandle); +typedef void (APIENTRYP PFNGLENDPERFQUERYINTELPROC) (GLuint queryHandle); +typedef void (APIENTRYP PFNGLGETFIRSTPERFQUERYIDINTELPROC) (GLuint *queryId); +typedef void (APIENTRYP PFNGLGETNEXTPERFQUERYIDINTELPROC) (GLuint queryId, GLuint *nextQueryId); +typedef void (APIENTRYP PFNGLGETPERFCOUNTERINFOINTELPROC) (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar *counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue); +typedef void (APIENTRYP PFNGLGETPERFQUERYDATAINTELPROC) (GLuint queryHandle, GLuint flags, GLsizei dataSize, GLvoid *data, GLuint *bytesWritten); +typedef void (APIENTRYP PFNGLGETPERFQUERYIDBYNAMEINTELPROC) (GLchar *queryName, GLuint *queryId); +typedef void (APIENTRYP PFNGLGETPERFQUERYINFOINTELPROC) (GLuint queryId, GLuint queryNameLength, GLchar *queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginPerfQueryINTEL (GLuint queryHandle); +GLAPI void APIENTRY glCreatePerfQueryINTEL (GLuint queryId, GLuint *queryHandle); +GLAPI void APIENTRY glDeletePerfQueryINTEL (GLuint queryHandle); +GLAPI void APIENTRY glEndPerfQueryINTEL (GLuint queryHandle); +GLAPI void APIENTRY glGetFirstPerfQueryIdINTEL (GLuint *queryId); +GLAPI void APIENTRY glGetNextPerfQueryIdINTEL (GLuint queryId, GLuint *nextQueryId); +GLAPI void APIENTRY glGetPerfCounterInfoINTEL (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar *counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue); +GLAPI void APIENTRY glGetPerfQueryDataINTEL (GLuint queryHandle, GLuint flags, GLsizei dataSize, GLvoid *data, GLuint *bytesWritten); +GLAPI void APIENTRY glGetPerfQueryIdByNameINTEL (GLchar *queryName, GLuint *queryId); +GLAPI void APIENTRY glGetPerfQueryInfoINTEL (GLuint queryId, GLuint queryNameLength, GLchar *queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask); +#endif +#endif /* GL_INTEL_performance_query */ + #ifndef GL_MESAX_texture_stack #define GL_MESAX_texture_stack 1 #define GL_TEXTURE_1D_STACK_MESAX 0x8759 @@ -8220,6 +8270,15 @@ GLAPI void APIENTRY glEndConditionalRenderNVX (void); #endif #endif /* GL_NVX_conditional_render */ +#ifndef GL_NVX_gpu_memory_info +#define GL_NVX_gpu_memory_info 1 +#define GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047 +#define GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX 0x9048 +#define GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049 +#define GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX 0x904A +#define GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B +#endif /* GL_NVX_gpu_memory_info */ + #ifndef GL_NV_bindless_multi_draw_indirect #define GL_NV_bindless_multi_draw_indirect 1 typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC) (GLenum mode, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); @@ -9372,6 +9431,17 @@ GLAPI void APIENTRY glProgramUniformui64vNV (GLuint program, GLint location, GLs #define GL_NV_shader_storage_buffer_object 1 #endif /* GL_NV_shader_storage_buffer_object */ +#ifndef GL_NV_shader_thread_group +#define GL_NV_shader_thread_group 1 +#define GL_WARP_SIZE_NV 0x9339 +#define GL_WARPS_PER_SM_NV 0x933A +#define GL_SM_COUNT_NV 0x933B +#endif /* GL_NV_shader_thread_group */ + +#ifndef GL_NV_shader_thread_shuffle +#define GL_NV_shader_thread_shuffle 1 +#endif /* GL_NV_shader_thread_shuffle */ + #ifndef GL_NV_tessellation_program5 #define GL_NV_tessellation_program5 1 #define GL_MAX_PROGRAM_PATCH_ATTRIBS_NV 0x86D8 @@ -9647,7 +9717,7 @@ typedef void (APIENTRYP PFNGLVDPAUINITNVPROC) (const void *vdpDevice, const void typedef void (APIENTRYP PFNGLVDPAUFININVPROC) (void); typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTERVIDEOSURFACENVPROC) (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC) (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); -typedef void (APIENTRYP PFNGLVDPAUISSURFACENVPROC) (GLvdpauSurfaceNV surface); +typedef GLboolean (APIENTRYP PFNGLVDPAUISSURFACENVPROC) (GLvdpauSurfaceNV surface); typedef void (APIENTRYP PFNGLVDPAUUNREGISTERSURFACENVPROC) (GLvdpauSurfaceNV surface); typedef void (APIENTRYP PFNGLVDPAUGETSURFACEIVNVPROC) (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); typedef void (APIENTRYP PFNGLVDPAUSURFACEACCESSNVPROC) (GLvdpauSurfaceNV surface, GLenum access); diff --git a/mesalib/scons/gallium.py b/mesalib/scons/gallium.py index e11d4dba3..d13d0e67b 100644 --- a/mesalib/scons/gallium.py +++ b/mesalib/scons/gallium.py @@ -36,6 +36,8 @@ import os.path import re import subprocess import platform as _platform +import sys +import tempfile import SCons.Action import SCons.Builder @@ -104,6 +106,28 @@ def num_jobs(): return 1 +def check_cc(env, cc, expr, cpp_opt = '-E'): + # Invoke C-preprocessor to determine whether the specified expression is + # true or not. + + sys.stdout.write('Checking for %s ... ' % cc) + + source = tempfile.NamedTemporaryFile(suffix='.c', delete=False) + source.write('#if !(%s)\n#error\n#endif\n' % expr) + source.close() + + pipe = SCons.Action._subproc(env, [env['CC'], cpp_opt, source.name], + stdin = 'devnull', + stderr = 'devnull', + stdout = 'devnull') + result = pipe.wait() == 0 + + os.unlink(source.name) + + sys.stdout.write(' %s\n' % ['no', 'yes'][int(bool(result))]) + return result + + def generate(env): """Common environment generation code""" @@ -137,10 +161,18 @@ def generate(env): if os.environ.has_key('LDFLAGS'): env['LINKFLAGS'] += SCons.Util.CLVar(os.environ['LDFLAGS']) - env['gcc'] = 'gcc' in os.path.basename(env['CC']).split('-') - env['msvc'] = env['CC'] == 'cl' + # Detect gcc/clang not by executable name, but through pre-defined macros + # as autoconf does, to avoid drawing wrong conclusions when using tools + # that overrice CC/CXX like scan-build. + env['gcc'] = 0 + env['clang'] = 0 + env['msvc'] = 0 + if _platform.system() == 'Windows': + env['msvc'] = check_cc(env, 'MSVC', 'defined(_MSC_VER)', '/E') + if not env['msvc']: + env['gcc'] = check_cc(env, 'GCC', 'defined(__GNUC__) && !defined(__clang__)') + env['clang'] = check_cc(env, 'Clang', '__clang__') env['suncc'] = env['platform'] == 'sunos' and os.path.basename(env['CC']) == 'cc' - env['clang'] = env['CC'] == 'clang' env['icc'] = 'icc' == os.path.basename(env['CC']) if env['msvc'] and env['toolchain'] == 'default' and env['machine'] == 'x86_64': @@ -452,6 +484,18 @@ def generate(env): env.Append(CCFLAGS = ['/MT']) env.Append(SHCCFLAGS = ['/LD']) + # Static code analysis + if env['analyze']: + if env['msvc']: + # http://msdn.microsoft.com/en-us/library/ms173498.aspx + env.Append(CCFLAGS = [ + '/analyze', + #'/analyze:log', '${TARGET.base}.xml', + ]) + if env['clang']: + # scan-build will produce more comprehensive output + env.Append(CCFLAGS = ['--analyze']) + # Assembler options if gcc_compat: if env['machine'] == 'x86': diff --git a/mesalib/src/gallium/auxiliary/util/u_debug.c b/mesalib/src/gallium/auxiliary/util/u_debug.c index ae248e020..dc840e856 100644 --- a/mesalib/src/gallium/auxiliary/util/u_debug.c +++ b/mesalib/src/gallium/auxiliary/util/u_debug.c @@ -274,10 +274,7 @@ void _debug_assert_fail(const char *expr, const char *function) { _debug_printf("%s:%u:%s: Assertion `%s' failed.\n", file, line, function, expr); - if (debug_get_bool_option("GALLIUM_ABORT_ON_ASSERT", TRUE)) - os_abort(); - else - _debug_printf("continuing...\n"); + os_abort(); } @@ -337,10 +334,10 @@ debug_dump_flags(const struct debug_named_value *names, while(names->name) { if((names->value & value) == names->value) { if (!first) - util_strncat(output, "|", sizeof(output)); + util_strncat(output, "|", sizeof(output) - strlen(output) - 1); else first = 0; - util_strncat(output, names->name, sizeof(output) - 1); + util_strncat(output, names->name, sizeof(output) - strlen(output) - 1); output[sizeof(output) - 1] = '\0'; value &= ~names->value; } @@ -349,12 +346,12 @@ debug_dump_flags(const struct debug_named_value *names, if (value) { if (!first) - util_strncat(output, "|", sizeof(output)); + util_strncat(output, "|", sizeof(output) - strlen(output) - 1); else first = 0; util_snprintf(rest, sizeof(rest), "0x%08lx", value); - util_strncat(output, rest, sizeof(output) - 1); + util_strncat(output, rest, sizeof(output) - strlen(output) - 1); output[sizeof(output) - 1] = '\0'; } diff --git a/mesalib/src/gallium/auxiliary/util/u_debug.h b/mesalib/src/gallium/auxiliary/util/u_debug.h index 9e4eb41dc..9c414211b 100644 --- a/mesalib/src/gallium/auxiliary/util/u_debug.h +++ b/mesalib/src/gallium/auxiliary/util/u_debug.h @@ -151,10 +151,17 @@ void debug_print_format(const char *msg, unsigned fmt ); long debug_get_num_option(const char *name, long dfault); +#ifdef _MSC_VER +__declspec(noreturn) +#endif void _debug_assert_fail(const char *expr, const char *file, unsigned line, - const char *function); + const char *function) +#ifdef __GNUC__ + __attribute__((__noreturn__)) +#endif +; /** diff --git a/mesalib/src/glsl/ast_to_hir.cpp b/mesalib/src/glsl/ast_to_hir.cpp index 717dc68ea..0411befa9 100644 --- a/mesalib/src/glsl/ast_to_hir.cpp +++ b/mesalib/src/glsl/ast_to_hir.cpp @@ -174,7 +174,7 @@ _mesa_ast_to_hir(exec_list *instructions, struct _mesa_glsl_parse_state *state) */ bool apply_implicit_conversion(const glsl_type *to, ir_rvalue * &from, - struct _mesa_glsl_parse_state *state) + struct _mesa_glsl_parse_state *state) { void *ctx = state; if (to->base_type == from->type->base_type) @@ -225,8 +225,8 @@ apply_implicit_conversion(const glsl_type *to, ir_rvalue * &from, static const struct glsl_type * arithmetic_result_type(ir_rvalue * &value_a, ir_rvalue * &value_b, - bool multiply, - struct _mesa_glsl_parse_state *state, YYLTYPE *loc) + bool multiply, + struct _mesa_glsl_parse_state *state, YYLTYPE *loc) { const glsl_type *type_a = value_a->type; const glsl_type *type_b = value_b->type; @@ -239,7 +239,7 @@ arithmetic_result_type(ir_rvalue * &value_a, ir_rvalue * &value_b, */ if (!type_a->is_numeric() || !type_b->is_numeric()) { _mesa_glsl_error(loc, state, - "operands to arithmetic operators must be numeric"); + "operands to arithmetic operators must be numeric"); return glsl_type::error_type; } @@ -251,8 +251,8 @@ arithmetic_result_type(ir_rvalue * &value_a, ir_rvalue * &value_b, if (!apply_implicit_conversion(type_a, value_b, state) && !apply_implicit_conversion(type_b, value_a, state)) { _mesa_glsl_error(loc, state, - "could not implicitly convert operands to " - "arithmetic operator"); + "could not implicitly convert operands to " + "arithmetic operator"); return glsl_type::error_type; } type_a = value_a->type; @@ -269,7 +269,7 @@ arithmetic_result_type(ir_rvalue * &value_a, ir_rvalue * &value_b, */ if (type_a->base_type != type_b->base_type) { _mesa_glsl_error(loc, state, - "base type mismatch for arithmetic operator"); + "base type mismatch for arithmetic operator"); return glsl_type::error_type; } @@ -291,7 +291,7 @@ arithmetic_result_type(ir_rvalue * &value_a, ir_rvalue * &value_b, */ if (type_a->is_scalar()) { if (!type_b->is_scalar()) - return type_b; + return type_b; } else if (type_b->is_scalar()) { return type_a; } @@ -309,11 +309,11 @@ arithmetic_result_type(ir_rvalue * &value_a, ir_rvalue * &value_b, */ if (type_a->is_vector() && type_b->is_vector()) { if (type_a == type_b) { - return type_a; + return type_a; } else { - _mesa_glsl_error(loc, state, - "vector size mismatch for arithmetic operator"); - return glsl_type::error_type; + _mesa_glsl_error(loc, state, + "vector size mismatch for arithmetic operator"); + return glsl_type::error_type; } } @@ -344,64 +344,64 @@ arithmetic_result_type(ir_rvalue * &value_a, ir_rvalue * &value_b, */ if (! multiply) { if (type_a == type_b) - return type_a; + return type_a; } else { if (type_a->is_matrix() && type_b->is_matrix()) { - /* Matrix multiply. The columns of A must match the rows of B. Given - * the other previously tested constraints, this means the vector type - * of a row from A must be the same as the vector type of a column from - * B. - */ - if (type_a->row_type() == type_b->column_type()) { - /* The resulting matrix has the number of columns of matrix B and - * the number of rows of matrix A. We get the row count of A by - * looking at the size of a vector that makes up a column. The - * transpose (size of a row) is done for B. - */ - const glsl_type *const type = - glsl_type::get_instance(type_a->base_type, - type_a->column_type()->vector_elements, - type_b->row_type()->vector_elements); - assert(type != glsl_type::error_type); - - return type; - } + /* Matrix multiply. The columns of A must match the rows of B. Given + * the other previously tested constraints, this means the vector type + * of a row from A must be the same as the vector type of a column from + * B. + */ + if (type_a->row_type() == type_b->column_type()) { + /* The resulting matrix has the number of columns of matrix B and + * the number of rows of matrix A. We get the row count of A by + * looking at the size of a vector that makes up a column. The + * transpose (size of a row) is done for B. + */ + const glsl_type *const type = + glsl_type::get_instance(type_a->base_type, + type_a->column_type()->vector_elements, + type_b->row_type()->vector_elements); + assert(type != glsl_type::error_type); + + return type; + } } else if (type_a->is_matrix()) { - /* A is a matrix and B is a column vector. Columns of A must match - * rows of B. Given the other previously tested constraints, this - * means the vector type of a row from A must be the same as the - * vector the type of B. - */ - if (type_a->row_type() == type_b) { - /* The resulting vector has a number of elements equal to - * the number of rows of matrix A. */ - const glsl_type *const type = - glsl_type::get_instance(type_a->base_type, - type_a->column_type()->vector_elements, - 1); - assert(type != glsl_type::error_type); - - return type; - } + /* A is a matrix and B is a column vector. Columns of A must match + * rows of B. Given the other previously tested constraints, this + * means the vector type of a row from A must be the same as the + * vector the type of B. + */ + if (type_a->row_type() == type_b) { + /* The resulting vector has a number of elements equal to + * the number of rows of matrix A. */ + const glsl_type *const type = + glsl_type::get_instance(type_a->base_type, + type_a->column_type()->vector_elements, + 1); + assert(type != glsl_type::error_type); + + return type; + } } else { - assert(type_b->is_matrix()); - - /* A is a row vector and B is a matrix. Columns of A must match rows - * of B. Given the other previously tested constraints, this means - * the type of A must be the same as the vector type of a column from - * B. - */ - if (type_a == type_b->column_type()) { - /* The resulting vector has a number of elements equal to - * the number of columns of matrix B. */ - const glsl_type *const type = - glsl_type::get_instance(type_a->base_type, - type_b->row_type()->vector_elements, - 1); - assert(type != glsl_type::error_type); - - return type; - } + assert(type_b->is_matrix()); + + /* A is a row vector and B is a matrix. Columns of A must match rows + * of B. Given the other previously tested constraints, this means + * the type of A must be the same as the vector type of a column from + * B. + */ + if (type_a == type_b->column_type()) { + /* The resulting vector has a number of elements equal to + * the number of columns of matrix B. */ + const glsl_type *const type = + glsl_type::get_instance(type_a->base_type, + type_b->row_type()->vector_elements, + 1); + assert(type != glsl_type::error_type); + + return type; + } } _mesa_glsl_error(loc, state, "size mismatch for matrix multiplication"); @@ -418,7 +418,7 @@ arithmetic_result_type(ir_rvalue * &value_a, ir_rvalue * &value_b, static const struct glsl_type * unary_arithmetic_result_type(const struct glsl_type *type, - struct _mesa_glsl_parse_state *state, YYLTYPE *loc) + struct _mesa_glsl_parse_state *state, YYLTYPE *loc) { /* From GLSL 1.50 spec, page 57: * @@ -430,7 +430,7 @@ unary_arithmetic_result_type(const struct glsl_type *type, */ if (!type->is_numeric()) { _mesa_glsl_error(loc, state, - "operands to arithmetic operators must be numeric"); + "operands to arithmetic operators must be numeric"); return glsl_type::error_type; } @@ -504,8 +504,8 @@ bit_logic_result_type(const struct glsl_type *type_a, static const struct glsl_type * modulus_result_type(const struct glsl_type *type_a, - const struct glsl_type *type_b, - struct _mesa_glsl_parse_state *state, YYLTYPE *loc) + const struct glsl_type *type_b, + struct _mesa_glsl_parse_state *state, YYLTYPE *loc) { if (!state->check_version(130, 300, loc, "operator '%%' is reserved")) { return glsl_type::error_type; @@ -526,7 +526,7 @@ modulus_result_type(const struct glsl_type *type_a, } if (type_a->base_type != type_b->base_type) { _mesa_glsl_error(loc, state, - "operands of %% must have the same base type"); + "operands of %% must have the same base type"); return glsl_type::error_type; } @@ -537,8 +537,8 @@ modulus_result_type(const struct glsl_type *type_a, */ if (type_a->is_vector()) { if (!type_b->is_vector() - || (type_a->vector_elements == type_b->vector_elements)) - return type_a; + || (type_a->vector_elements == type_b->vector_elements)) + return type_a; } else return type_b; @@ -552,7 +552,7 @@ modulus_result_type(const struct glsl_type *type_a, static const struct glsl_type * relational_result_type(ir_rvalue * &value_a, ir_rvalue * &value_b, - struct _mesa_glsl_parse_state *state, YYLTYPE *loc) + struct _mesa_glsl_parse_state *state, YYLTYPE *loc) { const glsl_type *type_a = value_a->type; const glsl_type *type_b = value_b->type; @@ -567,8 +567,8 @@ relational_result_type(ir_rvalue * &value_a, ir_rvalue * &value_b, || !type_a->is_scalar() || !type_b->is_scalar()) { _mesa_glsl_error(loc, state, - "operands to relational operators must be scalar and " - "numeric"); + "operands to relational operators must be scalar and " + "numeric"); return glsl_type::error_type; } @@ -579,8 +579,8 @@ relational_result_type(ir_rvalue * &value_a, ir_rvalue * &value_b, if (!apply_implicit_conversion(type_a, value_b, state) && !apply_implicit_conversion(type_b, value_a, state)) { _mesa_glsl_error(loc, state, - "could not implicitly convert operands to " - "relational operator"); + "could not implicitly convert operands to " + "relational operator"); return glsl_type::error_type; } type_a = value_a->type; @@ -623,13 +623,13 @@ shift_result_type(const struct glsl_type *type_a, */ if (!type_a->is_integer()) { _mesa_glsl_error(loc, state, "LHS of operator %s must be an integer or " - "integer vector", ast_expression::operator_string(op)); + "integer vector", ast_expression::operator_string(op)); return glsl_type::error_type; } if (!type_b->is_integer()) { _mesa_glsl_error(loc, state, "RHS of operator %s must be an integer or " - "integer vector", ast_expression::operator_string(op)); + "integer vector", ast_expression::operator_string(op)); return glsl_type::error_type; } @@ -638,8 +638,8 @@ shift_result_type(const struct glsl_type *type_a, */ if (type_a->is_scalar() && !type_b->is_scalar()) { _mesa_glsl_error(loc, state, "if the first operand of %s is scalar, the " - "second must be scalar as well", - ast_expression::operator_string(op)); + "second must be scalar as well", + ast_expression::operator_string(op)); return glsl_type::error_type; } @@ -650,8 +650,8 @@ shift_result_type(const struct glsl_type *type_a, type_b->is_vector() && type_a->vector_elements != type_b->vector_elements) { _mesa_glsl_error(loc, state, "vector operands to operator %s must " - "have same number of elements", - ast_expression::operator_string(op)); + "have same number of elements", + ast_expression::operator_string(op)); return glsl_type::error_type; } @@ -738,11 +738,11 @@ mark_whole_array_access(ir_rvalue *access) static bool do_assignment(exec_list *instructions, struct _mesa_glsl_parse_state *state, - const char *non_lvalue_description, - ir_rvalue *lhs, ir_rvalue *rhs, + const char *non_lvalue_description, + ir_rvalue *lhs, ir_rvalue *rhs, ir_rvalue **out_rvalue, bool needs_rvalue, bool is_initializer, - YYLTYPE lhs_loc) + YYLTYPE lhs_loc) { void *ctx = state; bool error_emitted = (lhs->type->is_error() || rhs->type->is_error()); @@ -792,30 +792,29 @@ do_assignment(exec_list *instructions, struct _mesa_glsl_parse_state *state, if (non_lvalue_description != NULL) { _mesa_glsl_error(&lhs_loc, state, "assignment to %s", - non_lvalue_description); - error_emitted = true; + non_lvalue_description); + error_emitted = true; } else if (lhs->variable_referenced() != NULL - && lhs->variable_referenced()->data.read_only) { + && lhs->variable_referenced()->data.read_only) { _mesa_glsl_error(&lhs_loc, state, "assignment to read-only variable '%s'", lhs->variable_referenced()->name); error_emitted = true; - } else if (lhs->type->is_array() && !state->check_version(120, 300, &lhs_loc, "whole array assignment forbidden")) { - /* From page 32 (page 38 of the PDF) of the GLSL 1.10 spec: - * - * "Other binary or unary expressions, non-dereferenced - * arrays, function names, swizzles with repeated fields, - * and constants cannot be l-values." + /* From page 32 (page 38 of the PDF) of the GLSL 1.10 spec: + * + * "Other binary or unary expressions, non-dereferenced + * arrays, function names, swizzles with repeated fields, + * and constants cannot be l-values." * * The restriction on arrays is lifted in GLSL 1.20 and GLSL ES 3.00. - */ - error_emitted = true; + */ + error_emitted = true; } else if (!lhs->is_lvalue()) { - _mesa_glsl_error(& lhs_loc, state, "non-lvalue in assignment"); - error_emitted = true; + _mesa_glsl_error(& lhs_loc, state, "non-lvalue in assignment"); + error_emitted = true; } } @@ -830,24 +829,24 @@ do_assignment(exec_list *instructions, struct _mesa_glsl_parse_state *state, * is either not an l-value or not a whole array. */ if (lhs->type->is_unsized_array()) { - ir_dereference *const d = lhs->as_dereference(); + ir_dereference *const d = lhs->as_dereference(); - assert(d != NULL); + assert(d != NULL); - ir_variable *const var = d->variable_referenced(); + ir_variable *const var = d->variable_referenced(); - assert(var != NULL); + assert(var != NULL); - if (var->data.max_array_access >= unsigned(rhs->type->array_size())) { - /* FINISHME: This should actually log the location of the RHS. */ - _mesa_glsl_error(& lhs_loc, state, "array size must be > %u due to " - "previous access", - var->data.max_array_access); - } + if (var->data.max_array_access >= unsigned(rhs->type->array_size())) { + /* FINISHME: This should actually log the location of the RHS. */ + _mesa_glsl_error(& lhs_loc, state, "array size must be > %u due to " + "previous access", + var->data.max_array_access); + } - var->type = glsl_type::get_array_instance(lhs->type->element_type(), - rhs->type->array_size()); - d->type = var->type; + var->type = glsl_type::get_array_instance(lhs->type->element_type(), + rhs->type->array_size()); + d->type = var->type; } if (lhs->type->is_array()) { mark_whole_array_access(rhs); @@ -908,8 +907,7 @@ get_lvalue_copy(exec_list *instructions, ir_rvalue *lvalue) ir_rvalue * -ast_node::hir(exec_list *instructions, - struct _mesa_glsl_parse_state *state) +ast_node::hir(exec_list *instructions, struct _mesa_glsl_parse_state *state) { (void) instructions; (void) state; @@ -951,19 +949,19 @@ do_comparison(void *mem_ctx, int operation, ir_rvalue *op0, ir_rvalue *op1) case GLSL_TYPE_ARRAY: { for (unsigned int i = 0; i < op0->type->length; i++) { - ir_rvalue *e0, *e1, *result; - - e0 = new(mem_ctx) ir_dereference_array(op0->clone(mem_ctx, NULL), - new(mem_ctx) ir_constant(i)); - e1 = new(mem_ctx) ir_dereference_array(op1->clone(mem_ctx, NULL), - new(mem_ctx) ir_constant(i)); - result = do_comparison(mem_ctx, operation, e0, e1); - - if (cmp) { - cmp = new(mem_ctx) ir_expression(join_op, cmp, result); - } else { - cmp = result; - } + ir_rvalue *e0, *e1, *result; + + e0 = new(mem_ctx) ir_dereference_array(op0->clone(mem_ctx, NULL), + new(mem_ctx) ir_constant(i)); + e1 = new(mem_ctx) ir_dereference_array(op1->clone(mem_ctx, NULL), + new(mem_ctx) ir_constant(i)); + result = do_comparison(mem_ctx, operation, e0, e1); + + if (cmp) { + cmp = new(mem_ctx) ir_expression(join_op, cmp, result); + } else { + cmp = result; + } } mark_whole_array_access(op0); @@ -973,20 +971,20 @@ do_comparison(void *mem_ctx, int operation, ir_rvalue *op0, ir_rvalue *op1) case GLSL_TYPE_STRUCT: { for (unsigned int i = 0; i < op0->type->length; i++) { - ir_rvalue *e0, *e1, *result; - const char *field_name = op0->type->fields.structure[i].name; - - e0 = new(mem_ctx) ir_dereference_record(op0->clone(mem_ctx, NULL), - field_name); - e1 = new(mem_ctx) ir_dereference_record(op1->clone(mem_ctx, NULL), - field_name); - result = do_comparison(mem_ctx, operation, e0, e1); - - if (cmp) { - cmp = new(mem_ctx) ir_expression(join_op, cmp, result); - } else { - cmp = result; - } + ir_rvalue *e0, *e1, *result; + const char *field_name = op0->type->fields.structure[i].name; + + e0 = new(mem_ctx) ir_dereference_record(op0->clone(mem_ctx, NULL), + field_name); + e1 = new(mem_ctx) ir_dereference_record(op1->clone(mem_ctx, NULL), + field_name); + result = do_comparison(mem_ctx, operation, e0, e1); + + if (cmp) { + cmp = new(mem_ctx) ir_expression(join_op, cmp, result); + } else { + cmp = result; + } } break; } @@ -1031,8 +1029,8 @@ get_scalar_boolean_operand(exec_list *instructions, if (!*error_emitted) { YYLTYPE loc = expr->get_location(); _mesa_glsl_error(&loc, state, "%s of `%s' must be scalar boolean", - operand_name, - parent_expr->operator_string(parent_expr->oper)); + operand_name, + parent_expr->operator_string(parent_expr->oper)); *error_emitted = true; } @@ -1098,7 +1096,7 @@ constant_one_for_inc_dec(void *ctx, const glsl_type *type) ir_rvalue * ast_expression::hir(exec_list *instructions, - struct _mesa_glsl_parse_state *state) + struct _mesa_glsl_parse_state *state) { return do_hir(instructions, state, true); } @@ -1181,8 +1179,8 @@ ast_expression::do_hir(exec_list *instructions, switch (this->oper) { case ast_aggregate: - assert(!"ast_aggregate: Should never get here."); - break; + assert(!"ast_aggregate: Should never get here."); + break; case ast_assign: { op[0] = this->subexpressions[0]->hir(instructions, state); @@ -1214,7 +1212,7 @@ ast_expression::do_hir(exec_list *instructions, error_emitted = type->is_error(); result = new(ctx) ir_expression(operations[this->oper], type, - op[0], NULL); + op[0], NULL); break; case ast_add: @@ -1225,12 +1223,12 @@ ast_expression::do_hir(exec_list *instructions, op[1] = this->subexpressions[1]->hir(instructions, state); type = arithmetic_result_type(op[0], op[1], - (this->oper == ast_mul), - state, & loc); + (this->oper == ast_mul), + state, & loc); error_emitted = type->is_error(); result = new(ctx) ir_expression(operations[this->oper], type, - op[0], op[1]); + op[0], op[1]); break; case ast_mod: @@ -1242,7 +1240,7 @@ ast_expression::do_hir(exec_list *instructions, assert(operations[this->oper] == ir_binop_mod); result = new(ctx) ir_expression(operations[this->oper], type, - op[0], op[1]); + op[0], op[1]); error_emitted = type->is_error(); break; @@ -1278,7 +1276,7 @@ ast_expression::do_hir(exec_list *instructions, && type->is_scalar())); result = new(ctx) ir_expression(operations[this->oper], type, - op[0], op[1]); + op[0], op[1]); error_emitted = type->is_error(); break; @@ -1297,15 +1295,15 @@ ast_expression::do_hir(exec_list *instructions, * case this conversion is done." */ if ((!apply_implicit_conversion(op[0]->type, op[1], state) - && !apply_implicit_conversion(op[1]->type, op[0], state)) - || (op[0]->type != op[1]->type)) { - _mesa_glsl_error(& loc, state, "operands of `%s' must have the same " - "type", (this->oper == ast_equal) ? "==" : "!="); - error_emitted = true; + && !apply_implicit_conversion(op[1]->type, op[0], state)) + || (op[0]->type != op[1]->type)) { + _mesa_glsl_error(& loc, state, "operands of `%s' must have the same " + "type", (this->oper == ast_equal) ? "==" : "!="); + error_emitted = true; } else if ((op[0]->type->is_array() || op[1]->type->is_array()) && !state->check_version(120, 300, &loc, "array comparisons forbidden")) { - error_emitted = true; + error_emitted = true; } else if ((op[0]->type->contains_opaque() || op[1]->type->contains_opaque())) { _mesa_glsl_error(&loc, state, "opaque type comparisons forbidden"); @@ -1313,10 +1311,10 @@ ast_expression::do_hir(exec_list *instructions, } if (error_emitted) { - result = new(ctx) ir_constant(false); + result = new(ctx) ir_constant(false); } else { - result = do_comparison(ctx, operations[this->oper], op[0], op[1]); - assert(result->type == glsl_type::bool_type); + result = do_comparison(ctx, operations[this->oper], op[0], op[1]); + assert(result->type == glsl_type::bool_type); } break; @@ -1328,7 +1326,7 @@ ast_expression::do_hir(exec_list *instructions, type = bit_logic_result_type(op[0]->type, op[1]->type, this->oper, state, &loc); result = new(ctx) ir_expression(operations[this->oper], type, - op[0], op[1]); + op[0], op[1]); error_emitted = op[0]->type->is_error() || op[1]->type->is_error(); break; @@ -1336,12 +1334,12 @@ ast_expression::do_hir(exec_list *instructions, op[0] = this->subexpressions[0]->hir(instructions, state); if (!state->check_bitwise_operations_allowed(&loc)) { - error_emitted = true; + error_emitted = true; } if (!op[0]->type->is_integer()) { - _mesa_glsl_error(&loc, state, "operand of `~' must be an integer"); - error_emitted = true; + _mesa_glsl_error(&loc, state, "operand of `~' must be an integer"); + error_emitted = true; } type = error_emitted ? glsl_type::error_type : op[0]->type; @@ -1351,35 +1349,35 @@ ast_expression::do_hir(exec_list *instructions, case ast_logic_and: { exec_list rhs_instructions; op[0] = get_scalar_boolean_operand(instructions, state, this, 0, - "LHS", &error_emitted); + "LHS", &error_emitted); op[1] = get_scalar_boolean_operand(&rhs_instructions, state, this, 1, - "RHS", &error_emitted); + "RHS", &error_emitted); if (rhs_instructions.is_empty()) { - result = new(ctx) ir_expression(ir_binop_logic_and, op[0], op[1]); - type = result->type; + result = new(ctx) ir_expression(ir_binop_logic_and, op[0], op[1]); + type = result->type; } else { - ir_variable *const tmp = new(ctx) ir_variable(glsl_type::bool_type, - "and_tmp", - ir_var_temporary); - instructions->push_tail(tmp); - - ir_if *const stmt = new(ctx) ir_if(op[0]); - instructions->push_tail(stmt); - - stmt->then_instructions.append_list(&rhs_instructions); - ir_dereference *const then_deref = new(ctx) ir_dereference_variable(tmp); - ir_assignment *const then_assign = - new(ctx) ir_assignment(then_deref, op[1]); - stmt->then_instructions.push_tail(then_assign); - - ir_dereference *const else_deref = new(ctx) ir_dereference_variable(tmp); - ir_assignment *const else_assign = - new(ctx) ir_assignment(else_deref, new(ctx) ir_constant(false)); - stmt->else_instructions.push_tail(else_assign); - - result = new(ctx) ir_dereference_variable(tmp); - type = tmp->type; + ir_variable *const tmp = new(ctx) ir_variable(glsl_type::bool_type, + "and_tmp", + ir_var_temporary); + instructions->push_tail(tmp); + + ir_if *const stmt = new(ctx) ir_if(op[0]); + instructions->push_tail(stmt); + + stmt->then_instructions.append_list(&rhs_instructions); + ir_dereference *const then_deref = new(ctx) ir_dereference_variable(tmp); + ir_assignment *const then_assign = + new(ctx) ir_assignment(then_deref, op[1]); + stmt->then_instructions.push_tail(then_assign); + + ir_dereference *const else_deref = new(ctx) ir_dereference_variable(tmp); + ir_assignment *const else_assign = + new(ctx) ir_assignment(else_deref, new(ctx) ir_constant(false)); + stmt->else_instructions.push_tail(else_assign); + + result = new(ctx) ir_dereference_variable(tmp); + type = tmp->type; } break; } @@ -1387,35 +1385,35 @@ ast_expression::do_hir(exec_list *instructions, case ast_logic_or: { exec_list rhs_instructions; op[0] = get_scalar_boolean_operand(instructions, state, this, 0, - "LHS", &error_emitted); + "LHS", &error_emitted); op[1] = get_scalar_boolean_operand(&rhs_instructions, state, this, 1, - "RHS", &error_emitted); + "RHS", &error_emitted); if (rhs_instructions.is_empty()) { - result = new(ctx) ir_expression(ir_binop_logic_or, op[0], op[1]); - type = result->type; + result = new(ctx) ir_expression(ir_binop_logic_or, op[0], op[1]); + type = result->type; } else { - ir_variable *const tmp = new(ctx) ir_variable(glsl_type::bool_type, - "or_tmp", - ir_var_temporary); - instructions->push_tail(tmp); - - ir_if *const stmt = new(ctx) ir_if(op[0]); - instructions->push_tail(stmt); - - ir_dereference *const then_deref = new(ctx) ir_dereference_variable(tmp); - ir_assignment *const then_assign = - new(ctx) ir_assignment(then_deref, new(ctx) ir_constant(true)); - stmt->then_instructions.push_tail(then_assign); - - stmt->else_instructions.append_list(&rhs_instructions); - ir_dereference *const else_deref = new(ctx) ir_dereference_variable(tmp); - ir_assignment *const else_assign = - new(ctx) ir_assignment(else_deref, op[1]); - stmt->else_instructions.push_tail(else_assign); - - result = new(ctx) ir_dereference_variable(tmp); - type = tmp->type; + ir_variable *const tmp = new(ctx) ir_variable(glsl_type::bool_type, + "or_tmp", + ir_var_temporary); + instructions->push_tail(tmp); + + ir_if *const stmt = new(ctx) ir_if(op[0]); + instructions->push_tail(stmt); + + ir_dereference *const then_deref = new(ctx) ir_dereference_variable(tmp); + ir_assignment *const then_assign = + new(ctx) ir_assignment(then_deref, new(ctx) ir_constant(true)); + stmt->then_instructions.push_tail(then_assign); + + stmt->else_instructions.append_list(&rhs_instructions); + ir_dereference *const else_deref = new(ctx) ir_dereference_variable(tmp); + ir_assignment *const else_assign = + new(ctx) ir_assignment(else_deref, op[1]); + stmt->else_instructions.push_tail(else_assign); + + result = new(ctx) ir_dereference_variable(tmp); + type = tmp->type; } break; } @@ -1428,20 +1426,20 @@ ast_expression::do_hir(exec_list *instructions, * expressions and result in a Boolean expression." */ op[0] = get_scalar_boolean_operand(instructions, state, this, 0, "LHS", - &error_emitted); + &error_emitted); op[1] = get_scalar_boolean_operand(instructions, state, this, 1, "RHS", - &error_emitted); + &error_emitted); result = new(ctx) ir_expression(operations[this->oper], glsl_type::bool_type, - op[0], op[1]); + op[0], op[1]); break; case ast_logic_not: op[0] = get_scalar_boolean_operand(instructions, state, this, 0, - "operand", &error_emitted); + "operand", &error_emitted); result = new(ctx) ir_expression(operations[this->oper], glsl_type::bool_type, - op[0], NULL); + op[0], NULL); break; case ast_mul_assign: @@ -1452,11 +1450,11 @@ ast_expression::do_hir(exec_list *instructions, op[1] = this->subexpressions[1]->hir(instructions, state); type = arithmetic_result_type(op[0], op[1], - (this->oper == ast_mul_assign), - state, & loc); + (this->oper == ast_mul_assign), + state, & loc); ir_rvalue *temp_rhs = new(ctx) ir_expression(operations[this->oper], type, - op[0], op[1]); + op[0], op[1]); error_emitted = do_assignment(instructions, state, @@ -1483,7 +1481,7 @@ ast_expression::do_hir(exec_list *instructions, ir_rvalue *temp_rhs; temp_rhs = new(ctx) ir_expression(operations[this->oper], type, - op[0], op[1]); + op[0], op[1]); error_emitted = do_assignment(instructions, state, @@ -1537,7 +1535,7 @@ ast_expression::do_hir(exec_list *instructions, * first expression, which must result in a scalar Boolean." */ op[0] = get_scalar_boolean_operand(instructions, state, this, 0, - "condition", &error_emitted); + "condition", &error_emitted); /* The :? operator is implemented by generating an anonymous temporary * followed by an if-statement. The last instruction in each branch of @@ -1560,16 +1558,16 @@ ast_expression::do_hir(exec_list *instructions, * expression." */ if ((!apply_implicit_conversion(op[1]->type, op[2], state) - && !apply_implicit_conversion(op[2]->type, op[1], state)) - || (op[1]->type != op[2]->type)) { - YYLTYPE loc = this->subexpressions[1]->get_location(); - - _mesa_glsl_error(& loc, state, "second and third operands of ?: " - "operator must have matching types"); - error_emitted = true; - type = glsl_type::error_type; + && !apply_implicit_conversion(op[2]->type, op[1], state)) + || (op[1]->type != op[2]->type)) { + YYLTYPE loc = this->subexpressions[1]->get_location(); + + _mesa_glsl_error(& loc, state, "second and third operands of ?: " + "operator must have matching types"); + error_emitted = true; + type = glsl_type::error_type; } else { - type = op[1]->type; + type = op[1]->type; } /* From page 33 (page 39 of the PDF) of the GLSL 1.10 spec: @@ -1581,7 +1579,7 @@ ast_expression::do_hir(exec_list *instructions, !state->check_version(120, 300, &loc, "second and third operands of ?: operator " "cannot be arrays")) { - error_emitted = true; + error_emitted = true; } ir_constant *cond_val = op[0]->constant_expression_value(); @@ -1589,32 +1587,32 @@ ast_expression::do_hir(exec_list *instructions, ir_constant *else_val = op[2]->constant_expression_value(); if (then_instructions.is_empty() - && else_instructions.is_empty() - && (cond_val != NULL) && (then_val != NULL) && (else_val != NULL)) { - result = (cond_val->value.b[0]) ? then_val : else_val; + && else_instructions.is_empty() + && (cond_val != NULL) && (then_val != NULL) && (else_val != NULL)) { + result = (cond_val->value.b[0]) ? then_val : else_val; } else { - ir_variable *const tmp = - new(ctx) ir_variable(type, "conditional_tmp", ir_var_temporary); - instructions->push_tail(tmp); - - ir_if *const stmt = new(ctx) ir_if(op[0]); - instructions->push_tail(stmt); - - then_instructions.move_nodes_to(& stmt->then_instructions); - ir_dereference *const then_deref = - new(ctx) ir_dereference_variable(tmp); - ir_assignment *const then_assign = - new(ctx) ir_assignment(then_deref, op[1]); - stmt->then_instructions.push_tail(then_assign); - - else_instructions.move_nodes_to(& stmt->else_instructions); - ir_dereference *const else_deref = - new(ctx) ir_dereference_variable(tmp); - ir_assignment *const else_assign = - new(ctx) ir_assignment(else_deref, op[2]); - stmt->else_instructions.push_tail(else_assign); - - result = new(ctx) ir_dereference_variable(tmp); + ir_variable *const tmp = + new(ctx) ir_variable(type, "conditional_tmp", ir_var_temporary); + instructions->push_tail(tmp); + + ir_if *const stmt = new(ctx) ir_if(op[0]); + instructions->push_tail(stmt); + + then_instructions.move_nodes_to(& stmt->then_instructions); + ir_dereference *const then_deref = + new(ctx) ir_dereference_variable(tmp); + ir_assignment *const then_assign = + new(ctx) ir_assignment(then_deref, op[1]); + stmt->then_instructions.push_tail(then_assign); + + else_instructions.move_nodes_to(& stmt->else_instructions); + ir_dereference *const else_deref = + new(ctx) ir_dereference_variable(tmp); + ir_assignment *const else_assign = + new(ctx) ir_assignment(else_deref, op[2]); + stmt->else_instructions.push_tail(else_assign); + + result = new(ctx) ir_dereference_variable(tmp); } break; } @@ -1622,7 +1620,7 @@ ast_expression::do_hir(exec_list *instructions, case ast_pre_inc: case ast_pre_dec: { this->non_lvalue_description = (this->oper == ast_pre_inc) - ? "pre-increment operation" : "pre-decrement operation"; + ? "pre-increment operation" : "pre-decrement operation"; op[0] = this->subexpressions[0]->hir(instructions, state); op[1] = constant_one_for_inc_dec(ctx, op[0]->type); @@ -1631,7 +1629,7 @@ ast_expression::do_hir(exec_list *instructions, ir_rvalue *temp_rhs; temp_rhs = new(ctx) ir_expression(operations[this->oper], type, - op[0], op[1]); + op[0], op[1]); error_emitted = do_assignment(instructions, state, @@ -1645,7 +1643,7 @@ ast_expression::do_hir(exec_list *instructions, case ast_post_inc: case ast_post_dec: { this->non_lvalue_description = (this->oper == ast_post_inc) - ? "post-increment operation" : "post-decrement operation"; + ? "post-increment operation" : "post-decrement operation"; op[0] = this->subexpressions[0]->hir(instructions, state); op[1] = constant_one_for_inc_dec(ctx, op[0]->type); @@ -1655,7 +1653,7 @@ ast_expression::do_hir(exec_list *instructions, ir_rvalue *temp_rhs; temp_rhs = new(ctx) ir_expression(operations[this->oper], type, - op[0], op[1]); + op[0], op[1]); /* Get a temporary of a copy of the lvalue before it's modified. * This may get thrown away later. @@ -1684,10 +1682,10 @@ ast_expression::do_hir(exec_list *instructions, op[1] = subexpressions[1]->hir(instructions, state); result = _mesa_ast_array_index_to_hir(ctx, state, op[0], op[1], - loc, index_loc); + loc, index_loc); if (result->type->is_error()) - error_emitted = true; + error_emitted = true; break; } @@ -1705,17 +1703,17 @@ ast_expression::do_hir(exec_list *instructions, * as 'variable_identifier'. */ ir_variable *var = - state->symbols->get_variable(this->primary_expression.identifier); + state->symbols->get_variable(this->primary_expression.identifier); if (var != NULL) { - var->data.used = true; - result = new(ctx) ir_dereference_variable(var); + var->data.used = true; + result = new(ctx) ir_dereference_variable(var); } else { - _mesa_glsl_error(& loc, state, "`%s' undeclared", - this->primary_expression.identifier); + _mesa_glsl_error(& loc, state, "`%s' undeclared", + this->primary_expression.identifier); - result = ir_rvalue::error_value(ctx); - error_emitted = true; + result = ir_rvalue::error_value(ctx); + error_emitted = true; } break; } @@ -1751,37 +1749,37 @@ ast_expression::do_hir(exec_list *instructions, YYLTYPE previous_operand_loc = loc; foreach_list_typed (ast_node, ast, link, &this->expressions) { - /* If one of the operands of comma operator does not generate any - * code, we want to emit a warning. At each pass through the loop - * previous_tail_pred will point to the last instruction in the - * stream *before* processing the previous operand. Naturally, - * instructions->tail_pred will point to the last instruction in the - * stream *after* processing the previous operand. If the two - * pointers match, then the previous operand had no effect. - * - * The warning behavior here differs slightly from GCC. GCC will - * only emit a warning if none of the left-hand operands have an - * effect. However, it will emit a warning for each. I believe that - * there are some cases in C (especially with GCC extensions) where - * it is useful to have an intermediate step in a sequence have no - * effect, but I don't think these cases exist in GLSL. Either way, - * it would be a giant hassle to replicate that behavior. - */ - if (previous_tail_pred == instructions->tail_pred) { - _mesa_glsl_warning(&previous_operand_loc, state, - "left-hand operand of comma expression has " - "no effect"); - } - - /* tail_pred is directly accessed instead of using the get_tail() - * method for performance reasons. get_tail() has extra code to - * return NULL when the list is empty. We don't care about that - * here, so using tail_pred directly is fine. - */ - previous_tail_pred = instructions->tail_pred; - previous_operand_loc = ast->get_location(); - - result = ast->hir(instructions, state); + /* If one of the operands of comma operator does not generate any + * code, we want to emit a warning. At each pass through the loop + * previous_tail_pred will point to the last instruction in the + * stream *before* processing the previous operand. Naturally, + * instructions->tail_pred will point to the last instruction in the + * stream *after* processing the previous operand. If the two + * pointers match, then the previous operand had no effect. + * + * The warning behavior here differs slightly from GCC. GCC will + * only emit a warning if none of the left-hand operands have an + * effect. However, it will emit a warning for each. I believe that + * there are some cases in C (especially with GCC extensions) where + * it is useful to have an intermediate step in a sequence have no + * effect, but I don't think these cases exist in GLSL. Either way, + * it would be a giant hassle to replicate that behavior. + */ + if (previous_tail_pred == instructions->tail_pred) { + _mesa_glsl_warning(&previous_operand_loc, state, + "left-hand operand of comma expression has " + "no effect"); + } + + /* tail_pred is directly accessed instead of using the get_tail() + * method for performance reasons. get_tail() has extra code to + * return NULL when the list is empty. We don't care about that + * here, so using tail_pred directly is fine. + */ + previous_tail_pred = instructions->tail_pred; + previous_operand_loc = ast->get_location(); + + result = ast->hir(instructions, state); } /* Any errors should have already been emitted in the loop above. @@ -1802,7 +1800,7 @@ ast_expression::do_hir(exec_list *instructions, ir_rvalue * ast_expression_statement::hir(exec_list *instructions, - struct _mesa_glsl_parse_state *state) + struct _mesa_glsl_parse_state *state) { /* It is possible to have expression statements that don't have an * expression. This is the solitary semicolon: @@ -1824,7 +1822,7 @@ ast_expression_statement::hir(exec_list *instructions, ir_rvalue * ast_compound_statement::hir(exec_list *instructions, - struct _mesa_glsl_parse_state *state) + struct _mesa_glsl_parse_state *state) { if (new_scope) state->symbols->push_scope(); @@ -1851,8 +1849,7 @@ process_array_size(exec_node *node, exec_list dummy_instructions; ast_node *array_size = exec_node_data(ast_node, node, link); - ir_rvalue *const ir = array_size->hir(& dummy_instructions, - state); + ir_rvalue *const ir = array_size->hir(& dummy_instructions, state); YYLTYPE loc = array_size->get_location(); if (ir == NULL) { @@ -1933,8 +1930,7 @@ process_array_type(YYLTYPE *loc, const glsl_type *base, for (exec_node *node = array_specifier->array_dimensions.tail_pred; !node->is_head_sentinel(); node = node->prev) { unsigned array_size = process_array_size(node, state); - array_type = glsl_type::get_array_instance(array_type, - array_size); + array_type = glsl_type::get_array_instance(array_type, array_size); } if (array_specifier->is_unsized_array) @@ -1947,7 +1943,7 @@ process_array_type(YYLTYPE *loc, const glsl_type *base, const glsl_type * ast_type_specifier::glsl_type(const char **name, - struct _mesa_glsl_parse_state *state) const + struct _mesa_glsl_parse_state *state) const { const struct glsl_type *type; @@ -2011,7 +2007,7 @@ is_varying_var(ir_variable *var, gl_shader_stage target) */ static void validate_matrix_layout_for_type(struct _mesa_glsl_parse_state *state, - YYLTYPE *loc, + YYLTYPE *loc, const glsl_type *type, ir_variable *var) { @@ -2240,7 +2236,7 @@ validate_explicit_location(const struct ast_type_qualifier *qual, _mesa_glsl_error(loc, state, "%s cannot be given an explicit location in %s shader", mode_string(var), - _mesa_shader_stage_to_string(state->stage)); + _mesa_shader_stage_to_string(state->stage)); } else { var->data.explicit_location = true; @@ -2347,21 +2343,21 @@ apply_image_qualifier_to_variable(const struct ast_type_qualifier *qual, static void apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual, - ir_variable *var, - struct _mesa_glsl_parse_state *state, - YYLTYPE *loc, + ir_variable *var, + struct _mesa_glsl_parse_state *state, + YYLTYPE *loc, bool is_parameter) { STATIC_ASSERT(sizeof(qual->flags.q) <= sizeof(qual->flags.i)); if (qual->flags.q.invariant) { if (var->data.used) { - _mesa_glsl_error(loc, state, - "variable `%s' may not be redeclared " - "`invariant' after being used", - var->name); + _mesa_glsl_error(loc, state, + "variable `%s' may not be redeclared " + "`invariant' after being used", + var->name); } else { - var->data.invariant = 1; + var->data.invariant = 1; } } @@ -2379,9 +2375,9 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual, if (qual->flags.q.attribute && state->stage != MESA_SHADER_VERTEX) { var->type = glsl_type::error_type; _mesa_glsl_error(loc, state, - "`attribute' variables may not be declared in the " - "%s shader", - _mesa_shader_stage_to_string(state->stage)); + "`attribute' variables may not be declared in the " + "%s shader", + _mesa_shader_stage_to_string(state->stage)); } /* Section 6.1.1 (Function Calling Conventions) of the GLSL 1.10 spec says: @@ -2474,18 +2470,18 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual, if (state->all_invariant && (state->current_function == NULL)) { switch (state->stage) { case MESA_SHADER_VERTEX: - if (var->data.mode == ir_var_shader_out) - var->data.invariant = true; - break; + if (var->data.mode == ir_var_shader_out) + var->data.invariant = true; + break; case MESA_SHADER_GEOMETRY: - if ((var->data.mode == ir_var_shader_in) + if ((var->data.mode == ir_var_shader_in) || (var->data.mode == ir_var_shader_out)) - var->data.invariant = true; - break; + var->data.invariant = true; + break; case MESA_SHADER_FRAGMENT: - if (var->data.mode == ir_var_shader_in) - var->data.invariant = true; - break; + if (var->data.mode == ir_var_shader_in) + var->data.invariant = true; + break; case MESA_SHADER_COMPUTE: /* Invariance isn't meaningful in compute shaders. */ break; @@ -2501,7 +2497,7 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual, if ((qual->flags.q.origin_upper_left || qual->flags.q.pixel_center_integer) && (strcmp(var->name, "gl_FragCoord") != 0)) { const char *const qual_string = (qual->flags.q.origin_upper_left) - ? "origin_upper_left" : "pixel_center_integer"; + ? "origin_upper_left" : "pixel_center_integer"; _mesa_glsl_error(loc, state, "layout qualifier `%s' can only be applied to " @@ -2512,8 +2508,7 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual, if (qual->flags.q.explicit_location) { validate_explicit_location(qual, var, state, loc); } else if (qual->flags.q.explicit_index) { - _mesa_glsl_error(loc, state, - "explicit index requires explicit location"); + _mesa_glsl_error(loc, state, "explicit index requires explicit location"); } if (qual->flags.q.explicit_binding && @@ -2577,13 +2572,13 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual, if (qual->has_layout() && uses_deprecated_qualifier) { if (relaxed_layout_qualifier_checking) { - _mesa_glsl_warning(loc, state, - "`layout' qualifier may not be used with " - "`attribute' or `varying'"); + _mesa_glsl_warning(loc, state, + "`layout' qualifier may not be used with " + "`attribute' or `varying'"); } else { - _mesa_glsl_error(loc, state, - "`layout' qualifier may not be used with " - "`attribute' or `varying'"); + _mesa_glsl_error(loc, state, + "`layout' qualifier may not be used with " + "`attribute' or `varying'"); } } @@ -2600,7 +2595,7 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual, _mesa_glsl_error(loc, state, "extension GL_AMD_conservative_depth or " "GL_ARB_conservative_depth must be enabled " - "to use depth layout qualifiers"); + "to use depth layout qualifiers"); } else if (depth_layout_count > 0 && strcmp(var->name, "gl_FragDepth") != 0) { _mesa_glsl_error(loc, state, @@ -2628,8 +2623,8 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual, qual->flags.q.shared) { _mesa_glsl_error(loc, state, "uniform block layout qualifiers std140, packed, and " - "shared can only be applied to uniform blocks, not " - "members"); + "shared can only be applied to uniform blocks, not " + "members"); } if (qual->flags.q.row_major || qual->flags.q.column_major) { @@ -2665,7 +2660,7 @@ get_variable_being_redeclared(ir_variable *var, YYLTYPE loc, ir_variable *earlier = state->symbols->get_variable(var->name); if (earlier == NULL || (state->current_function != NULL && - !state->symbols->name_declared_this_scope(var->name))) { + !state->symbols->name_declared_this_scope(var->name))) { return NULL; } @@ -2686,19 +2681,19 @@ get_variable_being_redeclared(ir_variable *var, YYLTYPE loc, const unsigned size = unsigned(var->type->array_size()); check_builtin_array_max_size(var->name, size, loc, state); if ((size > 0) && (size <= earlier->data.max_array_access)) { - _mesa_glsl_error(& loc, state, "array size must be > %u due to " - "previous access", - earlier->data.max_array_access); + _mesa_glsl_error(& loc, state, "array size must be > %u due to " + "previous access", + earlier->data.max_array_access); } earlier->type = var->type; delete var; var = NULL; } else if ((state->ARB_fragment_coord_conventions_enable || - state->is_version(150, 0)) - && strcmp(var->name, "gl_FragCoord") == 0 - && earlier->type == var->type - && earlier->data.mode == var->data.mode) { + state->is_version(150, 0)) + && strcmp(var->name, "gl_FragCoord") == 0 + && earlier->type == var->type + && earlier->data.mode == var->data.mode) { /* Allow redeclaration of gl_FragCoord for ARB_fcc layout * qualifiers. */ @@ -2716,42 +2711,42 @@ get_variable_being_redeclared(ir_variable *var, YYLTYPE loc, * * gl_SecondaryColor */ } else if (state->is_version(130, 0) - && (strcmp(var->name, "gl_FrontColor") == 0 - || strcmp(var->name, "gl_BackColor") == 0 - || strcmp(var->name, "gl_FrontSecondaryColor") == 0 - || strcmp(var->name, "gl_BackSecondaryColor") == 0 - || strcmp(var->name, "gl_Color") == 0 - || strcmp(var->name, "gl_SecondaryColor") == 0) - && earlier->type == var->type - && earlier->data.mode == var->data.mode) { + && (strcmp(var->name, "gl_FrontColor") == 0 + || strcmp(var->name, "gl_BackColor") == 0 + || strcmp(var->name, "gl_FrontSecondaryColor") == 0 + || strcmp(var->name, "gl_BackSecondaryColor") == 0 + || strcmp(var->name, "gl_Color") == 0 + || strcmp(var->name, "gl_SecondaryColor") == 0) + && earlier->type == var->type + && earlier->data.mode == var->data.mode) { earlier->data.interpolation = var->data.interpolation; /* Layout qualifiers for gl_FragDepth. */ } else if ((state->AMD_conservative_depth_enable || state->ARB_conservative_depth_enable) - && strcmp(var->name, "gl_FragDepth") == 0 - && earlier->type == var->type - && earlier->data.mode == var->data.mode) { + && strcmp(var->name, "gl_FragDepth") == 0 + && earlier->type == var->type + && earlier->data.mode == var->data.mode) { /** From the AMD_conservative_depth spec: * Within any shader, the first redeclarations of gl_FragDepth * must appear before any use of gl_FragDepth. */ if (earlier->data.used) { - _mesa_glsl_error(&loc, state, - "the first redeclaration of gl_FragDepth " - "must appear before any use of gl_FragDepth"); + _mesa_glsl_error(&loc, state, + "the first redeclaration of gl_FragDepth " + "must appear before any use of gl_FragDepth"); } /* Prevent inconsistent redeclaration of depth layout qualifier. */ if (earlier->data.depth_layout != ir_depth_layout_none - && earlier->data.depth_layout != var->data.depth_layout) { - _mesa_glsl_error(&loc, state, - "gl_FragDepth: depth layout is declared here " - "as '%s, but it was previously declared as " - "'%s'", - depth_layout_string(var->data.depth_layout), - depth_layout_string(earlier->data.depth_layout)); + && earlier->data.depth_layout != var->data.depth_layout) { + _mesa_glsl_error(&loc, state, + "gl_FragDepth: depth layout is declared here " + "as '%s, but it was previously declared as " + "'%s'", + depth_layout_string(var->data.depth_layout), + depth_layout_string(earlier->data.depth_layout)); } earlier->data.depth_layout = var->data.depth_layout; @@ -2805,7 +2800,7 @@ process_initializer(ir_variable *var, ast_declaration *decl, */ if (var->type->contains_opaque()) { _mesa_glsl_error(& initializer_loc, state, - "cannot initialize opaque variable"); + "cannot initialize opaque variable"); } if ((var->data.mode == ir_var_shader_in) && (state->current_function == NULL)) { @@ -2824,8 +2819,7 @@ process_initializer(ir_variable *var, ast_declaration *decl, _mesa_ast_set_aggregate_type(var->type, decl->initializer); ir_dereference *const lhs = new(state) ir_dereference_variable(var); - ir_rvalue *rhs = decl->initializer->hir(initializer_instructions, - state); + ir_rvalue *rhs = decl->initializer->hir(initializer_instructions, state); /* Calculate the constant value if this is a const or uniform * declaration. @@ -2835,10 +2829,10 @@ process_initializer(ir_variable *var, ast_declaration *decl, ir_rvalue *new_rhs = validate_assignment(state, initializer_loc, var->type, rhs, true); if (new_rhs != NULL) { - rhs = new_rhs; + rhs = new_rhs; - ir_constant *constant_value = rhs->constant_expression_value(); - if (!constant_value) { + ir_constant *constant_value = rhs->constant_expression_value(); + if (!constant_value) { /* If ARB_shading_language_420pack is enabled, initializers of * const-qualified local variables do not have to be constant * expressions. Const-qualified global variables must still be @@ -2858,35 +2852,35 @@ process_initializer(ir_variable *var, ast_declaration *decl, } } } else { - rhs = constant_value; - var->constant_value = constant_value; - } + rhs = constant_value; + var->constant_value = constant_value; + } } else { - if (var->type->is_numeric()) { - /* Reduce cascading errors. */ - var->constant_value = ir_constant::zero(state, var->type); - } + if (var->type->is_numeric()) { + /* Reduce cascading errors. */ + var->constant_value = ir_constant::zero(state, var->type); + } } } if (rhs && !rhs->type->is_error()) { bool temp = var->data.read_only; if (type->qualifier.flags.q.constant) - var->data.read_only = false; + var->data.read_only = false; /* Never emit code to initialize a uniform. */ const glsl_type *initializer_type; if (!type->qualifier.flags.q.uniform) { - do_assignment(initializer_instructions, state, + do_assignment(initializer_instructions, state, NULL, lhs, rhs, &result, true, true, type->get_location()); - initializer_type = result->type; + initializer_type = result->type; } else - initializer_type = rhs->type; + initializer_type = rhs->type; var->constant_initializer = rhs->constant_expression_value(); var->data.has_initializer = true; @@ -3033,7 +3027,7 @@ validate_identifier(const char *identifier, YYLTYPE loc, ir_rvalue * ast_declarator_list::hir(exec_list *instructions, - struct _mesa_glsl_parse_state *state) + struct _mesa_glsl_parse_state *state) { void *ctx = state; const struct glsl_type *decl_type; @@ -3056,39 +3050,33 @@ ast_declarator_list::hir(exec_list *instructions, assert(this->type == NULL); if (state->current_function != NULL) { - _mesa_glsl_error(& loc, state, - "all uses of `invariant' keyword must be at global " - "scope"); + _mesa_glsl_error(& loc, state, + "all uses of `invariant' keyword must be at global " + "scope"); } foreach_list_typed (ast_declaration, decl, link, &this->declarations) { - assert(decl->array_specifier == NULL); - assert(decl->initializer == NULL); - - ir_variable *const earlier = - state->symbols->get_variable(decl->identifier); - if (earlier == NULL) { - _mesa_glsl_error(& loc, state, - "undeclared variable `%s' cannot be marked " - "invariant", decl->identifier); - } else if ((state->stage == MESA_SHADER_VERTEX) - && (earlier->data.mode != ir_var_shader_out)) { - _mesa_glsl_error(& loc, state, - "`%s' cannot be marked invariant, vertex shader " - "outputs only", decl->identifier); - } else if ((state->stage == MESA_SHADER_FRAGMENT) - && (earlier->data.mode != ir_var_shader_in)) { - _mesa_glsl_error(& loc, state, - "`%s' cannot be marked invariant, fragment shader " - "inputs only", decl->identifier); - } else if (earlier->data.used) { - _mesa_glsl_error(& loc, state, - "variable `%s' may not be redeclared " - "`invariant' after being used", - earlier->name); - } else { - earlier->data.invariant = true; - } + assert(decl->array_specifier == NULL); + assert(decl->initializer == NULL); + + ir_variable *const earlier = + state->symbols->get_variable(decl->identifier); + if (earlier == NULL) { + _mesa_glsl_error(& loc, state, + "undeclared variable `%s' cannot be marked " + "invariant", decl->identifier); + } else if (!is_varying_var(earlier, state->stage)) { + _mesa_glsl_error(&loc, state, + "`%s' cannot be marked invariant; interfaces between " + "shader stages only.", decl->identifier); + } else if (earlier->data.used) { + _mesa_glsl_error(& loc, state, + "variable `%s' may not be redeclared " + "`invariant' after being used", + earlier->name); + } else { + earlier->data.invariant = true; + } } /* Invariant redeclarations do not have r-values. @@ -3185,16 +3173,16 @@ ast_declarator_list::hir(exec_list *instructions, */ if ((decl_type == NULL) || decl_type->is_void()) { - if (type_name != NULL) { - _mesa_glsl_error(& loc, state, - "invalid type `%s' in declaration of `%s'", - type_name, decl->identifier); - } else { - _mesa_glsl_error(& loc, state, - "invalid type in declaration of `%s'", - decl->identifier); - } - continue; + if (type_name != NULL) { + _mesa_glsl_error(& loc, state, + "invalid type `%s' in declaration of `%s'", + type_name, decl->identifier); + } else { + _mesa_glsl_error(& loc, state, + "invalid type in declaration of `%s'", + decl->identifier); + } + continue; } var_type = process_array_type(&loc, decl_type, decl->array_specifier, @@ -3225,7 +3213,7 @@ ast_declarator_list::hir(exec_list *instructions, /* From page 22 (page 28 of the PDF) of the GLSL 1.10 specification; * * "Global variables can only use the qualifiers const, - * attribute, uni form, or varying. Only one may be + * attribute, uniform, or varying. Only one may be * specified. * * Local variables can only use the qualifier const." @@ -3234,95 +3222,86 @@ ast_declarator_list::hir(exec_list *instructions, * any extension that adds the 'layout' keyword. */ if (!state->is_version(130, 300) - && !state->has_explicit_attrib_location() - && !state->has_separate_shader_objects() - && !state->ARB_fragment_coord_conventions_enable) { - if (this->type->qualifier.flags.q.out) { - _mesa_glsl_error(& loc, state, - "`out' qualifier in declaration of `%s' " - "only valid for function parameters in %s", - decl->identifier, state->get_version_string()); - } - if (this->type->qualifier.flags.q.in) { - _mesa_glsl_error(& loc, state, - "`in' qualifier in declaration of `%s' " - "only valid for function parameters in %s", - decl->identifier, state->get_version_string()); - } - /* FINISHME: Test for other invalid qualifiers. */ + && !state->has_explicit_attrib_location() + && !state->has_separate_shader_objects() + && !state->ARB_fragment_coord_conventions_enable) { + if (this->type->qualifier.flags.q.out) { + _mesa_glsl_error(& loc, state, + "`out' qualifier in declaration of `%s' " + "only valid for function parameters in %s", + decl->identifier, state->get_version_string()); + } + if (this->type->qualifier.flags.q.in) { + _mesa_glsl_error(& loc, state, + "`in' qualifier in declaration of `%s' " + "only valid for function parameters in %s", + decl->identifier, state->get_version_string()); + } + /* FINISHME: Test for other invalid qualifiers. */ } apply_type_qualifier_to_variable(& this->type->qualifier, var, state, & loc, false); if (this->type->qualifier.flags.q.invariant) { - if ((state->stage == MESA_SHADER_VERTEX) && - var->data.mode != ir_var_shader_out) { - _mesa_glsl_error(& loc, state, - "`%s' cannot be marked invariant, vertex shader " - "outputs only", var->name); - } else if ((state->stage == MESA_SHADER_FRAGMENT) && - var->data.mode != ir_var_shader_in) { - /* FINISHME: Note that this doesn't work for invariant on - * a function signature inval - */ - _mesa_glsl_error(& loc, state, - "`%s' cannot be marked invariant, fragment shader " - "inputs only", var->name); - } + if (!is_varying_var(var, state->stage)) { + _mesa_glsl_error(&loc, state, + "`%s' cannot be marked invariant; interfaces between " + "shader stages only", var->name); + } } if (state->current_function != NULL) { - const char *mode = NULL; - const char *extra = ""; - - /* There is no need to check for 'inout' here because the parser will - * only allow that in function parameter lists. - */ - if (this->type->qualifier.flags.q.attribute) { - mode = "attribute"; - } else if (this->type->qualifier.flags.q.uniform) { - mode = "uniform"; - } else if (this->type->qualifier.flags.q.varying) { - mode = "varying"; - } else if (this->type->qualifier.flags.q.in) { - mode = "in"; - extra = " or in function parameter list"; - } else if (this->type->qualifier.flags.q.out) { - mode = "out"; - extra = " or in function parameter list"; - } - - if (mode) { - _mesa_glsl_error(& loc, state, - "%s variable `%s' must be declared at " - "global scope%s", - mode, var->name, extra); - } + const char *mode = NULL; + const char *extra = ""; + + /* There is no need to check for 'inout' here because the parser will + * only allow that in function parameter lists. + */ + if (this->type->qualifier.flags.q.attribute) { + mode = "attribute"; + } else if (this->type->qualifier.flags.q.uniform) { + mode = "uniform"; + } else if (this->type->qualifier.flags.q.varying) { + mode = "varying"; + } else if (this->type->qualifier.flags.q.in) { + mode = "in"; + extra = " or in function parameter list"; + } else if (this->type->qualifier.flags.q.out) { + mode = "out"; + extra = " or in function parameter list"; + } + + if (mode) { + _mesa_glsl_error(& loc, state, + "%s variable `%s' must be declared at " + "global scope%s", + mode, var->name, extra); + } } else if (var->data.mode == ir_var_shader_in) { var->data.read_only = true; - if (state->stage == MESA_SHADER_VERTEX) { - bool error_emitted = false; - - /* From page 31 (page 37 of the PDF) of the GLSL 1.50 spec: - * - * "Vertex shader inputs can only be float, floating-point - * vectors, matrices, signed and unsigned integers and integer - * vectors. Vertex shader inputs can also form arrays of these - * types, but not structures." - * - * From page 31 (page 27 of the PDF) of the GLSL 1.30 spec: - * - * "Vertex shader inputs can only be float, floating-point - * vectors, matrices, signed and unsigned integers and integer - * vectors. They cannot be arrays or structures." - * - * From page 23 (page 29 of the PDF) of the GLSL 1.20 spec: - * - * "The attribute qualifier can be used only with float, - * floating-point vectors, and matrices. Attribute variables - * cannot be declared as arrays or structures." + if (state->stage == MESA_SHADER_VERTEX) { + bool error_emitted = false; + + /* From page 31 (page 37 of the PDF) of the GLSL 1.50 spec: + * + * "Vertex shader inputs can only be float, floating-point + * vectors, matrices, signed and unsigned integers and integer + * vectors. Vertex shader inputs can also form arrays of these + * types, but not structures." + * + * From page 31 (page 27 of the PDF) of the GLSL 1.30 spec: + * + * "Vertex shader inputs can only be float, floating-point + * vectors, matrices, signed and unsigned integers and integer + * vectors. They cannot be arrays or structures." + * + * From page 23 (page 29 of the PDF) of the GLSL 1.20 spec: + * + * "The attribute qualifier can be used only with float, + * floating-point vectors, and matrices. Attribute variables + * cannot be declared as arrays or structures." * * From page 33 (page 39 of the PDF) of the GLSL ES 3.00 spec: * @@ -3330,35 +3309,35 @@ ast_declarator_list::hir(exec_list *instructions, * vectors, matrices, signed and unsigned integers and integer * vectors. Vertex shader inputs cannot be arrays or * structures." - */ + */ const glsl_type *check_type = var->type; while (check_type->is_array()) check_type = check_type->element_type(); - switch (check_type->base_type) { - case GLSL_TYPE_FLOAT: - break; - case GLSL_TYPE_UINT: - case GLSL_TYPE_INT: - if (state->is_version(120, 300)) - break; - /* FALLTHROUGH */ - default: - _mesa_glsl_error(& loc, state, - "vertex shader input / attribute cannot have " - "type %s`%s'", - var->type->is_array() ? "array of " : "", - check_type->name); - error_emitted = true; - } - - if (!error_emitted && var->type->is_array() && + switch (check_type->base_type) { + case GLSL_TYPE_FLOAT: + break; + case GLSL_TYPE_UINT: + case GLSL_TYPE_INT: + if (state->is_version(120, 300)) + break; + /* FALLTHROUGH */ + default: + _mesa_glsl_error(& loc, state, + "vertex shader input / attribute cannot have " + "type %s`%s'", + var->type->is_array() ? "array of " : "", + check_type->name); + error_emitted = true; + } + + if (!error_emitted && var->type->is_array() && !state->check_version(150, 0, &loc, "vertex shader input / attribute " "cannot have array type")) { - error_emitted = true; - } - } else if (state->stage == MESA_SHADER_GEOMETRY) { + error_emitted = true; + } + } else if (state->stage == MESA_SHADER_GEOMETRY) { /* From section 4.3.4 (Inputs) of the GLSL 1.50 spec: * * Geometry shader input variables get the per-vertex values @@ -3607,9 +3586,9 @@ ast_declarator_list::hir(exec_list *instructions, } if (decl->initializer != NULL) { - result = process_initializer((earlier == NULL) ? var : earlier, - decl, this->type, - &initializer_instructions, state); + result = process_initializer((earlier == NULL) ? var : earlier, + decl, this->type, + &initializer_instructions, state); } /* From page 23 (page 29 of the PDF) of the GLSL 1.10 spec: @@ -3619,14 +3598,14 @@ ast_declarator_list::hir(exec_list *instructions, * declared." */ if (this->type->qualifier.flags.q.constant && decl->initializer == NULL) { - _mesa_glsl_error(& loc, state, - "const declaration of `%s' must be initialized", - decl->identifier); + _mesa_glsl_error(& loc, state, + "const declaration of `%s' must be initialized", + decl->identifier); } if (state->es_shader) { - const glsl_type *const t = (earlier == NULL) - ? var->type : earlier->type; + const glsl_type *const t = (earlier == NULL) + ? var->type : earlier->type; if (t->is_unsized_array()) /* Section 10.17 of the GLSL ES 1.00 specification states that @@ -3658,32 +3637,32 @@ ast_declarator_list::hir(exec_list *instructions, if (earlier == NULL) { validate_identifier(decl->identifier, loc, state); - /* Add the variable to the symbol table. Note that the initializer's - * IR was already processed earlier (though it hasn't been emitted - * yet), without the variable in scope. - * - * This differs from most C-like languages, but it follows the GLSL - * specification. From page 28 (page 34 of the PDF) of the GLSL 1.50 - * spec: - * - * "Within a declaration, the scope of a name starts immediately - * after the initializer if present or immediately after the name - * being declared if not." - */ - if (!state->symbols->add_variable(var)) { - YYLTYPE loc = this->get_location(); - _mesa_glsl_error(&loc, state, "name `%s' already taken in the " - "current scope", decl->identifier); - continue; - } - - /* Push the variable declaration to the top. It means that all the - * variable declarations will appear in a funny last-to-first order, - * but otherwise we run into trouble if a function is prototyped, a - * global var is decled, then the function is defined with usage of - * the global var. See glslparsertest's CorrectModule.frag. - */ - instructions->push_head(var); + /* Add the variable to the symbol table. Note that the initializer's + * IR was already processed earlier (though it hasn't been emitted + * yet), without the variable in scope. + * + * This differs from most C-like languages, but it follows the GLSL + * specification. From page 28 (page 34 of the PDF) of the GLSL 1.50 + * spec: + * + * "Within a declaration, the scope of a name starts immediately + * after the initializer if present or immediately after the name + * being declared if not." + */ + if (!state->symbols->add_variable(var)) { + YYLTYPE loc = this->get_location(); + _mesa_glsl_error(&loc, state, "name `%s' already taken in the " + "current scope", decl->identifier); + continue; + } + + /* Push the variable declaration to the top. It means that all the + * variable declarations will appear in a funny last-to-first order, + * but otherwise we run into trouble if a function is prototyped, a + * global var is decled, then the function is defined with usage of + * the global var. See glslparsertest's CorrectModule.frag. + */ + instructions->push_head(var); } instructions->append_list(&initializer_instructions); @@ -3705,7 +3684,7 @@ ast_declarator_list::hir(exec_list *instructions, ir_rvalue * ast_parameter_declarator::hir(exec_list *instructions, - struct _mesa_glsl_parse_state *state) + struct _mesa_glsl_parse_state *state) { void *ctx = state; const struct glsl_type *type; @@ -3716,13 +3695,13 @@ ast_parameter_declarator::hir(exec_list *instructions, if (type == NULL) { if (name != NULL) { - _mesa_glsl_error(& loc, state, - "invalid type `%s' in declaration of `%s'", - name, this->identifier); + _mesa_glsl_error(& loc, state, + "invalid type `%s' in declaration of `%s'", + name, this->identifier); } else { - _mesa_glsl_error(& loc, state, - "invalid type in declaration of `%s'", - this->identifier); + _mesa_glsl_error(& loc, state, + "invalid type in declaration of `%s'", + this->identifier); } type = glsl_type::error_type; @@ -3742,8 +3721,8 @@ ast_parameter_declarator::hir(exec_list *instructions, */ if (type->is_void()) { if (this->identifier != NULL) - _mesa_glsl_error(& loc, state, - "named parameter cannot have type `void'"); + _mesa_glsl_error(& loc, state, + "named parameter cannot have type `void'"); is_void = true; return NULL; @@ -3761,7 +3740,7 @@ ast_parameter_declarator::hir(exec_list *instructions, if (!type->is_error() && type->is_unsized_array()) { _mesa_glsl_error(&loc, state, "arrays passed as parameters must have " - "a declared size"); + "a declared size"); type = glsl_type::error_type; } @@ -3773,7 +3752,7 @@ ast_parameter_declarator::hir(exec_list *instructions, * for function parameters the default mode is 'in'. */ apply_type_qualifier_to_variable(& this->type->qualifier, var, state, & loc, - true); + true); /* From section 4.1.7 of the GLSL 4.40 spec: * @@ -3819,9 +3798,9 @@ ast_parameter_declarator::hir(exec_list *instructions, void ast_parameter_declarator::parameters_to_hir(exec_list *ast_parameters, - bool formal, - exec_list *ir_parameters, - _mesa_glsl_parse_state *state) + bool formal, + exec_list *ir_parameters, + _mesa_glsl_parse_state *state) { ast_parameter_declarator *void_param = NULL; unsigned count = 0; @@ -3831,7 +3810,7 @@ ast_parameter_declarator::parameters_to_hir(exec_list *ast_parameters, param->hir(ir_parameters, state); if (param->is_void) - void_param = param; + void_param = param; count++; } @@ -3840,7 +3819,7 @@ ast_parameter_declarator::parameters_to_hir(exec_list *ast_parameters, YYLTYPE loc = void_param->get_location(); _mesa_glsl_error(& loc, state, - "`void' parameter must be only parameter"); + "`void' parameter must be only parameter"); } } @@ -3861,7 +3840,7 @@ emit_function(_mesa_glsl_parse_state *state, ir_function *f) ir_rvalue * ast_function::hir(exec_list *instructions, - struct _mesa_glsl_parse_state *state) + struct _mesa_glsl_parse_state *state) { void *ctx = state; ir_function *f = NULL; @@ -3903,8 +3882,8 @@ ast_function::hir(exec_list *instructions, * signatures for functions with the same name. */ ast_parameter_declarator::parameters_to_hir(& this->parameters, - is_definition, - & hir_parameters, state); + is_definition, + & hir_parameters, state); const char *return_type_name; const glsl_type *return_type = @@ -3913,8 +3892,8 @@ ast_function::hir(exec_list *instructions, if (!return_type) { YYLTYPE loc = this->get_location(); _mesa_glsl_error(&loc, state, - "function `%s' has undeclared return type `%s'", - name, return_type_name); + "function `%s' has undeclared return type `%s'", + name, return_type_name); return_type = glsl_type::error_type; } @@ -3924,7 +3903,7 @@ ast_function::hir(exec_list *instructions, if (this->return_type->has_qualifiers()) { YYLTYPE loc = this->get_location(); _mesa_glsl_error(& loc, state, - "function `%s' return type has qualifiers", name); + "function `%s' return type has qualifiers", name); } /* Section 6.1 (Function Definitions) of the GLSL 1.20 spec says: @@ -3935,8 +3914,8 @@ ast_function::hir(exec_list *instructions, if (return_type->is_unsized_array()) { YYLTYPE loc = this->get_location(); _mesa_glsl_error(& loc, state, - "function `%s' return type array must be explicitly " - "sized", name); + "function `%s' return type array must be explicitly " + "sized", name); } /* From section 4.1.7 of the GLSL 4.40 spec: @@ -3959,20 +3938,20 @@ ast_function::hir(exec_list *instructions, if (f != NULL && (state->es_shader || f->has_user_signature())) { sig = f->exact_matching_signature(state, &hir_parameters); if (sig != NULL) { - const char *badvar = sig->qualifiers_match(&hir_parameters); - if (badvar != NULL) { - YYLTYPE loc = this->get_location(); + const char *badvar = sig->qualifiers_match(&hir_parameters); + if (badvar != NULL) { + YYLTYPE loc = this->get_location(); - _mesa_glsl_error(&loc, state, "function `%s' parameter `%s' " - "qualifiers don't match prototype", name, badvar); - } + _mesa_glsl_error(&loc, state, "function `%s' parameter `%s' " + "qualifiers don't match prototype", name, badvar); + } - if (sig->return_type != return_type) { - YYLTYPE loc = this->get_location(); + if (sig->return_type != return_type) { + YYLTYPE loc = this->get_location(); - _mesa_glsl_error(&loc, state, "function `%s' return type doesn't " - "match prototype", name); - } + _mesa_glsl_error(&loc, state, "function `%s' return type doesn't " + "match prototype", name); + } if (sig->is_defined) { if (is_definition) { @@ -3985,17 +3964,17 @@ ast_function::hir(exec_list *instructions, */ return NULL; } - } + } } } else { f = new(ctx) ir_function(name); if (!state->symbols->add_function(f)) { - /* This function name shadows a non-function use of the same name. */ - YYLTYPE loc = this->get_location(); + /* This function name shadows a non-function use of the same name. */ + YYLTYPE loc = this->get_location(); - _mesa_glsl_error(&loc, state, "function name `%s' conflicts with " - "non-function", name); - return NULL; + _mesa_glsl_error(&loc, state, "function name `%s' conflicts with " + "non-function", name); + return NULL; } emit_function(state, f); @@ -4004,15 +3983,15 @@ ast_function::hir(exec_list *instructions, /* Verify the return type of main() */ if (strcmp(name, "main") == 0) { if (! return_type->is_void()) { - YYLTYPE loc = this->get_location(); + YYLTYPE loc = this->get_location(); - _mesa_glsl_error(& loc, state, "main() must return void"); + _mesa_glsl_error(& loc, state, "main() must return void"); } if (!hir_parameters.is_empty()) { - YYLTYPE loc = this->get_location(); + YYLTYPE loc = this->get_location(); - _mesa_glsl_error(& loc, state, "main() must not take any parameters"); + _mesa_glsl_error(& loc, state, "main() must not take any parameters"); } } @@ -4034,7 +4013,7 @@ ast_function::hir(exec_list *instructions, ir_rvalue * ast_function_definition::hir(exec_list *instructions, - struct _mesa_glsl_parse_state *state) + struct _mesa_glsl_parse_state *state) { prototype->is_definition = true; prototype->hir(instructions, state); @@ -4060,11 +4039,11 @@ ast_function_definition::hir(exec_list *instructions, * the same name. */ if (state->symbols->name_declared_this_scope(var->name)) { - YYLTYPE loc = this->get_location(); + YYLTYPE loc = this->get_location(); - _mesa_glsl_error(& loc, state, "parameter `%s' redeclared", var->name); + _mesa_glsl_error(& loc, state, "parameter `%s' redeclared", var->name); } else { - state->symbols->add_variable(var); + state->symbols->add_variable(var); } } @@ -4080,9 +4059,9 @@ ast_function_definition::hir(exec_list *instructions, if (!signature->return_type->is_void() && !state->found_return) { YYLTYPE loc = this->get_location(); _mesa_glsl_error(& loc, state, "function `%s' has non-void return type " - "%s, but no return statement", - signature->function_name(), - signature->return_type->name); + "%s, but no return statement", + signature->function_name(), + signature->return_type->name); } /* Function definitions do not have r-values. @@ -4093,7 +4072,7 @@ ast_function_definition::hir(exec_list *instructions, ir_rvalue * ast_jump_statement::hir(exec_list *instructions, - struct _mesa_glsl_parse_state *state) + struct _mesa_glsl_parse_state *state) { void *ctx = state; @@ -4103,23 +4082,23 @@ ast_jump_statement::hir(exec_list *instructions, assert(state->current_function); if (opt_return_value) { - ir_rvalue *ret = opt_return_value->hir(instructions, state); - - /* The value of the return type can be NULL if the shader says - * 'return foo();' and foo() is a function that returns void. - * - * NOTE: The GLSL spec doesn't say that this is an error. The type - * of the return value is void. If the return type of the function is - * also void, then this should compile without error. Seriously. - */ - const glsl_type *const ret_type = - (ret == NULL) ? glsl_type::void_type : ret->type; + ir_rvalue *ret = opt_return_value->hir(instructions, state); + + /* The value of the return type can be NULL if the shader says + * 'return foo();' and foo() is a function that returns void. + * + * NOTE: The GLSL spec doesn't say that this is an error. The type + * of the return value is void. If the return type of the function is + * also void, then this should compile without error. Seriously. + */ + const glsl_type *const ret_type = + (ret == NULL) ? glsl_type::void_type : ret->type; /* Implicit conversions are not allowed for return values prior to * ARB_shading_language_420pack. */ if (state->current_function->return_type != ret_type) { - YYLTYPE loc = this->get_location(); + YYLTYPE loc = this->get_location(); if (state->ARB_shading_language_420pack_enable) { if (!apply_implicit_conversion(state->current_function->return_type, @@ -4156,18 +4135,18 @@ ast_jump_statement::hir(exec_list *instructions, "return argument"); } - inst = new(ctx) ir_return(ret); + inst = new(ctx) ir_return(ret); } else { - if (state->current_function->return_type->base_type != - GLSL_TYPE_VOID) { - YYLTYPE loc = this->get_location(); - - _mesa_glsl_error(& loc, state, - "`return' with no value, in function %s returning " - "non-void", - state->current_function->function_name()); - } - inst = new(ctx) ir_return; + if (state->current_function->return_type->base_type != + GLSL_TYPE_VOID) { + YYLTYPE loc = this->get_location(); + + _mesa_glsl_error(& loc, state, + "`return' with no value, in function %s returning " + "non-void", + state->current_function->function_name()); + } + inst = new(ctx) ir_return; } state->found_return = true; @@ -4177,10 +4156,10 @@ ast_jump_statement::hir(exec_list *instructions, case ast_discard: if (state->stage != MESA_SHADER_FRAGMENT) { - YYLTYPE loc = this->get_location(); + YYLTYPE loc = this->get_location(); - _mesa_glsl_error(& loc, state, - "`discard' may only appear in a fragment shader"); + _mesa_glsl_error(& loc, state, + "`discard' may only appear in a fragment shader"); } instructions->push_tail(new(ctx) ir_discard); break; @@ -4188,26 +4167,25 @@ ast_jump_statement::hir(exec_list *instructions, case ast_break: case ast_continue: if (mode == ast_continue && - state->loop_nesting_ast == NULL) { - YYLTYPE loc = this->get_location(); + state->loop_nesting_ast == NULL) { + YYLTYPE loc = this->get_location(); - _mesa_glsl_error(& loc, state, - "continue may only appear in a loop"); + _mesa_glsl_error(& loc, state, "continue may only appear in a loop"); } else if (mode == ast_break && - state->loop_nesting_ast == NULL && - state->switch_state.switch_nesting_ast == NULL) { - YYLTYPE loc = this->get_location(); + state->loop_nesting_ast == NULL && + state->switch_state.switch_nesting_ast == NULL) { + YYLTYPE loc = this->get_location(); - _mesa_glsl_error(& loc, state, - "break may only appear in a loop or a switch"); + _mesa_glsl_error(& loc, state, + "break may only appear in a loop or a switch"); } else { - /* For a loop, inline the for loop expression again, since we don't - * know where near the end of the loop body the normal copy of it is - * going to be placed. Same goes for the condition for a do-while - * loop. - */ - if (state->loop_nesting_ast != NULL && - mode == ast_continue) { + /* For a loop, inline the for loop expression again, since we don't + * know where near the end of the loop body the normal copy of it is + * going to be placed. Same goes for the condition for a do-while + * loop. + */ + if (state->loop_nesting_ast != NULL && + mode == ast_continue) { if (state->loop_nesting_ast->rest_expression) { state->loop_nesting_ast->rest_expression->hir(instructions, state); @@ -4218,26 +4196,26 @@ ast_jump_statement::hir(exec_list *instructions, } } - if (state->switch_state.is_switch_innermost && - mode == ast_break) { - /* Force break out of switch by setting is_break switch state. - */ - ir_variable *const is_break_var = state->switch_state.is_break_var; - ir_dereference_variable *const deref_is_break_var = - new(ctx) ir_dereference_variable(is_break_var); - ir_constant *const true_val = new(ctx) ir_constant(true); - ir_assignment *const set_break_var = - new(ctx) ir_assignment(deref_is_break_var, true_val); + if (state->switch_state.is_switch_innermost && + mode == ast_break) { + /* Force break out of switch by setting is_break switch state. + */ + ir_variable *const is_break_var = state->switch_state.is_break_var; + ir_dereference_variable *const deref_is_break_var = + new(ctx) ir_dereference_variable(is_break_var); + ir_constant *const true_val = new(ctx) ir_constant(true); + ir_assignment *const set_break_var = + new(ctx) ir_assignment(deref_is_break_var, true_val); - instructions->push_tail(set_break_var); - } - else { - ir_loop_jump *const jump = - new(ctx) ir_loop_jump((mode == ast_break) - ? ir_loop_jump::jump_break - : ir_loop_jump::jump_continue); - instructions->push_tail(jump); - } + instructions->push_tail(set_break_var); + } + else { + ir_loop_jump *const jump = + new(ctx) ir_loop_jump((mode == ast_break) + ? ir_loop_jump::jump_break + : ir_loop_jump::jump_continue); + instructions->push_tail(jump); + } } break; @@ -4251,7 +4229,7 @@ ast_jump_statement::hir(exec_list *instructions, ir_rvalue * ast_selection_statement::hir(exec_list *instructions, - struct _mesa_glsl_parse_state *state) + struct _mesa_glsl_parse_state *state) { void *ctx = state; @@ -4270,7 +4248,7 @@ ast_selection_statement::hir(exec_list *instructions, YYLTYPE loc = this->condition->get_location(); _mesa_glsl_error(& loc, state, "if-statement condition must be scalar " - "boolean"); + "boolean"); } ir_if *const stmt = new(ctx) ir_if(condition); @@ -4297,7 +4275,7 @@ ast_selection_statement::hir(exec_list *instructions, ir_rvalue * ast_switch_statement::hir(exec_list *instructions, - struct _mesa_glsl_parse_state *state) + struct _mesa_glsl_parse_state *state) { void *ctx = state; @@ -4314,9 +4292,9 @@ ast_switch_statement::hir(exec_list *instructions, YYLTYPE loc = this->test_expression->get_location(); _mesa_glsl_error(& loc, - state, - "switch-statement expression must be scalar " - "integer"); + state, + "switch-statement expression must be scalar " + "integer"); } /* Track the switch-statement nesting in a stack-like manner. @@ -4334,27 +4312,28 @@ ast_switch_statement::hir(exec_list *instructions, ir_rvalue *const is_fallthru_val = new (ctx) ir_constant(false); state->switch_state.is_fallthru_var = new(ctx) ir_variable(glsl_type::bool_type, - "switch_is_fallthru_tmp", - ir_var_temporary); + "switch_is_fallthru_tmp", + ir_var_temporary); instructions->push_tail(state->switch_state.is_fallthru_var); ir_dereference_variable *deref_is_fallthru_var = new(ctx) ir_dereference_variable(state->switch_state.is_fallthru_var); instructions->push_tail(new(ctx) ir_assignment(deref_is_fallthru_var, - is_fallthru_val)); + is_fallthru_val)); /* Initalize is_break state to false. */ ir_rvalue *const is_break_val = new (ctx) ir_constant(false); - state->switch_state.is_break_var = new(ctx) ir_variable(glsl_type::bool_type, - "switch_is_break_tmp", - ir_var_temporary); + state->switch_state.is_break_var = + new(ctx) ir_variable(glsl_type::bool_type, + "switch_is_break_tmp", + ir_var_temporary); instructions->push_tail(state->switch_state.is_break_var); ir_dereference_variable *deref_is_break_var = new(ctx) ir_dereference_variable(state->switch_state.is_break_var); instructions->push_tail(new(ctx) ir_assignment(deref_is_break_var, - is_break_val)); + is_break_val)); /* Cache test expression. */ @@ -4375,7 +4354,7 @@ ast_switch_statement::hir(exec_list *instructions, void ast_switch_statement::test_to_hir(exec_list *instructions, - struct _mesa_glsl_parse_state *state) + struct _mesa_glsl_parse_state *state) { void *ctx = state; @@ -4385,8 +4364,8 @@ ast_switch_statement::test_to_hir(exec_list *instructions, state); state->switch_state.test_var = new(ctx) ir_variable(test_val->type, - "switch_test_tmp", - ir_var_temporary); + "switch_test_tmp", + ir_var_temporary); ir_dereference_variable *deref_test_var = new(ctx) ir_dereference_variable(state->switch_state.test_var); @@ -4397,7 +4376,7 @@ ast_switch_statement::test_to_hir(exec_list *instructions, ir_rvalue * ast_switch_body::hir(exec_list *instructions, - struct _mesa_glsl_parse_state *state) + struct _mesa_glsl_parse_state *state) { if (stmts != NULL) stmts->hir(instructions, state); @@ -4408,7 +4387,7 @@ ast_switch_body::hir(exec_list *instructions, ir_rvalue * ast_case_statement_list::hir(exec_list *instructions, - struct _mesa_glsl_parse_state *state) + struct _mesa_glsl_parse_state *state) { foreach_list_typed (ast_case_statement, case_stmt, link, & this->cases) case_stmt->hir(instructions, state); @@ -4419,7 +4398,7 @@ ast_case_statement_list::hir(exec_list *instructions, ir_rvalue * ast_case_statement::hir(exec_list *instructions, - struct _mesa_glsl_parse_state *state) + struct _mesa_glsl_parse_state *state) { labels->hir(instructions, state); @@ -4431,8 +4410,8 @@ ast_case_statement::hir(exec_list *instructions, new(state) ir_dereference_variable(state->switch_state.is_break_var); ir_assignment *const reset_fallthru_on_break = new(state) ir_assignment(deref_is_fallthru_var, - false_val, - deref_is_break_var); + false_val, + deref_is_break_var); instructions->push_tail(reset_fallthru_on_break); /* Guard case statements depending on fallthru state. */ @@ -4452,7 +4431,7 @@ ast_case_statement::hir(exec_list *instructions, ir_rvalue * ast_case_label_list::hir(exec_list *instructions, - struct _mesa_glsl_parse_state *state) + struct _mesa_glsl_parse_state *state) { foreach_list_typed (ast_case_label, label, link, & this->labels) label->hir(instructions, state); @@ -4463,7 +4442,7 @@ ast_case_label_list::hir(exec_list *instructions, ir_rvalue * ast_case_label::hir(exec_list *instructions, - struct _mesa_glsl_parse_state *state) + struct _mesa_glsl_parse_state *state) { void *ctx = state; @@ -4481,62 +4460,57 @@ ast_case_label::hir(exec_list *instructions, ir_constant *label_const = label_rval->constant_expression_value(); if (!label_const) { - YYLTYPE loc = this->test_value->get_location(); + YYLTYPE loc = this->test_value->get_location(); - _mesa_glsl_error(& loc, state, - "switch statement case label must be a " - "constant expression"); + _mesa_glsl_error(& loc, state, + "switch statement case label must be a " + "constant expression"); - /* Stuff a dummy value in to allow processing to continue. */ - label_const = new(ctx) ir_constant(0); + /* Stuff a dummy value in to allow processing to continue. */ + label_const = new(ctx) ir_constant(0); } else { - ast_expression *previous_label = (ast_expression *) - hash_table_find(state->switch_state.labels_ht, - (void *)(uintptr_t)label_const->value.u[0]); - - if (previous_label) { - YYLTYPE loc = this->test_value->get_location(); - _mesa_glsl_error(& loc, state, - "duplicate case value"); - - loc = previous_label->get_location(); - _mesa_glsl_error(& loc, state, - "this is the previous case label"); - } else { - hash_table_insert(state->switch_state.labels_ht, - this->test_value, - (void *)(uintptr_t)label_const->value.u[0]); - } + ast_expression *previous_label = (ast_expression *) + hash_table_find(state->switch_state.labels_ht, + (void *)(uintptr_t)label_const->value.u[0]); + + if (previous_label) { + YYLTYPE loc = this->test_value->get_location(); + _mesa_glsl_error(& loc, state, "duplicate case value"); + + loc = previous_label->get_location(); + _mesa_glsl_error(& loc, state, "this is the previous case label"); + } else { + hash_table_insert(state->switch_state.labels_ht, + this->test_value, + (void *)(uintptr_t)label_const->value.u[0]); + } } ir_dereference_variable *deref_test_var = - new(ctx) ir_dereference_variable(state->switch_state.test_var); + new(ctx) ir_dereference_variable(state->switch_state.test_var); ir_rvalue *const test_cond = new(ctx) ir_expression(ir_binop_all_equal, - label_const, - deref_test_var); + label_const, + deref_test_var); ir_assignment *set_fallthru_on_test = - new(ctx) ir_assignment(deref_fallthru_var, - true_val, - test_cond); + new(ctx) ir_assignment(deref_fallthru_var, true_val, test_cond); instructions->push_tail(set_fallthru_on_test); } else { /* default case */ if (state->switch_state.previous_default) { - YYLTYPE loc = this->get_location(); - _mesa_glsl_error(& loc, state, - "multiple default labels in one switch"); + YYLTYPE loc = this->get_location(); + _mesa_glsl_error(& loc, state, + "multiple default labels in one switch"); - loc = state->switch_state.previous_default->get_location(); - _mesa_glsl_error(& loc, state, - "this is the first default label"); + loc = state->switch_state.previous_default->get_location(); + _mesa_glsl_error(& loc, state, "this is the first default label"); } state->switch_state.previous_default = this; /* Set falltrhu state. */ ir_assignment *set_fallthru = - new(ctx) ir_assignment(deref_fallthru_var, true_val); + new(ctx) ir_assignment(deref_fallthru_var, true_val); instructions->push_tail(set_fallthru); } @@ -4547,34 +4521,34 @@ ast_case_label::hir(exec_list *instructions, void ast_iteration_statement::condition_to_hir(exec_list *instructions, - struct _mesa_glsl_parse_state *state) + struct _mesa_glsl_parse_state *state) { void *ctx = state; if (condition != NULL) { ir_rvalue *const cond = - condition->hir(instructions, state); + condition->hir(instructions, state); if ((cond == NULL) - || !cond->type->is_boolean() || !cond->type->is_scalar()) { - YYLTYPE loc = condition->get_location(); + || !cond->type->is_boolean() || !cond->type->is_scalar()) { + YYLTYPE loc = condition->get_location(); - _mesa_glsl_error(& loc, state, - "loop condition must be scalar boolean"); + _mesa_glsl_error(& loc, state, + "loop condition must be scalar boolean"); } else { - /* As the first code in the loop body, generate a block that looks - * like 'if (!condition) break;' as the loop termination condition. - */ - ir_rvalue *const not_cond = - new(ctx) ir_expression(ir_unop_logic_not, cond); + /* As the first code in the loop body, generate a block that looks + * like 'if (!condition) break;' as the loop termination condition. + */ + ir_rvalue *const not_cond = + new(ctx) ir_expression(ir_unop_logic_not, cond); - ir_if *const if_stmt = new(ctx) ir_if(not_cond); + ir_if *const if_stmt = new(ctx) ir_if(not_cond); - ir_jump *const break_stmt = - new(ctx) ir_loop_jump(ir_loop_jump::jump_break); + ir_jump *const break_stmt = + new(ctx) ir_loop_jump(ir_loop_jump::jump_break); - if_stmt->then_instructions.push_tail(break_stmt); - instructions->push_tail(if_stmt); + if_stmt->then_instructions.push_tail(break_stmt); + instructions->push_tail(if_stmt); } } } @@ -4582,7 +4556,7 @@ ast_iteration_statement::condition_to_hir(exec_list *instructions, ir_rvalue * ast_iteration_statement::hir(exec_list *instructions, - struct _mesa_glsl_parse_state *state) + struct _mesa_glsl_parse_state *state) { void *ctx = state; @@ -4674,7 +4648,7 @@ is_valid_default_precision_type(const struct glsl_type *const type) ir_rvalue * ast_type_specifier::hir(exec_list *instructions, - struct _mesa_glsl_parse_state *state) + struct _mesa_glsl_parse_state *state) { if (this->default_precision == ast_precision_none && this->structure == NULL) return NULL; @@ -4796,10 +4770,10 @@ ast_type_specifier::hir(exec_list *instructions, */ unsigned ast_process_structure_or_interface_block(exec_list *instructions, - struct _mesa_glsl_parse_state *state, - exec_list *declarations, - YYLTYPE &loc, - glsl_struct_field **fields_ret, + struct _mesa_glsl_parse_state *state, + exec_list *declarations, + YYLTYPE &loc, + glsl_struct_field **fields_ret, bool is_interface, bool block_row_major, bool allow_reserved_names, @@ -4814,7 +4788,7 @@ ast_process_structure_or_interface_block(exec_list *instructions, */ foreach_list_typed (ast_declarator_list, decl_list, link, declarations) { foreach_list_const (decl_ptr, & decl_list->declarations) { - decl_count++; + decl_count++; } } @@ -4824,7 +4798,7 @@ ast_process_structure_or_interface_block(exec_list *instructions, * other structure definitions or in interface blocks are processed. */ glsl_struct_field *const fields = ralloc_array(state, glsl_struct_field, - decl_count); + decl_count); unsigned i = 0; foreach_list_typed (ast_declarator_list, decl_list, link, declarations) { @@ -4836,15 +4810,15 @@ ast_process_structure_or_interface_block(exec_list *instructions, * embedded structure definitions have been removed from the language. */ if (state->es_shader && decl_list->type->specifier->structure != NULL) { - _mesa_glsl_error(&loc, state, "embedded structure definitions are " - "not allowed in GLSL ES 1.00"); + _mesa_glsl_error(&loc, state, "embedded structure definitions are " + "not allowed in GLSL ES 1.00"); } const glsl_type *decl_type = decl_list->type->glsl_type(& type_name, state); foreach_list_typed (ast_declaration, decl, link, - &decl_list->declarations) { + &decl_list->declarations) { if (!allow_reserved_names) validate_identifier(decl->identifier, loc, state); @@ -4899,10 +4873,10 @@ ast_process_structure_or_interface_block(exec_list *instructions, "members"); } - field_type = process_array_type(&loc, decl_type, + field_type = process_array_type(&loc, decl_type, decl->array_specifier, state); fields[i].type = field_type; - fields[i].name = decl->identifier; + fields[i].name = decl->identifier; fields[i].location = -1; fields[i].interpolation = interpret_interpolation_qualifier(qual, var_mode, state, &loc); @@ -4933,7 +4907,7 @@ ast_process_structure_or_interface_block(exec_list *instructions, fields[i].row_major = false; } - i++; + i++; } } @@ -4946,7 +4920,7 @@ ast_process_structure_or_interface_block(exec_list *instructions, ir_rvalue * ast_struct_specifier::hir(exec_list *instructions, - struct _mesa_glsl_parse_state *state) + struct _mesa_glsl_parse_state *state) { YYLTYPE loc = this->get_location(); @@ -4980,10 +4954,10 @@ ast_struct_specifier::hir(exec_list *instructions, glsl_struct_field *fields; unsigned decl_count = ast_process_structure_or_interface_block(instructions, - state, - &this->declarations, - loc, - &fields, + state, + &this->declarations, + loc, + &fields, false, false, false /* allow_reserved_names */, @@ -4998,12 +4972,12 @@ ast_struct_specifier::hir(exec_list *instructions, _mesa_glsl_error(& loc, state, "struct `%s' previously defined", name); } else { const glsl_type **s = reralloc(state, state->user_structures, - const glsl_type *, - state->num_user_structures + 1); + const glsl_type *, + state->num_user_structures + 1); if (s != NULL) { - s[state->num_user_structures] = t; - state->user_structures = s; - state->num_user_structures++; + s[state->num_user_structures] = t; + state->user_structures = s; + state->num_user_structures++; } } @@ -5049,7 +5023,7 @@ private: ir_rvalue * ast_interface_block::hir(exec_list *instructions, - struct _mesa_glsl_parse_state *state) + struct _mesa_glsl_parse_state *state) { YYLTYPE loc = this->get_location(); @@ -5560,7 +5534,7 @@ ast_cs_input_layout::hir(exec_list *instructions, static void detect_conflicting_assignments(struct _mesa_glsl_parse_state *state, - exec_list *instructions) + exec_list *instructions) { bool gl_FragColor_assigned = false; bool gl_FragData_assigned = false; @@ -5575,18 +5549,18 @@ detect_conflicting_assignments(struct _mesa_glsl_parse_state *state, ir_variable *var = ((ir_instruction *)node)->as_variable(); if (!var || !var->data.assigned) - continue; + continue; if (strcmp(var->name, "gl_FragColor") == 0) - gl_FragColor_assigned = true; + gl_FragColor_assigned = true; else if (strcmp(var->name, "gl_FragData") == 0) - gl_FragData_assigned = true; + gl_FragData_assigned = true; else if (strncmp(var->name, "gl_", 3) != 0) { - if (state->stage == MESA_SHADER_FRAGMENT && - var->data.mode == ir_var_shader_out) { - user_defined_fs_output_assigned = true; - user_defined_fs_output = var; - } + if (state->stage == MESA_SHADER_FRAGMENT && + var->data.mode == ir_var_shader_out) { + user_defined_fs_output_assigned = true; + user_defined_fs_output = var; + } } } @@ -5607,15 +5581,15 @@ detect_conflicting_assignments(struct _mesa_glsl_parse_state *state, */ if (gl_FragColor_assigned && gl_FragData_assigned) { _mesa_glsl_error(&loc, state, "fragment shader writes to both " - "`gl_FragColor' and `gl_FragData'"); + "`gl_FragColor' and `gl_FragData'"); } else if (gl_FragColor_assigned && user_defined_fs_output_assigned) { _mesa_glsl_error(&loc, state, "fragment shader writes to both " - "`gl_FragColor' and `%s'", - user_defined_fs_output->name); + "`gl_FragColor' and `%s'", + user_defined_fs_output->name); } else if (gl_FragData_assigned && user_defined_fs_output_assigned) { _mesa_glsl_error(&loc, state, "fragment shader writes to both " - "`gl_FragData' and `%s'", - user_defined_fs_output->name); + "`gl_FragData' and `%s'", + user_defined_fs_output->name); } } diff --git a/mesalib/src/glsl/builtin_functions.cpp b/mesalib/src/glsl/builtin_functions.cpp index 26ea9231f..3991f9d8d 100644 --- a/mesalib/src/glsl/builtin_functions.cpp +++ b/mesalib/src/glsl/builtin_functions.cpp @@ -62,6 +62,12 @@ #include "program/prog_instruction.h" #include +#define f(x) join(x) +#define join(x) x ## f +#define M_PIf f(M_PI) +#define M_PI_2f f(M_PI_2) +#define M_PI_4f f(M_PI_4) + using namespace ir_builder; /** @@ -2538,11 +2544,11 @@ ir_expression * builtin_builder::asin_expr(ir_variable *x) { return mul(sign(x), - sub(imm(1.5707964f), + sub(imm(M_PI_2f), mul(sqrt(sub(imm(1.0f), abs(x))), - add(imm(1.5707964f), + add(imm(M_PI_2f), mul(abs(x), - add(imm(-0.21460183f), + add(imm(M_PI_4f - 1.0f), mul(abs(x), add(imm(0.086566724f), mul(abs(x), imm(-0.03102955f)))))))))); @@ -2586,7 +2592,7 @@ builtin_builder::_acos(const glsl_type *type) ir_variable *x = in_var(type, "x"); MAKE_SIG(type, always_available, 1, x); - body.emit(ret(sub(imm(1.5707964f), asin_expr(x)))); + body.emit(ret(sub(imm(M_PI_2f), asin_expr(x)))); return sig; } @@ -2623,13 +2629,13 @@ builtin_builder::_atan2(const glsl_type *type) ir_if *inner_if = new(mem_ctx) ir_if(less(x, imm(0.0f))); inner_if->then_instructions.push_tail( if_tree(gequal(y, imm(0.0f)), - assign(r, add(r, imm(3.141593f))), - assign(r, sub(r, imm(3.141593f))))); + assign(r, add(r, imm(M_PIf))), + assign(r, sub(r, imm(M_PIf))))); outer_then.emit(inner_if); /* Else... */ outer_if->else_instructions.push_tail( - assign(r, mul(sign(y), imm(1.5707965f)))); + assign(r, mul(sign(y), imm(M_PI_2f)))); body.emit(outer_if); diff --git a/mesalib/src/glsl/link_uniform_initializers.cpp b/mesalib/src/glsl/link_uniform_initializers.cpp index e60bb64bc..2100e0517 100644 --- a/mesalib/src/glsl/link_uniform_initializers.cpp +++ b/mesalib/src/glsl/link_uniform_initializers.cpp @@ -296,8 +296,10 @@ link_set_uniform_initializers(struct gl_shader_program *prog) linker::set_block_binding(prog, iface_type->name, var->data.binding); } + } else if (type->contains_atomic()) { + /* we don't actually need to do anything. */ } else { - assert(!"Explicit binding not on a sampler or UBO."); + assert(!"Explicit binding not on a sampler, UBO or atomic."); } } else if (var->constant_value) { linker::set_uniform_initializer(mem_ctx, prog, var->name, diff --git a/mesalib/src/glsl/linker.cpp b/mesalib/src/glsl/linker.cpp index c8dc0661d..c2f7f4863 100644 --- a/mesalib/src/glsl/linker.cpp +++ b/mesalib/src/glsl/linker.cpp @@ -297,7 +297,7 @@ linker_warning(gl_shader_program *prog, const char *fmt, ...) { va_list ap; - ralloc_strcat(&prog->InfoLog, "error: "); + ralloc_strcat(&prog->InfoLog, "warning: "); va_start(ap, fmt); ralloc_vasprintf_append(&prog->InfoLog, fmt, ap); va_end(ap); diff --git a/mesalib/src/glsl/lower_named_interface_blocks.cpp b/mesalib/src/glsl/lower_named_interface_blocks.cpp index 09d867ea3..04e0d36e6 100644 --- a/mesalib/src/glsl/lower_named_interface_blocks.cpp +++ b/mesalib/src/glsl/lower_named_interface_blocks.cpp @@ -125,8 +125,8 @@ flatten_named_interface_blocks_declarations::run(exec_list *instructions) for (unsigned i = 0; i < iface_t->length; i++) { const char * field_name = iface_t->fields.structure[i].name; char *iface_field_name = - ralloc_asprintf(mem_ctx, "%s.%s", - iface_t->name, field_name); + ralloc_asprintf(mem_ctx, "%s.%s.%s", + iface_t->name, var->name, field_name); ir_variable *found_var = (ir_variable *) hash_table_find(interface_namespace, @@ -217,8 +217,8 @@ flatten_named_interface_blocks_declarations::handle_rvalue(ir_rvalue **rvalue) if (var->get_interface_type() != NULL) { char *iface_field_name = - ralloc_asprintf(mem_ctx, "%s.%s", var->get_interface_type()->name, - ir->field); + ralloc_asprintf(mem_ctx, "%s.%s.%s", var->get_interface_type()->name, + var->name, ir->field); /* Find the variable in the set of flattened interface blocks */ ir_variable *found_var = (ir_variable *) hash_table_find(interface_namespace, diff --git a/mesalib/src/glsl/opt_if_simplification.cpp b/mesalib/src/glsl/opt_if_simplification.cpp index 2bec8252e..e05f03190 100644 --- a/mesalib/src/glsl/opt_if_simplification.cpp +++ b/mesalib/src/glsl/opt_if_simplification.cpp @@ -90,15 +90,9 @@ ir_if_simplification_visitor::visit_leave(ir_if *ir) * that matters out. */ if (condition_constant->value.b[0]) { - foreach_list_safe(n, &ir->then_instructions) { - ir_instruction *then_ir = (ir_instruction *) n; - ir->insert_before(then_ir); - } + ir->insert_before(&ir->then_instructions); } else { - foreach_list_safe(n, &ir->else_instructions) { - ir_instruction *else_ir = (ir_instruction *) n; - ir->insert_before(else_ir); - } + ir->insert_before(&ir->else_instructions); } ir->remove(); this->made_progress = true; diff --git a/mesalib/src/mesa/drivers/common/meta.c b/mesalib/src/mesa/drivers/common/meta.c index acf927b09..ac27abba6 100644 --- a/mesalib/src/mesa/drivers/common/meta.c +++ b/mesalib/src/mesa/drivers/common/meta.c @@ -37,6 +37,7 @@ #include "main/arbprogram.h" #include "main/arrayobj.h" #include "main/blend.h" +#include "main/blit.h" #include "main/bufferobj.h" #include "main/buffers.h" #include "main/colortab.h" @@ -93,6 +94,45 @@ static void meta_glsl_clear_cleanup(struct clear_state *clear); static void meta_decompress_cleanup(struct decompress_state *decompress); static void meta_drawpix_cleanup(struct drawpix_state *drawpix); +void +_mesa_meta_bind_fbo_image(GLenum attachment, + struct gl_texture_image *texImage, GLuint layer) +{ + struct gl_texture_object *texObj = texImage->TexObject; + int level = texImage->Level; + GLenum target = texObj->Target; + + switch (target) { + case GL_TEXTURE_1D: + _mesa_FramebufferTexture1D(GL_FRAMEBUFFER, + attachment, + target, + texObj->Name, + level); + break; + case GL_TEXTURE_1D_ARRAY: + case GL_TEXTURE_2D_ARRAY: + case GL_TEXTURE_2D_MULTISAMPLE_ARRAY: + case GL_TEXTURE_CUBE_MAP_ARRAY: + case GL_TEXTURE_3D: + _mesa_FramebufferTextureLayer(GL_FRAMEBUFFER, + attachment, + texObj->Name, + level, + layer); + break; + default: /* 2D / cube */ + if (target == GL_TEXTURE_CUBE_MAP) + target = GL_TEXTURE_CUBE_MAP_POSITIVE_X + texImage->Face; + + _mesa_FramebufferTexture2D(GL_FRAMEBUFFER, + attachment, + target, + texObj->Name, + level); + } +} + GLuint _mesa_meta_compile_shader_with_debug(struct gl_context *ctx, GLenum target, const GLcharARB *source) @@ -2421,6 +2461,9 @@ _mesa_meta_setup_texture_coords(GLenum faceTarget, GLuint i; GLfloat r; + if (faceTarget == GL_TEXTURE_CUBE_MAP_ARRAY) + faceTarget = GL_TEXTURE_CUBE_MAP_POSITIVE_X + slice % 6; + /* Currently all texture targets want the W component to be 1.0. */ coords0[3] = 1.0F; @@ -2688,6 +2731,84 @@ get_temp_image_type(struct gl_context *ctx, mesa_format format) } } +/** + * Attempts to wrap the destination texture in an FBO and use + * glBlitFramebuffer() to implement glCopyTexSubImage(). + */ +static bool +copytexsubimage_using_blit_framebuffer(struct gl_context *ctx, GLuint dims, + struct gl_texture_image *texImage, + GLint xoffset, + GLint yoffset, + GLint zoffset, + struct gl_renderbuffer *rb, + GLint x, GLint y, + GLsizei width, GLsizei height) +{ + struct gl_texture_object *texObj = texImage->TexObject; + GLuint fbo; + bool success = false; + GLbitfield mask; + GLenum status; + + if (!ctx->Extensions.ARB_framebuffer_object) + return false; + + _mesa_unlock_texture(ctx, texObj); + + _mesa_meta_begin(ctx, MESA_META_ALL); + + _mesa_GenFramebuffers(1, &fbo); + _mesa_BindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo); + + if (rb->_BaseFormat == GL_DEPTH_STENCIL || + rb->_BaseFormat == GL_DEPTH_COMPONENT) { + _mesa_meta_bind_fbo_image(GL_DEPTH_ATTACHMENT, texImage, zoffset); + mask = GL_DEPTH_BUFFER_BIT; + + if (rb->_BaseFormat == GL_DEPTH_STENCIL && + texImage->_BaseFormat == GL_DEPTH_STENCIL) { + _mesa_meta_bind_fbo_image(GL_STENCIL_ATTACHMENT, texImage, zoffset); + mask |= GL_STENCIL_BUFFER_BIT; + } + _mesa_DrawBuffer(GL_NONE); + } else { + _mesa_meta_bind_fbo_image(GL_COLOR_ATTACHMENT0, texImage, zoffset); + mask = GL_COLOR_BUFFER_BIT; + _mesa_DrawBuffer(GL_COLOR_ATTACHMENT0); + } + + status = _mesa_CheckFramebufferStatus(GL_DRAW_FRAMEBUFFER); + if (status != GL_FRAMEBUFFER_COMPLETE) + goto out; + + ctx->Meta->Blit.no_ctsi_fallback = true; + + /* Since we've bound a new draw framebuffer, we need to update + * its derived state -- _Xmin, etc -- for BlitFramebuffer's clipping to + * be correct. + */ + _mesa_update_state(ctx); + + /* We skip the core BlitFramebuffer checks for format consistency, which + * are too strict for CopyTexImage. We know meta will be fine with format + * changes. + */ + _mesa_meta_BlitFramebuffer(ctx, x, y, + x + width, y + height, + xoffset, yoffset, + xoffset + width, yoffset + height, + mask, GL_NEAREST); + ctx->Meta->Blit.no_ctsi_fallback = false; + success = true; + + out: + _mesa_lock_texture(ctx, texObj); + _mesa_DeleteFramebuffers(1, &fbo); + _mesa_meta_end(ctx); + return success; +} + /** * Helper for _mesa_meta_CopyTexSubImage1/2/3D() functions. * Have to be careful with locking and meta state for pixel transfer. @@ -2705,11 +2826,14 @@ _mesa_meta_CopyTexSubImage(struct gl_context *ctx, GLuint dims, GLint bpp; void *buf; - /* The gl_renderbuffer is part of the interface for - * dd_function_table::CopyTexSubImage, but this implementation does not use - * it. - */ - (void) rb; + if (copytexsubimage_using_blit_framebuffer(ctx, dims, + texImage, + xoffset, yoffset, zoffset, + rb, + x, y, + width, height)) { + return; + } /* Choose format/type for temporary image buffer */ format = _mesa_get_format_base_format(texImage->TexFormat); diff --git a/mesalib/src/mesa/drivers/common/meta.h b/mesalib/src/mesa/drivers/common/meta.h index 4faae0b40..fde4f9a7a 100644 --- a/mesalib/src/mesa/drivers/common/meta.h +++ b/mesalib/src/mesa/drivers/common/meta.h @@ -240,6 +240,14 @@ enum blit_msaa_shader { BLIT_MSAA_SHADER_2D_MULTISAMPLE_COPY_UINT, BLIT_MSAA_SHADER_2D_MULTISAMPLE_DEPTH_RESOLVE, BLIT_MSAA_SHADER_2D_MULTISAMPLE_DEPTH_COPY, + BLIT_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_RESOLVE, + BLIT_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_RESOLVE_INT, + BLIT_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_RESOLVE_UINT, + BLIT_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_COPY, + BLIT_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_COPY_INT, + BLIT_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_COPY_UINT, + BLIT_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_DEPTH_RESOLVE, + BLIT_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_DEPTH_COPY, BLIT_MSAA_SHADER_COUNT, }; @@ -250,10 +258,10 @@ struct blit_state { GLuint VAO; GLuint VBO; - GLuint DepthFP; struct blit_shader_table shaders; GLuint msaa_shaders[BLIT_MSAA_SHADER_COUNT]; struct temp_texture depthTex; + bool no_ctsi_fallback; }; @@ -505,4 +513,8 @@ _mesa_meta_blit_shader_table_cleanup(struct blit_shader_table *table); void _mesa_meta_glsl_generate_mipmap_cleanup(struct gen_mipmap_state *mipmap); +void +_mesa_meta_bind_fbo_image(GLenum attachment, + struct gl_texture_image *texImage, GLuint layer); + #endif /* META_H */ diff --git a/mesalib/src/mesa/drivers/common/meta_blit.c b/mesalib/src/mesa/drivers/common/meta_blit.c index 31e494fb8..5d72dd2ec 100644 --- a/mesalib/src/mesa/drivers/common/meta_blit.c +++ b/mesalib/src/mesa/drivers/common/meta_blit.c @@ -33,11 +33,13 @@ #include "main/enable.h" #include "main/enums.h" #include "main/fbobject.h" +#include "main/image.h" #include "main/macros.h" #include "main/matrix.h" #include "main/multisample.h" #include "main/objectlabel.h" #include "main/readpix.h" +#include "main/scissor.h" #include "main/shaderapi.h" #include "main/texobj.h" #include "main/texenv.h" @@ -52,37 +54,6 @@ /** Return offset in bytes of the field within a vertex struct */ #define OFFSET(FIELD) ((void *) offsetof(struct vertex, FIELD)) -/** - * One-time init for drawing depth pixels. - */ -static void -init_blit_depth_pixels(struct gl_context *ctx) -{ - static const char *program = - "!!ARBfp1.0\n" - "TEX result.depth, fragment.texcoord[0], texture[0], %s; \n" - "END \n"; - char program2[200]; - struct blit_state *blit = &ctx->Meta->Blit; - struct temp_texture *tex = _mesa_meta_get_temp_texture(ctx); - const char *texTarget; - - assert(blit->DepthFP == 0); - - /* replace %s with "RECT" or "2D" */ - assert(strlen(program) + 4 < sizeof(program2)); - if (tex->Target == GL_TEXTURE_RECTANGLE) - texTarget = "RECT"; - else - texTarget = "2D"; - _mesa_snprintf(program2, sizeof(program2), program, texTarget); - - _mesa_GenProgramsARB(1, &blit->DepthFP); - _mesa_BindProgramARB(GL_FRAGMENT_PROGRAM_ARB, blit->DepthFP); - _mesa_ProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(program2), (const GLubyte *) program2); -} - static void setup_glsl_msaa_blit_shader(struct gl_context *ctx, struct blit_state *blit, @@ -97,7 +68,9 @@ setup_glsl_msaa_blit_shader(struct gl_context *ctx, bool dst_is_msaa = false; GLenum src_datatype; const char *vec4_prefix; + const char *sampler_array_suffix = ""; char *name; + const char *texcoord_type = "vec2"; if (src_rb) { src_datatype = _mesa_get_format_datatype(src_rb->Format); @@ -125,6 +98,7 @@ setup_glsl_msaa_blit_shader(struct gl_context *ctx, switch (target) { case GL_TEXTURE_2D_MULTISAMPLE: + case GL_TEXTURE_2D_MULTISAMPLE_ARRAY: if (src_rb->_BaseFormat == GL_DEPTH_COMPONENT || src_rb->_BaseFormat == GL_DEPTH_STENCIL) { if (dst_is_msaa) @@ -137,6 +111,13 @@ setup_glsl_msaa_blit_shader(struct gl_context *ctx, else shader_index = BLIT_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE; } + + if (target == GL_TEXTURE_2D_MULTISAMPLE_ARRAY) { + shader_index += (BLIT_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_RESOLVE - + BLIT_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE); + sampler_array_suffix = "Array"; + texcoord_type = "vec3"; + } break; default: _mesa_problem(ctx, "Unkown texture target %s\n", @@ -167,6 +148,8 @@ setup_glsl_msaa_blit_shader(struct gl_context *ctx, mem_ctx = ralloc_context(NULL); if (shader_index == BLIT_MSAA_SHADER_2D_MULTISAMPLE_DEPTH_RESOLVE || + shader_index == BLIT_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_DEPTH_RESOLVE || + shader_index == BLIT_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_DEPTH_COPY || shader_index == BLIT_MSAA_SHADER_2D_MULTISAMPLE_DEPTH_COPY) { char *sample_index; const char *arb_sample_shading_extension_string; @@ -197,26 +180,31 @@ setup_glsl_msaa_blit_shader(struct gl_context *ctx, vs_source = ralloc_asprintf(mem_ctx, "#version 130\n" "in vec2 position;\n" - "in vec2 textureCoords;\n" - "out vec2 texCoords;\n" + "in %s textureCoords;\n" + "out %s texCoords;\n" "void main()\n" "{\n" " texCoords = textureCoords;\n" " gl_Position = vec4(position, 0.0, 1.0);\n" - "}\n"); + "}\n", + texcoord_type, + texcoord_type); fs_source = ralloc_asprintf(mem_ctx, "#version 130\n" "#extension GL_ARB_texture_multisample : enable\n" "%s\n" - "uniform sampler2DMS texSampler;\n" - "in vec2 texCoords;\n" + "uniform sampler2DMS%s texSampler;\n" + "in %s texCoords;\n" "out vec4 out_color;\n" "\n" "void main()\n" "{\n" - " gl_FragDepth = texelFetch(texSampler, ivec2(texCoords), %s).r;\n" + " gl_FragDepth = texelFetch(texSampler, i%s(texCoords), %s).r;\n" "}\n", arb_sample_shading_extension_string, + sampler_array_suffix, + texcoord_type, + texcoord_type, sample_index); } else { /* You can create 2D_MULTISAMPLE textures with 0 sample count (meaning 1 @@ -234,7 +222,7 @@ setup_glsl_msaa_blit_shader(struct gl_context *ctx, if (dst_is_msaa) { arb_sample_shading_extension_string = "#extension GL_ARB_sample_shading : enable"; - sample_resolve = ralloc_asprintf(mem_ctx, " out_color = texelFetch(texSampler, ivec2(texCoords), gl_SampleID);"); + sample_resolve = ralloc_asprintf(mem_ctx, " out_color = texelFetch(texSampler, i%s(texCoords), gl_SampleID);", texcoord_type); merge_function = ""; } else { int i; @@ -263,8 +251,8 @@ setup_glsl_msaa_blit_shader(struct gl_context *ctx, sample_resolve = rzalloc_size(mem_ctx, 1); for (i = 0; i < samples; i++) { ralloc_asprintf_append(&sample_resolve, - " gvec4 sample_1_%d = texelFetch(texSampler, ivec2(texCoords), %d);\n", - i, i); + " gvec4 sample_1_%d = texelFetch(texSampler, i%s(texCoords), %d);\n", + i, texcoord_type, i); } /* Now, merge each pair of samples, then merge each pair of those, * etc. @@ -294,20 +282,22 @@ setup_glsl_msaa_blit_shader(struct gl_context *ctx, vs_source = ralloc_asprintf(mem_ctx, "#version 130\n" "in vec2 position;\n" - "in vec2 textureCoords;\n" - "out vec2 texCoords;\n" + "in %s textureCoords;\n" + "out %s texCoords;\n" "void main()\n" "{\n" " texCoords = textureCoords;\n" " gl_Position = vec4(position, 0.0, 1.0);\n" - "}\n"); + "}\n", + texcoord_type, + texcoord_type); fs_source = ralloc_asprintf(mem_ctx, "#version 130\n" "#extension GL_ARB_texture_multisample : enable\n" "%s\n" "#define gvec4 %svec4\n" - "uniform %ssampler2DMS texSampler;\n" - "in vec2 texCoords;\n" + "uniform %ssampler2DMS%s texSampler;\n" + "in %s texCoords;\n" "out gvec4 out_color;\n" "\n" "%s" /* merge_function */ @@ -318,6 +308,8 @@ setup_glsl_msaa_blit_shader(struct gl_context *ctx, arb_sample_shading_extension_string, vec4_prefix, vec4_prefix, + sampler_array_suffix, + texcoord_type, merge_function, sample_resolve); } @@ -350,7 +342,8 @@ setup_glsl_blit_framebuffer(struct gl_context *ctx, _mesa_meta_setup_vertex_objects(&blit->VAO, &blit->VBO, true, 2, 2, 0); - if (target == GL_TEXTURE_2D_MULTISAMPLE) { + if (target == GL_TEXTURE_2D_MULTISAMPLE || + target == GL_TEXTURE_2D_MULTISAMPLE_ARRAY) { setup_glsl_msaa_blit_shader(ctx, blit, src_rb, target); } else { _mesa_meta_setup_blit_shader(ctx, target, &blit->shaders); @@ -389,6 +382,7 @@ blitframebuffer_texture(struct gl_context *ctx, ctx->Texture.Unit[ctx->Texture.CurrentUnit].Sampler->Name : 0; GLuint tempTex = 0; struct gl_renderbuffer *rb = readAtt->Renderbuffer; + struct temp_texture *meta_temp_texture; if (rb->NumSamples && !ctx->Extensions.ARB_texture_multisample) return false; @@ -398,23 +392,18 @@ blitframebuffer_texture(struct gl_context *ctx, filter = GL_LINEAR; } - if (readAtt->Texture) { + if (readAtt->Texture && + (readAtt->Texture->Target == GL_TEXTURE_2D || + readAtt->Texture->Target == GL_TEXTURE_RECTANGLE || + readAtt->Texture->Target == GL_TEXTURE_2D_MULTISAMPLE || + readAtt->Texture->Target == GL_TEXTURE_2D_MULTISAMPLE_ARRAY)) { /* If there's a texture attached of a type we can handle, then just use * it directly. */ srcLevel = readAtt->TextureLevel; texObj = readAtt->Texture; target = texObj->Target; - - switch (target) { - case GL_TEXTURE_2D: - case GL_TEXTURE_RECTANGLE: - case GL_TEXTURE_2D_MULTISAMPLE: - break; - default: - return false; - } - } else if (ctx->Driver.BindRenderbufferTexImage) { + } else if (!readAtt->Texture && ctx->Driver.BindRenderbufferTexImage) { /* Otherwise, we need the driver to be able to bind a renderbuffer as * a texture image. */ @@ -449,7 +438,42 @@ blitframebuffer_texture(struct gl_context *ctx, } } } else { - return false; + GLenum tex_base_format; + int srcW = abs(srcY1 - srcY0); + int srcH = abs(srcY1 - srcY0); + /* Fall back to doing a CopyTexSubImage to get the destination + * renderbuffer into a texture. + */ + if (ctx->Meta->Blit.no_ctsi_fallback) + return false; + + if (rb->NumSamples > 1) + return false; + + if (do_depth) { + meta_temp_texture = _mesa_meta_get_temp_depth_texture(ctx); + tex_base_format = GL_DEPTH_COMPONENT; + } else { + meta_temp_texture = _mesa_meta_get_temp_texture(ctx); + tex_base_format = + _mesa_base_tex_format(ctx, rb->InternalFormat); + } + + srcLevel = 0; + target = meta_temp_texture->Target; + texObj = _mesa_lookup_texture(ctx, meta_temp_texture->TexObj); + + _mesa_meta_setup_copypix_texture(ctx, meta_temp_texture, + srcX0, srcY0, + srcW, srcH, + tex_base_format, + filter); + + + srcX0 = 0; + srcY0 = 0; + srcX1 = srcW; + srcY1 = srcH; } baseLevelSave = texObj->BaseLevel; @@ -533,7 +557,8 @@ blitframebuffer_texture(struct gl_context *ctx, } else { assert(target == GL_TEXTURE_RECTANGLE_ARB || - target == GL_TEXTURE_2D_MULTISAMPLE); + target == GL_TEXTURE_2D_MULTISAMPLE || + target == GL_TEXTURE_2D_MULTISAMPLE_ARRAY); s0 = (float) srcX0; s1 = (float) srcX1; t0 = (float) srcY0; @@ -600,47 +625,53 @@ _mesa_meta_BlitFramebuffer(struct gl_context *ctx, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) { - struct blit_state *blit = &ctx->Meta->Blit; - struct temp_texture *tex = _mesa_meta_get_temp_texture(ctx); - struct temp_texture *depthTex = _mesa_meta_get_temp_depth_texture(ctx); - const GLsizei maxTexSize = tex->MaxSize; - const GLint srcX = MIN2(srcX0, srcX1); - const GLint srcY = MIN2(srcY0, srcY1); - const GLint srcW = abs(srcX1 - srcX0); - const GLint srcH = abs(srcY1 - srcY0); - const GLint dstX = MIN2(dstX0, dstX1); - const GLint dstY = MIN2(dstY0, dstY1); const GLint dstW = abs(dstX1 - dstX0); const GLint dstH = abs(dstY1 - dstY0); - const GLint srcFlipX = (srcX1 - srcX0) / srcW; - const GLint srcFlipY = (srcY1 - srcY0) / srcH; const GLint dstFlipX = (dstX1 - dstX0) / dstW; const GLint dstFlipY = (dstY1 - dstY0) / dstH; - const GLint flipX = srcFlipX * dstFlipX; - const GLint flipY = srcFlipY * dstFlipY; - struct vertex verts[4]; - GLboolean newTex; + struct { + GLint srcX0, srcY0, srcX1, srcY1; + GLint dstX0, dstY0, dstX1, dstY1; + } clip = { + srcX0, srcY0, srcX1, srcY1, + dstX0, dstY0, dstX1, dstY1 + }; + const GLboolean use_glsl_version = ctx->Extensions.ARB_vertex_shader && ctx->Extensions.ARB_fragment_shader; - /* In addition to falling back if the blit size is larger than the maximum - * texture size, fallback if the source is multisampled. This fallback can - * be removed once Mesa gets support ARB_texture_multisample. - */ - if (srcW > maxTexSize || srcH > maxTexSize) { - /* XXX avoid this fallback */ - goto fallback; - } - /* Multisample texture blit support requires texture multisample. */ if (ctx->ReadBuffer->Visual.samples > 0 && !ctx->Extensions.ARB_texture_multisample) { goto fallback; } - /* only scissor effects blit so save/clear all other relevant state */ - _mesa_meta_begin(ctx, ~MESA_META_SCISSOR); + /* Clip a copy of the blit coordinates. If these differ from the input + * coordinates, then we'll set the scissor. + */ + if (!_mesa_clip_blit(ctx, &clip.srcX0, &clip.srcY0, &clip.srcX1, &clip.srcY1, + &clip.dstX0, &clip.dstY0, &clip.dstX1, &clip.dstY1)) { + /* clipped/scissored everything away */ + return; + } + + /* Only scissor affects blit, but we're doing to set a custom scissor if + * necessary anyway, so save/clear state. + */ + _mesa_meta_begin(ctx, MESA_META_ALL); + + /* If the clipping earlier changed the destination rect at all, then + * enable the scissor to clip to it. + */ + if (clip.dstX0 != dstX0 || clip.dstY0 != dstY0 || + clip.dstX1 != dstX1 || clip.dstY1 != dstY1) { + _mesa_set_enable(ctx, GL_SCISSOR_TEST, GL_TRUE); + _mesa_Scissor(MIN2(clip.dstX0, clip.dstX1), + MIN2(clip.dstY0, clip.dstY1), + abs(clip.dstX0 - clip.dstX1), + abs(clip.dstY0 - clip.dstY1)); + } /* Try faster, direct texture approach first */ if (mask & GL_COLOR_BUFFER_BIT) { @@ -669,132 +700,10 @@ _mesa_meta_BlitFramebuffer(struct gl_context *ctx, } } - /* Choose between glsl version and fixed function version of - * BlitFramebuffer function. - */ - if (use_glsl_version) { - setup_glsl_blit_framebuffer(ctx, blit, NULL, tex->Target); - } - else { - _mesa_meta_setup_ff_tnl_for_blit(&blit->VAO, &blit->VBO, 2); - } - - /* Silence valgrind warnings about reading uninitialized stack. */ - memset(verts, 0, sizeof(verts)); - - /* Continue with "normal" approach which involves copying the src rect - * into a temporary texture and is "blitted" by drawing a textured quad. - */ - { - /* setup vertex positions */ - verts[0].x = -1.0F * flipX; - verts[0].y = -1.0F * flipY; - verts[1].x = 1.0F * flipX; - verts[1].y = -1.0F * flipY; - verts[2].x = 1.0F * flipX; - verts[2].y = 1.0F * flipY; - verts[3].x = -1.0F * flipX; - verts[3].y = 1.0F * flipY; - - } - - if (!use_glsl_version) - _mesa_set_enable(ctx, tex->Target, GL_TRUE); - - if (mask & GL_COLOR_BUFFER_BIT) { - const struct gl_framebuffer *readFb = ctx->ReadBuffer; - const struct gl_renderbuffer *colorReadRb = readFb->_ColorReadBuffer; - const GLenum rb_base_format = - _mesa_base_tex_format(ctx, colorReadRb->InternalFormat); - - /* Using the exact source rectangle to create the texture does incorrect - * linear filtering along the edges. So, allocate the texture extended along - * edges by one pixel in x, y directions. - */ - _mesa_meta_setup_copypix_texture(ctx, tex, - srcX - 1, srcY - 1, srcW + 2, srcH + 2, - rb_base_format, filter); - /* texcoords (after texture allocation!) */ - { - verts[0].tex[0] = 1.0F; - verts[0].tex[1] = 1.0F; - verts[1].tex[0] = tex->Sright - 1.0F; - verts[1].tex[1] = 1.0F; - verts[2].tex[0] = tex->Sright - 1.0F; - verts[2].tex[1] = tex->Ttop - 1.0F; - verts[3].tex[0] = 1.0F; - verts[3].tex[1] = tex->Ttop - 1.0F; - - /* upload new vertex data */ - _mesa_BufferSubData(GL_ARRAY_BUFFER_ARB, 0, sizeof(verts), verts); - } - - _mesa_set_viewport(ctx, 0, dstX, dstY, dstW, dstH); - _mesa_ColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); - _mesa_set_enable(ctx, GL_DEPTH_TEST, GL_FALSE); - _mesa_DepthMask(GL_FALSE); - _mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4); - mask &= ~GL_COLOR_BUFFER_BIT; - } - - if ((mask & GL_DEPTH_BUFFER_BIT) && - _mesa_is_desktop_gl(ctx) && - ctx->Extensions.ARB_depth_texture && - ctx->Extensions.ARB_fragment_program) { - - GLuint *tmp = malloc(srcW * srcH * sizeof(GLuint)); - - if (tmp) { - - newTex = _mesa_meta_alloc_texture(depthTex, srcW, srcH, - GL_DEPTH_COMPONENT); - _mesa_ReadPixels(srcX, srcY, srcW, srcH, GL_DEPTH_COMPONENT, - GL_UNSIGNED_INT, tmp); - _mesa_meta_setup_drawpix_texture(ctx, depthTex, newTex, - srcW, srcH, GL_DEPTH_COMPONENT, - GL_UNSIGNED_INT, tmp); - - /* texcoords (after texture allocation!) */ - { - verts[0].tex[0] = 0.0F; - verts[0].tex[1] = 0.0F; - verts[1].tex[0] = depthTex->Sright; - verts[1].tex[1] = 0.0F; - verts[2].tex[0] = depthTex->Sright; - verts[2].tex[1] = depthTex->Ttop; - verts[3].tex[0] = 0.0F; - verts[3].tex[1] = depthTex->Ttop; - - /* upload new vertex data */ - _mesa_BufferSubData(GL_ARRAY_BUFFER_ARB, 0, sizeof(verts), verts); - } - - if (!blit->DepthFP) - init_blit_depth_pixels(ctx); - - _mesa_BindProgramARB(GL_FRAGMENT_PROGRAM_ARB, blit->DepthFP); - _mesa_set_enable(ctx, GL_FRAGMENT_PROGRAM_ARB, GL_TRUE); - _mesa_ColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); - _mesa_set_enable(ctx, GL_DEPTH_TEST, GL_TRUE); - _mesa_DepthFunc(GL_ALWAYS); - _mesa_DepthMask(GL_TRUE); - - _mesa_set_viewport(ctx, 0, dstX, dstY, dstW, dstH); - _mesa_BufferSubData(GL_ARRAY_BUFFER_ARB, 0, sizeof(verts), verts); - _mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4); - mask &= ~GL_DEPTH_BUFFER_BIT; - - free(tmp); - } - } - if (mask & GL_STENCIL_BUFFER_BIT) { /* XXX can't easily do stencil */ } - if (!use_glsl_version) - _mesa_set_enable(ctx, tex->Target, GL_FALSE); - _mesa_meta_end(ctx); fallback: @@ -813,10 +722,6 @@ _mesa_meta_glsl_blit_cleanup(struct blit_state *blit) _mesa_DeleteBuffers(1, &blit->VBO); blit->VBO = 0; } - if (blit->DepthFP) { - _mesa_DeleteProgramsARB(1, &blit->DepthFP); - blit->DepthFP = 0; - } _mesa_meta_blit_shader_table_cleanup(&blit->shaders); diff --git a/mesalib/src/mesa/drivers/common/meta_generate_mipmap.c b/mesalib/src/mesa/drivers/common/meta_generate_mipmap.c index d62819c4c..3c9ac89af 100644 --- a/mesalib/src/mesa/drivers/common/meta_generate_mipmap.c +++ b/mesalib/src/mesa/drivers/common/meta_generate_mipmap.c @@ -44,38 +44,6 @@ #include "main/viewport.h" #include "drivers/common/meta.h" -/** - * Bind a particular texture level/layer to mipmap->FBO's GL_COLOR_ATTACHMENT0. - */ -static void -bind_fbo_image(struct gl_texture_object *texObj, GLenum target, - GLuint level, GLuint layer) -{ - switch (target) { - case GL_TEXTURE_1D: - _mesa_FramebufferTexture1D(GL_FRAMEBUFFER, - GL_COLOR_ATTACHMENT0, - target, - texObj->Name, - level); - break; - case GL_TEXTURE_1D_ARRAY: - case GL_TEXTURE_2D_ARRAY: - case GL_TEXTURE_3D: - _mesa_FramebufferTextureLayer(GL_FRAMEBUFFER, - GL_COLOR_ATTACHMENT0, - texObj->Name, - level, - layer); - break; - default: /* 2D / cube */ - _mesa_FramebufferTexture2D(GL_FRAMEBUFFER, - GL_COLOR_ATTACHMENT0, - target, - texObj->Name, - level); - } -} /** * Check if the call to _mesa_meta_GenerateMipmap() will require a @@ -135,7 +103,7 @@ fallback_required(struct gl_context *ctx, GLenum target, _mesa_GenFramebuffers(1, &mipmap->FBO); _mesa_BindFramebuffer(GL_FRAMEBUFFER_EXT, mipmap->FBO); - bind_fbo_image(texObj, target, srcLevel, 0); + _mesa_meta_bind_fbo_image(GL_COLOR_ATTACHMENT0, baseImage, 0); status = _mesa_CheckFramebufferStatus(GL_FRAMEBUFFER_EXT); @@ -221,7 +189,7 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target, */ if (use_glsl_version) { _mesa_meta_setup_vertex_objects(&mipmap->VAO, &mipmap->VBO, true, - 2, 3, 0); + 2, 4, 0); _mesa_meta_setup_blit_shader(ctx, target, &mipmap->shaders); } else { _mesa_meta_setup_ff_tnl_for_blit(&mipmap->VAO, &mipmap->VBO, 3); @@ -281,6 +249,7 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target, for (dstLevel = baseLevel + 1; dstLevel <= maxLevel; dstLevel++) { const struct gl_texture_image *srcImage; + struct gl_texture_image *dstImage; const GLuint srcLevel = dstLevel - 1; GLuint layer; GLsizei srcWidth, srcHeight, srcDepth; @@ -325,6 +294,7 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target, */ break; } + dstImage = _mesa_select_tex_image(ctx, texObj, faceTarget, dstLevel); /* limit minification to src level */ _mesa_TexParameteri(target, GL_TEXTURE_MAX_LEVEL, srcLevel); @@ -347,7 +317,7 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target, _mesa_BufferData(GL_ARRAY_BUFFER_ARB, sizeof(verts), verts, GL_DYNAMIC_DRAW_ARB); - bind_fbo_image(texObj, faceTarget, dstLevel, layer); + _mesa_meta_bind_fbo_image(GL_COLOR_ATTACHMENT0, dstImage, layer); /* sanity check */ if (_mesa_CheckFramebufferStatus(GL_FRAMEBUFFER) != diff --git a/mesalib/src/mesa/drivers/dri/common/utils.c b/mesalib/src/mesa/drivers/dri/common/utils.c index 1f29e0b08..eee77ec69 100644 --- a/mesalib/src/mesa/drivers/dri/common/utils.c +++ b/mesalib/src/mesa/drivers/dri/common/utils.c @@ -32,6 +32,7 @@ #include #include #include +#include #include "main/macros.h" #include "main/mtypes.h" #include "main/cpuinfo.h" @@ -40,14 +41,12 @@ #include "dri_util.h" -unsigned +uint64_t driParseDebugString( const char * debug, const struct dri_debug_control * control ) { - unsigned flag; - + uint64_t flag = 0; - flag = 0; if ( debug != NULL ) { while( control->string != NULL ) { if ( !strcmp( debug, "all" ) || diff --git a/mesalib/src/mesa/drivers/dri/common/utils.h b/mesalib/src/mesa/drivers/dri/common/utils.h index 094143446..3760c38fc 100644 --- a/mesalib/src/mesa/drivers/dri/common/utils.h +++ b/mesalib/src/mesa/drivers/dri/common/utils.h @@ -34,10 +34,10 @@ struct dri_debug_control { const char * string; - unsigned flag; + uint64_t flag; }; -extern unsigned driParseDebugString( const char * debug, +extern uint64_t driParseDebugString( const char * debug, const struct dri_debug_control * control ); extern unsigned driGetRendererString( char * buffer, diff --git a/mesalib/src/mesa/main/fbobject.c b/mesalib/src/mesa/main/fbobject.c index 6c4f1b548..ca16ae1ec 100644 --- a/mesalib/src/mesa/main/fbobject.c +++ b/mesalib/src/mesa/main/fbobject.c @@ -2676,8 +2676,7 @@ _mesa_FramebufferRenderbuffer(GLenum target, GLenum attachment, return; } else if (rb == &DummyRenderbuffer) { - /* This is what NVIDIA does */ - _mesa_error(ctx, GL_INVALID_VALUE, + _mesa_error(ctx, GL_INVALID_OPERATION, "glFramebufferRenderbufferEXT(renderbuffer %u)", renderbuffer); return; @@ -2771,8 +2770,21 @@ _mesa_GetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, } if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) { - /* the depth and stencil attachments must point to the same buffer */ const struct gl_renderbuffer_attachment *depthAtt, *stencilAtt; + if (pname == GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE) { + /* This behavior is first specified in OpenGL 4.4 specification. + * + * From the OpenGL 4.4 spec page 275: + * "This query cannot be performed for a combined depth+stencil + * attachment, since it does not have a single format." + */ + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGetFramebufferAttachmentParameteriv(" + "GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE" + " is invalid for depth+stencil attachment)"); + return; + } + /* the depth and stencil attachments must point to the same buffer */ depthAtt = get_attachment(ctx, buffer, GL_DEPTH_ATTACHMENT); stencilAtt = get_attachment(ctx, buffer, GL_STENCIL_ATTACHMENT); if (depthAtt->Renderbuffer != stencilAtt->Renderbuffer) { diff --git a/mesalib/src/mesa/main/formats.c b/mesalib/src/mesa/main/formats.c index fb2501c69..5c670115e 100644 --- a/mesalib/src/mesa/main/formats.c +++ b/mesalib/src/mesa/main/formats.c @@ -2035,6 +2035,15 @@ _mesa_is_format_signed(mesa_format format) } } +/** + * Is the given format an integer format? + */ +GLboolean +_mesa_is_format_integer(mesa_format format) +{ + const struct gl_format_info *info = _mesa_get_format_info(format); + return (info->DataType == GL_INT || info->DataType == GL_UNSIGNED_INT); +} /** * Return color encoding for given format. diff --git a/mesalib/src/mesa/main/formats.h b/mesalib/src/mesa/main/formats.h index 89bd0219e..185010e02 100644 --- a/mesalib/src/mesa/main/formats.h +++ b/mesalib/src/mesa/main/formats.h @@ -445,6 +445,9 @@ _mesa_is_format_unsigned(mesa_format format); extern GLboolean _mesa_is_format_signed(mesa_format format); +extern GLboolean +_mesa_is_format_integer(mesa_format format); + extern GLenum _mesa_get_format_color_encoding(mesa_format format); diff --git a/mesalib/src/mesa/main/getstring.c b/mesalib/src/mesa/main/getstring.c index 3ac62d402..b0bd3190b 100644 --- a/mesalib/src/mesa/main/getstring.c +++ b/mesalib/src/mesa/main/getstring.c @@ -166,7 +166,7 @@ _mesa_GetStringi(GLenum name, GLuint index) } return _mesa_get_enabled_extension(ctx, index); default: - _mesa_error( ctx, GL_INVALID_ENUM, "glGetString" ); + _mesa_error(ctx, GL_INVALID_ENUM, "glGetStringi"); return (const GLubyte *) 0; } } diff --git a/mesalib/src/mesa/main/glformats.c b/mesalib/src/mesa/main/glformats.c index 77cf26337..9bb341cc0 100644 --- a/mesalib/src/mesa/main/glformats.c +++ b/mesalib/src/mesa/main/glformats.c @@ -1238,6 +1238,22 @@ GLenum _mesa_error_check_format_and_type(const struct gl_context *ctx, GLenum format, GLenum type) { + /* From OpenGL 3.3 spec, page 220: + * "If the format is DEPTH_STENCIL, then values are taken from + * both the depth buffer and the stencil buffer. If there is no + * depth buffer or if there is no stencil buffer, then the error + * INVALID_OPERATION occurs. If the type parameter is not + * UNSIGNED_INT_24_8 or FLOAT_32_UNSIGNED_INT_24_8_REV, then the + * error INVALID_ENUM occurs." + * + * OpenGL ES still generates GL_INVALID_OPERATION because glReadPixels + * cannot be used to read depth or stencil in that API. + */ + if (_mesa_is_desktop_gl(ctx) && format == GL_DEPTH_STENCIL + && type != GL_UNSIGNED_INT_24_8 + && type != GL_FLOAT_32_UNSIGNED_INT_24_8_REV) + return GL_INVALID_ENUM; + /* special type-based checks (see glReadPixels, glDrawPixels error lists) */ switch (type) { case GL_BITMAP: diff --git a/mesalib/src/mesa/main/mtypes.h b/mesalib/src/mesa/main/mtypes.h index 4d014d1ee..66943836c 100644 --- a/mesalib/src/mesa/main/mtypes.h +++ b/mesalib/src/mesa/main/mtypes.h @@ -1402,6 +1402,9 @@ struct gl_texture_attrib /** Bitwise-OR of all Texture.Unit[i]._GenFlags */ GLbitfield _GenFlags; + + /** Upper bound on _ReallyEnabled texunits. */ + GLint _MaxEnabledTexImageUnit; }; diff --git a/mesalib/src/mesa/main/texgetimage.c b/mesalib/src/mesa/main/texgetimage.c index daabf2e81..2beb0abe6 100644 --- a/mesalib/src/mesa/main/texgetimage.c +++ b/mesalib/src/mesa/main/texgetimage.c @@ -853,6 +853,11 @@ getteximage_error_check(struct gl_context *ctx, GLenum target, GLint level, _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(format mismatch)"); return GL_TRUE; } + else if (_mesa_is_enum_format_integer(format) != + _mesa_is_format_integer(texImage->TexFormat)) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(format mismatch)"); + return GL_TRUE; + } if (!_mesa_validate_pbo_access(dimensions, &ctx->Pack, texImage->Width, texImage->Height, texImage->Depth, diff --git a/mesalib/src/mesa/main/teximage.c b/mesalib/src/mesa/main/teximage.c index 57a766f99..c7f301cbd 100644 --- a/mesalib/src/mesa/main/teximage.c +++ b/mesalib/src/mesa/main/teximage.c @@ -4374,7 +4374,7 @@ teximagemultisample(GLuint dims, GLenum target, GLsizei samples, { struct gl_texture_object *texObj; struct gl_texture_image *texImage; - GLboolean sizeOK, dimensionsOK; + GLboolean sizeOK, dimensionsOK, samplesOK; mesa_format texFormat; GLenum sample_count_error; @@ -4411,7 +4411,17 @@ teximagemultisample(GLuint dims, GLenum target, GLsizei samples, sample_count_error = _mesa_check_sample_count(ctx, target, internalformat, samples); - if (sample_count_error != GL_NO_ERROR) { + samplesOK = sample_count_error == GL_NO_ERROR; + + /* Page 254 of OpenGL 4.4 spec says: + * "Proxy arrays for two-dimensional multisample and two-dimensional + * multisample array textures are operated on in the same way when + * TexImage2DMultisample is called with target specified as + * PROXY_TEXTURE_2D_MULTISAMPLE, or TexImage3DMultisample is called + * with target specified as PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY. + * However, if samples is not supported, then no error is generated. + */ + if (!samplesOK && !_mesa_is_proxy_texture(target)) { _mesa_error(ctx, sample_count_error, "%s(samples)", func); return; } @@ -4443,7 +4453,7 @@ teximagemultisample(GLuint dims, GLenum target, GLsizei samples, width, height, depth, 0); if (_mesa_is_proxy_texture(target)) { - if (dimensionsOK && sizeOK) { + if (samplesOK && dimensionsOK && sizeOK) { init_teximage_fields_ms(ctx, texImage, width, height, depth, 0, internalformat, texFormat, samples, fixedsamplelocations); diff --git a/mesalib/src/mesa/main/texstate.c b/mesalib/src/mesa/main/texstate.c index fcae878cf..b68920ce1 100644 --- a/mesalib/src/mesa/main/texstate.c +++ b/mesalib/src/mesa/main/texstate.c @@ -550,6 +550,7 @@ update_texture_state( struct gl_context *ctx ) ctx->Texture._GenFlags = 0x0; ctx->Texture._TexMatEnabled = 0x0; ctx->Texture._TexGenEnabled = 0x0; + ctx->Texture._MaxEnabledTexImageUnit = -1; /* * Update texture unit state. @@ -636,6 +637,7 @@ update_texture_state( struct gl_context *ctx ) /* if we get here, we know this texture unit is enabled */ ctx->Texture._EnabledUnits |= (1 << unit); + ctx->Texture._MaxEnabledTexImageUnit = unit; if (enabledTargetsByStage[MESA_SHADER_FRAGMENT]) enabledFragUnits |= (1 << unit); diff --git a/mesalib/src/mesa/main/varray.c b/mesalib/src/mesa/main/varray.c index b88d70018..66a3ef119 100644 --- a/mesalib/src/mesa/main/varray.c +++ b/mesalib/src/mesa/main/varray.c @@ -738,7 +738,7 @@ get_vertex_array_attrib(struct gl_context *ctx, GLuint index, GLenum pname, case GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB: return array->Enabled; case GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB: - return array->Size; + return (array->Format == GL_BGRA) ? GL_BGRA : array->Size; case GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB: return array->Stride; case GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB: diff --git a/mesalib/src/mesa/state_tracker/st_atom_framebuffer.c b/mesalib/src/mesa/state_tracker/st_atom_framebuffer.c index 4c4f839d1..a17417c35 100644 --- a/mesalib/src/mesa/state_tracker/st_atom_framebuffer.c +++ b/mesalib/src/mesa/state_tracker/st_atom_framebuffer.c @@ -31,6 +31,8 @@ * Brian Paul */ +#include + #include "st_context.h" #include "st_atom.h" #include "st_cb_bitmap.h" @@ -43,6 +45,26 @@ #include "util/u_format.h" +/** + * Update framebuffer size. + * + * We need to derive pipe_framebuffer size from the bound pipe_surfaces here + * instead of copying gl_framebuffer size because for certain target types + * (like PIPE_TEXTURE_1D_ARRAY) gl_framebuffer::Height has the number of layers + * instead of 1. + */ +static void +update_framebuffer_size(struct pipe_framebuffer_state *framebuffer, + struct pipe_surface *surface) +{ + assert(surface); + assert(surface->width < UINT_MAX); + assert(surface->height < UINT_MAX); + framebuffer->width = MIN2(framebuffer->width, surface->width); + framebuffer->height = MIN2(framebuffer->height, surface->height); +} + + /** * Update framebuffer state (color, depth, stencil, etc. buffers) */ @@ -57,8 +79,8 @@ update_framebuffer_state( struct st_context *st ) st_flush_bitmap_cache(st); st->state.fb_orientation = st_fb_orientation(fb); - framebuffer->width = fb->Width; - framebuffer->height = fb->Height; + framebuffer->width = UINT_MAX; + framebuffer->height = UINT_MAX; /*printf("------ fb size %d x %d\n", fb->Width, fb->Height);*/ @@ -81,6 +103,7 @@ update_framebuffer_state( struct st_context *st ) if (strb->surface) { pipe_surface_reference(&framebuffer->cbufs[i], strb->surface); + update_framebuffer_size(framebuffer, strb->surface); } strb->defined = GL_TRUE; /* we'll be drawing something */ } @@ -100,12 +123,14 @@ update_framebuffer_state( struct st_context *st ) st_update_renderbuffer_surface(st, strb); } pipe_surface_reference(&framebuffer->zsbuf, strb->surface); + update_framebuffer_size(framebuffer, strb->surface); } else { strb = st_renderbuffer(fb->Attachment[BUFFER_STENCIL].Renderbuffer); if (strb) { assert(strb->surface); pipe_surface_reference(&framebuffer->zsbuf, strb->surface); + update_framebuffer_size(framebuffer, strb->surface); } else pipe_surface_reference(&framebuffer->zsbuf, NULL); @@ -122,6 +147,12 @@ update_framebuffer_state( struct st_context *st ) } #endif + /* _mesa_test_framebuffer_completeness refuses framebuffers with no + * attachments, so this should never happen. + */ + assert(framebuffer->width != UINT_MAX); + assert(framebuffer->height != UINT_MAX); + cso_set_framebuffer(st->cso_context, framebuffer); } diff --git a/mesalib/src/mesa/state_tracker/st_extensions.c b/mesalib/src/mesa/state_tracker/st_extensions.c index 059989342..70726886e 100644 --- a/mesalib/src/mesa/state_tracker/st_extensions.c +++ b/mesalib/src/mesa/state_tracker/st_extensions.c @@ -635,6 +635,8 @@ void st_init_extensions(struct st_context *st) if (!st->options.disable_shader_bit_encoding) { ctx->Extensions.ARB_shader_bit_encoding = GL_TRUE; } + + ctx->Extensions.EXT_shader_integer_mix = GL_TRUE; } else { /* Optional integer support for GLSL 1.2. */ if (screen->get_shader_param(screen, PIPE_SHADER_VERTEX, @@ -642,6 +644,8 @@ void st_init_extensions(struct st_context *st) screen->get_shader_param(screen, PIPE_SHADER_FRAGMENT, PIPE_SHADER_CAP_INTEGERS)) { ctx->Const.NativeIntegers = GL_TRUE; + + ctx->Extensions.EXT_shader_integer_mix = GL_TRUE; } } diff --git a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index edd0aa765..15b5279b8 100644 --- a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -632,7 +632,10 @@ glsl_to_tgsi_visitor::get_opcode(ir_instruction *ir, unsigned op, st_src_reg src0, st_src_reg src1) { int type = GLSL_TYPE_FLOAT; - + + if (op == TGSI_OPCODE_MOV) + return op; + assert(src0.type != GLSL_TYPE_ARRAY); assert(src0.type != GLSL_TYPE_STRUCT); assert(src1.type != GLSL_TYPE_ARRAY); diff --git a/mesalib/src/mesa/state_tracker/st_texture.c b/mesalib/src/mesa/state_tracker/st_texture.c index f664ef5f1..92035e801 100644 --- a/mesalib/src/mesa/state_tracker/st_texture.c +++ b/mesalib/src/mesa/state_tracker/st_texture.c @@ -443,7 +443,7 @@ struct pipe_sampler_view ** st_texture_get_sampler_view(struct st_context *st, struct st_texture_object *stObj) { - struct pipe_sampler_view **used = NULL, **free = NULL; + struct pipe_sampler_view *used = NULL, **free = NULL; GLuint i; for (i = 0; i < stObj->num_sampler_views; ++i) { @@ -455,7 +455,7 @@ st_texture_get_sampler_view(struct st_context *st, return sv; /* Wasn't the right one, but remember it as template */ - used = sv; + used = *sv; } else { /* Found a free slot, remember that */ free = sv; @@ -475,7 +475,7 @@ st_texture_get_sampler_view(struct st_context *st, /* Add just any sampler view to be used as a template */ if (used) - pipe_sampler_view_reference(free, *used); + pipe_sampler_view_reference(free, used); return free; } diff --git a/mesalib/src/mesa/swrast/s_blit.c b/mesalib/src/mesa/swrast/s_blit.c index 1ba188c5f..e3b45f146 100644 --- a/mesalib/src/mesa/swrast/s_blit.c +++ b/mesalib/src/mesa/swrast/s_blit.c @@ -29,6 +29,7 @@ #include "main/macros.h" #include "main/format_unpack.h" #include "main/format_pack.h" +#include "main/condrender.h" #include "s_context.h" @@ -748,6 +749,13 @@ _swrast_BlitFramebuffer(struct gl_context *ctx, }; GLint i; + /* Page 679 of OpenGL 4.4 spec says: + * "Added BlitFramebuffer to commands affected by conditional rendering in + * section 10.10 (Bug 9562)." + */ + if (!_mesa_check_conditional_render(ctx)) + return; /* Do not blit */ + if (!_mesa_clip_blit(ctx, &srcX0, &srcY0, &srcX1, &srcY1, &dstX0, &dstY0, &dstX1, &dstY1)) { return; diff --git a/pixman/pixman/pixman-arm-neon-asm.h b/pixman/pixman/pixman-arm-neon-asm.h index d0d92d74c..bdcf6a9d4 100644 --- a/pixman/pixman/pixman-arm-neon-asm.h +++ b/pixman/pixman/pixman-arm-neon-asm.h @@ -631,14 +631,8 @@ local skip1 src_basereg_ = 0, \ mask_basereg_ = 24 - .func fname - .global fname - /* For ELF format also set function visibility to hidden */ -#ifdef __ELF__ - .hidden fname - .type fname, %function -#endif -fname: + pixman_asm_function fname + push {r4-r12, lr} /* save all registers */ /* @@ -945,14 +939,8 @@ fname: src_basereg_ = 0, \ mask_basereg_ = 24 - .func fname - .global fname - /* For ELF format also set function visibility to hidden */ -#ifdef __ELF__ - .hidden fname - .type fname, %function -#endif -fname: + pixman_asm_function fname + .set PREFETCH_TYPE_CURRENT, PREFETCH_TYPE_NONE /* * Make some macro arguments globally visible and accessible diff --git a/pixman/pixman/pixman-arm-simd-asm.S b/pixman/pixman/pixman-arm-simd-asm.S index dd6f78817..bc02ebb57 100644 --- a/pixman/pixman/pixman-arm-simd-asm.S +++ b/pixman/pixman/pixman-arm-simd-asm.S @@ -37,6 +37,7 @@ .altmacro .p2align 2 +#include "pixman-arm-asm.h" #include "pixman-arm-simd-asm.h" /* A head macro should do all processing which results in an output of up to @@ -689,3 +690,372 @@ generate_composite_function \ /******************************************************************************/ +.macro over_white_8888_8888_ca_init + HALF .req SRC + TMP0 .req STRIDE_D + TMP1 .req STRIDE_S + TMP2 .req STRIDE_M + TMP3 .req ORIG_W + WK4 .req SCRATCH + line_saved_regs STRIDE_D, STRIDE_M, ORIG_W + ldr SCRATCH, =0x800080 + mov HALF, #0x80 + /* Set GE[3:0] to 0101 so SEL instructions do what we want */ + uadd8 SCRATCH, SCRATCH, SCRATCH + .set DST_PRELOAD_BIAS, 8 +.endm + +.macro over_white_8888_8888_ca_cleanup + .set DST_PRELOAD_BIAS, 0 + .unreq HALF + .unreq TMP0 + .unreq TMP1 + .unreq TMP2 + .unreq TMP3 + .unreq WK4 +.endm + +.macro over_white_8888_8888_ca_combine m, d + uxtb16 TMP1, TMP0 /* rb_notmask */ + uxtb16 TMP2, d /* rb_dest; 1 stall follows */ + smlatt TMP3, TMP2, TMP1, HALF /* red */ + smlabb TMP2, TMP2, TMP1, HALF /* blue */ + uxtb16 TMP0, TMP0, ror #8 /* ag_notmask */ + uxtb16 TMP1, d, ror #8 /* ag_dest; 1 stall follows */ + smlatt d, TMP1, TMP0, HALF /* alpha */ + smlabb TMP1, TMP1, TMP0, HALF /* green */ + pkhbt TMP0, TMP2, TMP3, lsl #16 /* rb; 1 stall follows */ + pkhbt TMP1, TMP1, d, lsl #16 /* ag */ + uxtab16 TMP0, TMP0, TMP0, ror #8 + uxtab16 TMP1, TMP1, TMP1, ror #8 + mov TMP0, TMP0, ror #8 + sel d, TMP0, TMP1 + uqadd8 d, d, m /* d is a late result */ +.endm + +.macro over_white_8888_8888_ca_1pixel_head + pixld , 4, 1, MASK, 0 + pixld , 4, 3, DST, 0 +.endm + +.macro over_white_8888_8888_ca_1pixel_tail + mvn TMP0, WK1 + teq WK1, WK1, asr #32 + bne 01f + bcc 03f + mov WK3, WK1 + b 02f +01: over_white_8888_8888_ca_combine WK1, WK3 +02: pixst , 4, 3, DST +03: +.endm + +.macro over_white_8888_8888_ca_2pixels_head + pixld , 8, 1, MASK, 0 +.endm + +.macro over_white_8888_8888_ca_2pixels_tail + pixld , 8, 3, DST + mvn TMP0, WK1 + teq WK1, WK1, asr #32 + bne 01f + movcs WK3, WK1 + bcs 02f + teq WK2, #0 + beq 05f + b 02f +01: over_white_8888_8888_ca_combine WK1, WK3 +02: mvn TMP0, WK2 + teq WK2, WK2, asr #32 + bne 03f + movcs WK4, WK2 + b 04f +03: over_white_8888_8888_ca_combine WK2, WK4 +04: pixst , 8, 3, DST +05: +.endm + +.macro over_white_8888_8888_ca_process_head cond, numbytes, firstreg, unaligned_src, unaligned_mask, preload + .if numbytes == 4 + over_white_8888_8888_ca_1pixel_head + .else + .if numbytes == 16 + over_white_8888_8888_ca_2pixels_head + over_white_8888_8888_ca_2pixels_tail + .endif + over_white_8888_8888_ca_2pixels_head + .endif +.endm + +.macro over_white_8888_8888_ca_process_tail cond, numbytes, firstreg + .if numbytes == 4 + over_white_8888_8888_ca_1pixel_tail + .else + over_white_8888_8888_ca_2pixels_tail + .endif +.endm + +generate_composite_function \ + pixman_composite_over_white_8888_8888_ca_asm_armv6, 0, 32, 32 \ + FLAG_DST_READWRITE | FLAG_BRANCH_OVER | FLAG_PROCESS_CORRUPTS_PSR | FLAG_PROCESS_DOES_STORE | FLAG_SPILL_LINE_VARS | FLAG_PROCESS_CORRUPTS_SCRATCH \ + 2, /* prefetch distance */ \ + over_white_8888_8888_ca_init, \ + nop_macro, /* newline */ \ + over_white_8888_8888_ca_cleanup, \ + over_white_8888_8888_ca_process_head, \ + over_white_8888_8888_ca_process_tail + + +.macro over_n_8888_8888_ca_init + /* Set up constants. RB_SRC and AG_SRC are in registers; + * RB_FLDS, A_SRC, and the two HALF values need to go on the + * stack (and the ful SRC value is already there) */ + ldr SCRATCH, [sp, #ARGS_STACK_OFFSET] + mov WK0, #0x00FF0000 + orr WK0, WK0, #0xFF /* RB_FLDS (0x00FF00FF) */ + mov WK1, #0x80 /* HALF default value */ + mov WK2, SCRATCH, lsr #24 /* A_SRC */ + orr WK3, WK1, WK1, lsl #16 /* HALF alternate value (0x00800080) */ + push {WK0-WK3} + .set ARGS_STACK_OFFSET, ARGS_STACK_OFFSET+16 + uxtb16 SRC, SCRATCH + uxtb16 STRIDE_S, SCRATCH, ror #8 + + /* Set GE[3:0] to 0101 so SEL instructions do what we want */ + uadd8 SCRATCH, WK3, WK3 + + .unreq WK0 + .unreq WK1 + .unreq WK2 + .unreq WK3 + WK0 .req Y + WK1 .req STRIDE_D + RB_SRC .req SRC + AG_SRC .req STRIDE_S + WK2 .req STRIDE_M + RB_FLDS .req r8 /* the reloaded constants have to be at consecutive registers starting at an even one */ + A_SRC .req r8 + HALF .req r9 + WK3 .req r10 + WK4 .req r11 + WK5 .req SCRATCH + WK6 .req ORIG_W + + line_saved_regs Y, STRIDE_D, STRIDE_M, ORIG_W +.endm + +.macro over_n_8888_8888_ca_cleanup + add sp, sp, #16 + .set ARGS_STACK_OFFSET, ARGS_STACK_OFFSET-16 + + .unreq WK0 + .unreq WK1 + .unreq RB_SRC + .unreq AG_SRC + .unreq WK2 + .unreq RB_FLDS + .unreq A_SRC + .unreq HALF + .unreq WK3 + .unreq WK4 + .unreq WK5 + .unreq WK6 + WK0 .req r8 + WK1 .req r9 + WK2 .req r10 + WK3 .req r11 +.endm + +.macro over_n_8888_8888_ca_1pixel_head + pixld , 4, 6, MASK, 0 + pixld , 4, 0, DST, 0 +.endm + +.macro over_n_8888_8888_ca_1pixel_tail + ldrd A_SRC, HALF, [sp, #LOCALS_STACK_OFFSET+8] + uxtb16 WK1, WK6 /* rb_mask (first step of hard case placed in what would otherwise be a stall) */ + teq WK6, WK6, asr #32 /* Zc if transparent, ZC if opaque */ + bne 20f + bcc 40f + /* Mask is fully opaque (all channels) */ + ldr WK6, [sp, #ARGS_STACK_OFFSET] /* get SRC back */ + eors A_SRC, A_SRC, #0xFF + bne 10f + /* Source is also opaque - same as src_8888_8888 */ + mov WK0, WK6 + b 30f +10: /* Same as over_8888_8888 */ + mul_8888_8 WK0, A_SRC, WK5, HALF + uqadd8 WK0, WK0, WK6 + b 30f +20: /* No simplifications possible - do it the hard way */ + uxtb16 WK2, WK6, ror #8 /* ag_mask */ + mla WK3, WK1, A_SRC, HALF /* rb_mul; 2 cycles */ + mla WK4, WK2, A_SRC, HALF /* ag_mul; 2 cycles */ + ldrd RB_FLDS, HALF, [sp, #LOCALS_STACK_OFFSET] + uxtb16 WK5, WK0 /* rb_dest */ + uxtab16 WK3, WK3, WK3, ror #8 + uxtb16 WK6, WK0, ror #8 /* ag_dest */ + uxtab16 WK4, WK4, WK4, ror #8 + smlatt WK0, RB_SRC, WK1, HALF /* red1 */ + smlabb WK1, RB_SRC, WK1, HALF /* blue1 */ + bic WK3, RB_FLDS, WK3, lsr #8 + bic WK4, RB_FLDS, WK4, lsr #8 + pkhbt WK1, WK1, WK0, lsl #16 /* rb1 */ + smlatt WK0, WK5, WK3, HALF /* red2 */ + smlabb WK3, WK5, WK3, HALF /* blue2 */ + uxtab16 WK1, WK1, WK1, ror #8 + smlatt WK5, AG_SRC, WK2, HALF /* alpha1 */ + pkhbt WK3, WK3, WK0, lsl #16 /* rb2 */ + smlabb WK0, AG_SRC, WK2, HALF /* green1 */ + smlatt WK2, WK6, WK4, HALF /* alpha2 */ + smlabb WK4, WK6, WK4, HALF /* green2 */ + pkhbt WK0, WK0, WK5, lsl #16 /* ag1 */ + uxtab16 WK3, WK3, WK3, ror #8 + pkhbt WK4, WK4, WK2, lsl #16 /* ag2 */ + uxtab16 WK0, WK0, WK0, ror #8 + uxtab16 WK4, WK4, WK4, ror #8 + mov WK1, WK1, ror #8 + mov WK3, WK3, ror #8 + sel WK2, WK1, WK0 /* recombine source*mask */ + sel WK1, WK3, WK4 /* recombine dest*(1-source_alpha*mask) */ + uqadd8 WK0, WK1, WK2 /* followed by 1 stall */ +30: /* The destination buffer is already in the L1 cache, so + * there's little point in amalgamating writes */ + pixst , 4, 0, DST +40: +.endm + +.macro over_n_8888_8888_ca_process_head cond, numbytes, firstreg, unaligned_src, unaligned_mask, preload + .rept (numbytes / 4) - 1 + over_n_8888_8888_ca_1pixel_head + over_n_8888_8888_ca_1pixel_tail + .endr + over_n_8888_8888_ca_1pixel_head +.endm + +.macro over_n_8888_8888_ca_process_tail cond, numbytes, firstreg + over_n_8888_8888_ca_1pixel_tail +.endm + +pixman_asm_function pixman_composite_over_n_8888_8888_ca_asm_armv6 + ldr ip, [sp] + cmp ip, #-1 + beq pixman_composite_over_white_8888_8888_ca_asm_armv6 + /* else drop through... */ + .endfunc +generate_composite_function \ + pixman_composite_over_n_8888_8888_ca_asm_armv6_helper, 0, 32, 32 \ + FLAG_DST_READWRITE | FLAG_BRANCH_OVER | FLAG_PROCESS_CORRUPTS_PSR | FLAG_PROCESS_DOES_STORE | FLAG_SPILL_LINE_VARS | FLAG_PROCESS_CORRUPTS_SCRATCH | FLAG_PROCESS_CORRUPTS_WK0 \ + 2, /* prefetch distance */ \ + over_n_8888_8888_ca_init, \ + nop_macro, /* newline */ \ + over_n_8888_8888_ca_cleanup, \ + over_n_8888_8888_ca_process_head, \ + over_n_8888_8888_ca_process_tail + +/******************************************************************************/ + +.macro in_reverse_8888_8888_init + /* Hold loop invariant in MASK */ + ldr MASK, =0x00800080 + /* Set GE[3:0] to 0101 so SEL instructions do what we want */ + uadd8 SCRATCH, MASK, MASK + /* Offset the source pointer: we only need the alpha bytes */ + add SRC, SRC, #3 + line_saved_regs ORIG_W +.endm + +.macro in_reverse_8888_8888_head numbytes, reg1, reg2, reg3 + ldrb ORIG_W, [SRC], #4 + .if numbytes >= 8 + ldrb WK®1, [SRC], #4 + .if numbytes == 16 + ldrb WK®2, [SRC], #4 + ldrb WK®3, [SRC], #4 + .endif + .endif + add DST, DST, #numbytes +.endm + +.macro in_reverse_8888_8888_process_head cond, numbytes, firstreg, unaligned_src, unaligned_mask, preload + in_reverse_8888_8888_head numbytes, firstreg, %(firstreg+1), %(firstreg+2) +.endm + +.macro in_reverse_8888_8888_1pixel s, d, offset, is_only + .if is_only != 1 + movs s, ORIG_W + .if offset != 0 + ldrb ORIG_W, [SRC, #offset] + .endif + beq 01f + teq STRIDE_M, #0xFF + beq 02f + .endif + uxtb16 SCRATCH, d /* rb_dest */ + uxtb16 d, d, ror #8 /* ag_dest */ + mla SCRATCH, SCRATCH, s, MASK + mla d, d, s, MASK + uxtab16 SCRATCH, SCRATCH, SCRATCH, ror #8 + uxtab16 d, d, d, ror #8 + mov SCRATCH, SCRATCH, ror #8 + sel d, SCRATCH, d + b 02f + .if offset == 0 +48: /* Last mov d,#0 of the set - used as part of shortcut for + * source values all 0 */ + .endif +01: mov d, #0 +02: +.endm + +.macro in_reverse_8888_8888_tail numbytes, reg1, reg2, reg3, reg4 + .if numbytes == 4 + teq ORIG_W, ORIG_W, asr #32 + ldrne WK®1, [DST, #-4] + .elseif numbytes == 8 + teq ORIG_W, WK®1 + teqeq ORIG_W, ORIG_W, asr #32 /* all 0 or all -1? */ + ldmnedb DST, {WK®1-WK®2} + .else + teq ORIG_W, WK®1 + teqeq ORIG_W, WK®2 + teqeq ORIG_W, WK®3 + teqeq ORIG_W, ORIG_W, asr #32 /* all 0 or all -1? */ + ldmnedb DST, {WK®1-WK®4} + .endif + cmnne DST, #0 /* clear C if NE */ + bcs 49f /* no writes to dest if source all -1 */ + beq 48f /* set dest to all 0 if source all 0 */ + .if numbytes == 4 + in_reverse_8888_8888_1pixel ORIG_W, WK®1, 0, 1 + str WK®1, [DST, #-4] + .elseif numbytes == 8 + in_reverse_8888_8888_1pixel STRIDE_M, WK®1, -4, 0 + in_reverse_8888_8888_1pixel STRIDE_M, WK®2, 0, 0 + stmdb DST, {WK®1-WK®2} + .else + in_reverse_8888_8888_1pixel STRIDE_M, WK®1, -12, 0 + in_reverse_8888_8888_1pixel STRIDE_M, WK®2, -8, 0 + in_reverse_8888_8888_1pixel STRIDE_M, WK®3, -4, 0 + in_reverse_8888_8888_1pixel STRIDE_M, WK®4, 0, 0 + stmdb DST, {WK®1-WK®4} + .endif +49: +.endm + +.macro in_reverse_8888_8888_process_tail cond, numbytes, firstreg + in_reverse_8888_8888_tail numbytes, firstreg, %(firstreg+1), %(firstreg+2), %(firstreg+3) +.endm + +generate_composite_function \ + pixman_composite_in_reverse_8888_8888_asm_armv6, 32, 0, 32 \ + FLAG_DST_READWRITE | FLAG_BRANCH_OVER | FLAG_PROCESS_CORRUPTS_PSR | FLAG_PROCESS_DOES_STORE | FLAG_SPILL_LINE_VARS | FLAG_PROCESS_CORRUPTS_SCRATCH | FLAG_NO_PRELOAD_DST \ + 2, /* prefetch distance */ \ + in_reverse_8888_8888_init, \ + nop_macro, /* newline */ \ + nop_macro, /* cleanup */ \ + in_reverse_8888_8888_process_head, \ + in_reverse_8888_8888_process_tail + +/******************************************************************************/ diff --git a/pixman/pixman/pixman-arm-simd-asm.h b/pixman/pixman/pixman-arm-simd-asm.h index 24b1ad2f9..8de060a6b 100644 --- a/pixman/pixman/pixman-arm-simd-asm.h +++ b/pixman/pixman/pixman-arm-simd-asm.h @@ -76,6 +76,16 @@ .set FLAG_SPILL_LINE_VARS, 48 .set FLAG_PROCESS_CORRUPTS_SCRATCH, 0 .set FLAG_PROCESS_PRESERVES_SCRATCH, 64 +.set FLAG_PROCESS_PRESERVES_WK0, 0 +.set FLAG_PROCESS_CORRUPTS_WK0, 128 /* if possible, use the specified register(s) instead so WK0 can hold number of leading pixels */ +.set FLAG_PRELOAD_DST, 0 +.set FLAG_NO_PRELOAD_DST, 256 + +/* + * Number of bytes by which to adjust preload offset of destination + * buffer (allows preload instruction to be moved before the load(s)) + */ +.set DST_PRELOAD_BIAS, 0 /* * Offset into stack where mask and source pointer/stride can be accessed. @@ -86,6 +96,11 @@ .set ARGS_STACK_OFFSET, (9*4) #endif +/* + * Offset into stack where space allocated during init macro can be accessed. + */ +.set LOCALS_STACK_OFFSET, 0 + /* * Constants for selecting preferable prefetch type. */ @@ -359,23 +374,41 @@ .macro test_bits_1_0_ptr + .if (flags) & FLAG_PROCESS_CORRUPTS_WK0 + movs SCRATCH, X, lsl #32-1 /* C,N = bits 1,0 of DST */ + .else movs SCRATCH, WK0, lsl #32-1 /* C,N = bits 1,0 of DST */ + .endif .endm .macro test_bits_3_2_ptr + .if (flags) & FLAG_PROCESS_CORRUPTS_WK0 + movs SCRATCH, X, lsl #32-3 /* C,N = bits 3, 2 of DST */ + .else movs SCRATCH, WK0, lsl #32-3 /* C,N = bits 3, 2 of DST */ + .endif .endm .macro leading_15bytes process_head, process_tail /* On entry, WK0 bits 0-3 = number of bytes until destination is 16-byte aligned */ + .set DECREMENT_X, 1 + .if (flags) & FLAG_PROCESS_CORRUPTS_WK0 + .set DECREMENT_X, 0 + sub X, X, WK0, lsr #dst_bpp_shift + str X, [sp, #LINE_SAVED_REG_COUNT*4] + mov X, WK0 + .endif /* Use unaligned loads in all cases for simplicity */ .if dst_w_bpp == 8 - conditional_process2 test_bits_1_0_ptr, mi, cs, process_head, process_tail, 1, 2, 1, 2, 1, 1, 1 + conditional_process2 test_bits_1_0_ptr, mi, cs, process_head, process_tail, 1, 2, 1, 2, 1, 1, DECREMENT_X .elseif dst_w_bpp == 16 test_bits_1_0_ptr - conditional_process1 cs, process_head, process_tail, 2, 2, 1, 1, 1 + conditional_process1 cs, process_head, process_tail, 2, 2, 1, 1, DECREMENT_X + .endif + conditional_process2 test_bits_3_2_ptr, mi, cs, process_head, process_tail, 4, 8, 1, 2, 1, 1, DECREMENT_X + .if (flags) & FLAG_PROCESS_CORRUPTS_WK0 + ldr X, [sp, #LINE_SAVED_REG_COUNT*4] .endif - conditional_process2 test_bits_3_2_ptr, mi, cs, process_head, process_tail, 4, 8, 1, 2, 1, 1, 1 .endm .macro test_bits_3_2_pix @@ -414,7 +447,7 @@ preload_middle src_bpp, SRC, 0 preload_middle mask_bpp, MASK, 0 .endif - .if (dst_r_bpp > 0) && ((SUBBLOCK % 2) == 0) + .if (dst_r_bpp > 0) && ((SUBBLOCK % 2) == 0) && (((flags) & FLAG_NO_PRELOAD_DST) == 0) /* Because we know that writes are 16-byte aligned, it's relatively easy to ensure that * destination prefetches are 32-byte aligned. It's also the easiest channel to offset * preloads for, to achieve staggered prefetches for multiple channels, because there are @@ -437,11 +470,11 @@ .if dst_r_bpp > 0 tst DST, #16 bne 111f - process_inner_loop process_head, process_tail, unaligned_src, unaligned_mask, 16 + process_inner_loop process_head, process_tail, unaligned_src, unaligned_mask, 16 + DST_PRELOAD_BIAS b 112f 111: .endif - process_inner_loop process_head, process_tail, unaligned_src, unaligned_mask, 0 + process_inner_loop process_head, process_tail, unaligned_src, unaligned_mask, 0 + DST_PRELOAD_BIAS 112: /* Just before the final (prefetch_distance+1) 32-byte blocks, deal with final preloads */ .if (src_bpp*pix_per_block > 256) || (mask_bpp*pix_per_block > 256) || (dst_r_bpp*pix_per_block > 256) @@ -449,7 +482,9 @@ .endif preload_trailing src_bpp, src_bpp_shift, SRC preload_trailing mask_bpp, mask_bpp_shift, MASK + .if ((flags) & FLAG_NO_PRELOAD_DST) == 0 preload_trailing dst_r_bpp, dst_bpp_shift, DST + .endif add X, X, #(prefetch_distance+2)*pix_per_block - 128/dst_w_bpp /* The remainder of the line is handled identically to the medium case */ medium_case_inner_loop_and_trailing_pixels process_head, process_tail,, exit_label, unaligned_src, unaligned_mask @@ -561,13 +596,7 @@ process_tail, \ process_inner_loop - .func fname - .global fname - /* For ELF format also set function visibility to hidden */ -#ifdef __ELF__ - .hidden fname - .type fname, %function -#endif + pixman_asm_function fname /* * Make some macro arguments globally visible and accessible @@ -679,7 +708,6 @@ SCRATCH .req r12 ORIG_W .req r14 /* width (pixels) */ -fname: push {r4-r11, lr} /* save all registers */ subs Y, Y, #1 @@ -705,6 +733,13 @@ fname: #endif init + + .if (flags) & FLAG_PROCESS_CORRUPTS_WK0 + /* Reserve a word in which to store X during leading pixels */ + sub sp, sp, #4 + .set ARGS_STACK_OFFSET, ARGS_STACK_OFFSET+4 + .set LOCALS_STACK_OFFSET, LOCALS_STACK_OFFSET+4 + .endif lsl STRIDE_D, #dst_bpp_shift /* stride in bytes */ sub STRIDE_D, STRIDE_D, X, lsl #dst_bpp_shift @@ -734,12 +769,16 @@ fname: .if (flags) & FLAG_SPILL_LINE_VARS_WIDE /* This is stmdb sp!,{} */ .word 0xE92D0000 | LINE_SAVED_REGS + .set ARGS_STACK_OFFSET, ARGS_STACK_OFFSET + LINE_SAVED_REG_COUNT*4 + .set LOCALS_STACK_OFFSET, LOCALS_STACK_OFFSET + LINE_SAVED_REG_COUNT*4 .endif 151: /* New line */ newline preload_leading_step1 src_bpp, WK1, SRC preload_leading_step1 mask_bpp, WK2, MASK + .if ((flags) & FLAG_NO_PRELOAD_DST) == 0 preload_leading_step1 dst_r_bpp, WK3, DST + .endif ands WK0, DST, #15 beq 154f @@ -747,7 +786,9 @@ fname: preload_leading_step2 src_bpp, src_bpp_shift, WK1, SRC preload_leading_step2 mask_bpp, mask_bpp_shift, WK2, MASK + .if ((flags) & FLAG_NO_PRELOAD_DST) == 0 preload_leading_step2 dst_r_bpp, dst_bpp_shift, WK3, DST + .endif leading_15bytes process_head, process_tail @@ -767,6 +808,10 @@ fname: 157: /* Check for another line */ end_of_line 1, %((flags) & FLAG_SPILL_LINE_VARS_WIDE), 151b + .if (flags) & FLAG_SPILL_LINE_VARS_WIDE + .set ARGS_STACK_OFFSET, ARGS_STACK_OFFSET - LINE_SAVED_REG_COUNT*4 + .set LOCALS_STACK_OFFSET, LOCALS_STACK_OFFSET - LINE_SAVED_REG_COUNT*4 + .endif .endif .ltorg @@ -776,12 +821,16 @@ fname: .if (flags) & FLAG_SPILL_LINE_VARS_NON_WIDE /* This is stmdb sp!,{} */ .word 0xE92D0000 | LINE_SAVED_REGS + .set ARGS_STACK_OFFSET, ARGS_STACK_OFFSET + LINE_SAVED_REG_COUNT*4 + .set LOCALS_STACK_OFFSET, LOCALS_STACK_OFFSET + LINE_SAVED_REG_COUNT*4 .endif 161: /* New line */ newline preload_line 0, src_bpp, src_bpp_shift, SRC /* in: X, corrupts: WK0-WK1 */ preload_line 0, mask_bpp, mask_bpp_shift, MASK + .if ((flags) & FLAG_NO_PRELOAD_DST) == 0 preload_line 0, dst_r_bpp, dst_bpp_shift, DST + .endif sub X, X, #128/dst_w_bpp /* simplifies inner loop termination */ ands WK0, DST, #15 @@ -810,7 +859,9 @@ fname: newline preload_line 1, src_bpp, src_bpp_shift, SRC /* in: X, corrupts: WK0-WK1 */ preload_line 1, mask_bpp, mask_bpp_shift, MASK + .if ((flags) & FLAG_NO_PRELOAD_DST) == 0 preload_line 1, dst_r_bpp, dst_bpp_shift, DST + .endif .if dst_w_bpp == 8 tst DST, #3 @@ -841,12 +892,22 @@ fname: 177: /* Check for another line */ end_of_line %(dst_w_bpp < 32), %((flags) & FLAG_SPILL_LINE_VARS_NON_WIDE), 171b, last_one + .if (flags) & FLAG_SPILL_LINE_VARS_NON_WIDE + .set ARGS_STACK_OFFSET, ARGS_STACK_OFFSET - LINE_SAVED_REG_COUNT*4 + .set LOCALS_STACK_OFFSET, LOCALS_STACK_OFFSET - LINE_SAVED_REG_COUNT*4 + .endif 197: .if (flags) & FLAG_SPILL_LINE_VARS add sp, sp, #LINE_SAVED_REG_COUNT*4 .endif 198: + .if (flags) & FLAG_PROCESS_CORRUPTS_WK0 + .set ARGS_STACK_OFFSET, ARGS_STACK_OFFSET-4 + .set LOCALS_STACK_OFFSET, LOCALS_STACK_OFFSET-4 + add sp, sp, #4 + .endif + cleanup #ifdef DEBUG_PARAMS diff --git a/pixman/pixman/pixman-arm-simd.c b/pixman/pixman/pixman-arm-simd.c index 8fbc4397d..c17ce5a37 100644 --- a/pixman/pixman/pixman-arm-simd.c +++ b/pixman/pixman/pixman-arm-simd.c @@ -46,6 +46,8 @@ PIXMAN_ARM_BIND_FAST_PATH_SRC_DST (armv6, add_8_8, uint8_t, 1, uint8_t, 1) PIXMAN_ARM_BIND_FAST_PATH_SRC_DST (armv6, over_8888_8888, uint32_t, 1, uint32_t, 1) +PIXMAN_ARM_BIND_FAST_PATH_SRC_DST (armv6, in_reverse_8888_8888, + uint32_t, 1, uint32_t, 1) PIXMAN_ARM_BIND_FAST_PATH_N_DST (0, armv6, over_reverse_n_8888, uint32_t, 1) @@ -56,6 +58,9 @@ PIXMAN_ARM_BIND_FAST_PATH_SRC_N_DST (SKIP_ZERO_MASK, armv6, over_8888_n_8888, PIXMAN_ARM_BIND_FAST_PATH_N_MASK_DST (SKIP_ZERO_SRC, armv6, over_n_8_8888, uint8_t, 1, uint32_t, 1) +PIXMAN_ARM_BIND_FAST_PATH_N_MASK_DST (SKIP_ZERO_SRC, armv6, over_n_8888_8888_ca, + uint32_t, 1, uint32_t, 1) + PIXMAN_ARM_BIND_SCALED_NEAREST_SRC_DST (armv6, 0565_0565, SRC, uint16_t, uint16_t) PIXMAN_ARM_BIND_SCALED_NEAREST_SRC_DST (armv6, 8888_8888, SRC, @@ -238,6 +243,16 @@ static const pixman_fast_path_t arm_simd_fast_paths[] = PIXMAN_STD_FAST_PATH (OVER, solid, a8, a8b8g8r8, armv6_composite_over_n_8_8888), PIXMAN_STD_FAST_PATH (OVER, solid, a8, x8b8g8r8, armv6_composite_over_n_8_8888), + PIXMAN_STD_FAST_PATH (IN_REVERSE, a8r8g8b8, null, a8r8g8b8, armv6_composite_in_reverse_8888_8888), + PIXMAN_STD_FAST_PATH (IN_REVERSE, a8r8g8b8, null, x8r8g8b8, armv6_composite_in_reverse_8888_8888), + PIXMAN_STD_FAST_PATH (IN_REVERSE, a8b8g8r8, null, a8b8g8r8, armv6_composite_in_reverse_8888_8888), + PIXMAN_STD_FAST_PATH (IN_REVERSE, a8b8g8r8, null, x8b8g8r8, armv6_composite_in_reverse_8888_8888), + + PIXMAN_STD_FAST_PATH_CA (OVER, solid, a8r8g8b8, a8r8g8b8, armv6_composite_over_n_8888_8888_ca), + PIXMAN_STD_FAST_PATH_CA (OVER, solid, a8r8g8b8, x8r8g8b8, armv6_composite_over_n_8888_8888_ca), + PIXMAN_STD_FAST_PATH_CA (OVER, solid, a8b8g8r8, a8b8g8r8, armv6_composite_over_n_8888_8888_ca), + PIXMAN_STD_FAST_PATH_CA (OVER, solid, a8b8g8r8, x8b8g8r8, armv6_composite_over_n_8888_8888_ca), + PIXMAN_ARM_SIMPLE_NEAREST_FAST_PATH (SRC, r5g6b5, r5g6b5, armv6_0565_0565), PIXMAN_ARM_SIMPLE_NEAREST_FAST_PATH (SRC, b5g6r5, b5g6r5, armv6_0565_0565), diff --git a/pixman/pixman/pixman-bits-image.c b/pixman/pixman/pixman-bits-image.c index f9121a365..dcdcc6994 100644 --- a/pixman/pixman/pixman-bits-image.c +++ b/pixman/pixman/pixman-bits-image.c @@ -926,7 +926,7 @@ create_bits (pixman_format_code_t format, if (_pixman_multiply_overflows_size (height, stride)) return NULL; - buf_size = height * stride; + buf_size = (size_t)height * stride; if (rowstride_bytes) *rowstride_bytes = stride; diff --git a/xorg-server/.gitignore b/xorg-server/.gitignore index 94a12fdc2..dc56b4651 100644 --- a/xorg-server/.gitignore +++ b/xorg-server/.gitignore @@ -41,6 +41,7 @@ mkinstalldirs py-compile stamp-h? symlink-tree +test-driver texinfo.tex ylwrap diff --git a/xorg-server/Xext/xres.c b/xorg-server/Xext/xres.c index b26cbb5c5..546b942a1 100644 --- a/xorg-server/Xext/xres.c +++ b/xorg-server/Xext/xres.c @@ -353,9 +353,9 @@ static unsigned long ResGetApproxPixmapBytes(PixmapPtr pix) { unsigned long nPixels; - int bytesPerPixel; + float bytesPerPixel; - bytesPerPixel = pix->drawable.bitsPerPixel >> 3; + bytesPerPixel = (float)pix->drawable.bitsPerPixel / 8.0; nPixels = pix->drawable.width * pix->drawable.height; /* Divide by refcnt as pixmap could be shared between clients, diff --git a/xorg-server/composite/compwindow.c b/xorg-server/composite/compwindow.c index 882429414..9a6b2dae8 100644 --- a/xorg-server/composite/compwindow.c +++ b/xorg-server/composite/compwindow.c @@ -525,6 +525,7 @@ compCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) } FreeScratchGC(pGC); } + RegionUninit(&rgnDst); return; } dx = pPixmap->screen_x - cw->oldx; diff --git a/xorg-server/configure.ac b/xorg-server/configure.ac index 695a4819a..0c8b5162d 100644 --- a/xorg-server/configure.ac +++ b/xorg-server/configure.ac @@ -629,7 +629,7 @@ AC_ARG_ENABLE(suid-wrapper, AS_HELP_STRING([--enable-suid-wrapper], [Build suid- dnl DDXes. AC_ARG_ENABLE(xorg, AS_HELP_STRING([--enable-xorg], [Build Xorg server (default: auto)]), [XORG=$enableval], [XORG=auto]) -AC_ARG_ENABLE(dmx, AS_HELP_STRING([--enable-dmx], [Build DMX server (default: auto)]), [DMX=$enableval], [DMX=no]) +AC_ARG_ENABLE(dmx, AS_HELP_STRING([--enable-dmx], [Build DMX server (default: no)]), [DMX=$enableval], [DMX=no]) AC_ARG_ENABLE(xvfb, AS_HELP_STRING([--enable-xvfb], [Build Xvfb server (default: yes)]), [XVFB=$enableval], [XVFB=yes]) AC_ARG_ENABLE(xnest, AS_HELP_STRING([--enable-xnest], [Build Xnest server (default: auto)]), [XNEST=$enableval], [XNEST=auto]) AC_ARG_ENABLE(xquartz, AS_HELP_STRING([--enable-xquartz], [Build Xquartz server for OS-X (default: auto)]), [XQUARTZ=$enableval], [XQUARTZ=auto]) @@ -789,13 +789,13 @@ APPLEWMPROTO="applewmproto >= 1.4" XSHMFENCE="xshmfence >= 1.1" dnl Required modules -XPROTO="xproto >= 7.0.22" +XPROTO="xproto >= 7.0.26" RANDRPROTO="randrproto >= 1.4.0" RENDERPROTO="renderproto >= 0.11" XEXTPROTO="xextproto >= 7.2.99.901" INPUTPROTO="inputproto >= 2.3" KBPROTO="kbproto >= 1.0.3" -FONTSPROTO="fontsproto" +FONTSPROTO="fontsproto >= 2.1.3" FIXESPROTO="fixesproto >= 5.0" DAMAGEPROTO="damageproto >= 1.1" XCMISCPROTO="xcmiscproto >= 1.2.0" @@ -2458,7 +2458,6 @@ if test "x$XWAYLAND" = xyes; then XWAYLAND_SYS_LIBS="$XWAYLANDMODULES_LIBS $GLX_SYS_LIBS" AC_SUBST([XWAYLAND_LIBS]) AC_SUBST([XWAYLAND_SYS_LIBS]) - WAYLAND_SCANNER_RULES(['$(top_srcdir)/hw/xwayland']) fi diff --git a/xorg-server/dix/dixfonts.c b/xorg-server/dix/dixfonts.c index 83d2539c7..1c6442c8f 100644 --- a/xorg-server/dix/dixfonts.c +++ b/xorg-server/dix/dixfonts.c @@ -1658,7 +1658,7 @@ SetFontPathElements(int npaths, unsigned char *paths, int *bad, Bool persist) err = (*fpe_functions[fpe->type].init_fpe) (fpe); if (err != Successful) { if (persist) { - ErrorF + DebugF ("[dix] Could not init font path element %s, removing from list!\n", fpe->name); } diff --git a/xorg-server/dix/dixutils.c b/xorg-server/dix/dixutils.c index 5de74c8b4..cdd370bd6 100644 --- a/xorg-server/dix/dixutils.c +++ b/xorg-server/dix/dixutils.c @@ -866,3 +866,28 @@ InitCallbackManager(void) { DeleteCallbackManager(); } + +/** + * Coordinates the global GL context used by modules in the X Server + * doing rendering with OpenGL. + * + * When setting a GL context (glXMakeCurrent() or eglMakeCurrent()), + * there is an expensive implied glFlush() required by the GLX and EGL + * APIs, so modules don't want to have to do it on every request. But + * the individual modules using GL also don't know about each other, + * so they have to coordinate who owns the current context. + * + * When you're about to do a MakeCurrent, you should set this variable + * to your context's address, and you can skip MakeCurrent if it's + * already set to yours. + * + * When you're about to do a DestroyContext, you should set this to + * NULL if it's set to your context. + * + * When you're about to do an unbindContext on a DRI driver, you + * should set this to NULL. Despite the unbindContext interface + * sounding like it only unbinds the passed in context, it actually + * unconditionally clears the dispatch table even if the given + * context wasn't current. + */ +void *lastGLContext = NULL; diff --git a/xorg-server/fb/fbpict.c b/xorg-server/fb/fbpict.c index c2ee8a552..21baf8950 100644 --- a/xorg-server/fb/fbpict.c +++ b/xorg-server/fb/fbpict.c @@ -191,7 +191,7 @@ fbGlyphs(CARD8 op, pixman_glyph_get_extents(glyphCache, n_glyphs, pglyphs, &extents); pixman_composite_glyphs(op, srcImage, dstImage, format, - xSrc + srcXoff + xDst, ySrc + srcYoff + yDst, + xSrc + srcXoff + extents.x1 - xDst, ySrc + srcYoff + extents.y1 - yDst, extents.x1, extents.y1, extents.x1 + dstXoff, extents.y1 + dstYoff, extents.x2 - extents.x1, diff --git a/xorg-server/glamor/Makefile.am b/xorg-server/glamor/Makefile.am index 4d0cc8138..bde58b632 100644 --- a/xorg-server/glamor/Makefile.am +++ b/xorg-server/glamor/Makefile.am @@ -13,25 +13,27 @@ libglamor_la_SOURCES = \ glamor_debug.h \ glamor_fill.c \ glamor_font.c \ + glamor_font.h \ glamor_glx.c \ glamor_glyphs.c \ glamor_polylines.c \ - glamor_putimage.c \ glamor_segment.c \ + glamor_image.c \ glamor_render.c \ glamor_gradient.c \ glamor_program.c \ + glamor_program.h \ glamor_rects.c \ glamor_spans.c \ glamor_text.c \ glamor_transfer.c \ glamor_transfer.h \ glamor_transform.c \ + glamor_transform.h \ glamor_trapezoid.c \ glamor_tile.c \ glamor_triangles.c\ glamor_addtraps.c\ - glamor_getimage.c\ glamor_copyplane.c\ glamor_glyphblt.c\ glamor_points.c\ diff --git a/xorg-server/glamor/glamor.c b/xorg-server/glamor/glamor.c index 2c2d9760c..08f6ba174 100644 --- a/xorg-server/glamor/glamor.c +++ b/xorg-server/glamor/glamor.c @@ -146,7 +146,7 @@ glamor_create_pixmap(ScreenPtr screen, int w, int h, int depth, glamor_pixmap_type_t type = GLAMOR_TEXTURE_ONLY; glamor_pixmap_private *pixmap_priv; glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); - glamor_pixmap_fbo *fbo; + glamor_pixmap_fbo *fbo = NULL; int pitch; GLenum format; @@ -199,13 +199,12 @@ glamor_create_pixmap(ScreenPtr screen, int w, int h, int depth, pixmap_priv->base.box.x2 = w; pixmap_priv->base.box.y2 = h; fbo = glamor_create_fbo(glamor_priv, w, h, format, usage); - } - else { - DEBUGF("Create LARGE pixmap %p width %d height %d\n", pixmap, w, h); + } else { + int tile_size = glamor_priv->max_fbo_size; + DEBUGF("Create LARGE pixmap %p width %d height %d, tile size %d\n", pixmap, w, h, tile_size); pixmap_priv->type = GLAMOR_TEXTURE_LARGE; fbo = glamor_create_fbo_array(glamor_priv, w, h, format, usage, - glamor_priv->max_fbo_size, - glamor_priv->max_fbo_size, pixmap_priv); + tile_size, tile_size, pixmap_priv); } if (fbo == NULL) { @@ -248,11 +247,10 @@ glamor_block_handler(ScreenPtr screen) { glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); glamor_priv->tick++; glFlush(); glamor_fbo_expire(glamor_priv); - glamor_put_context(glamor_priv); if (glamor_priv->state == RENDER_STATE && glamor_priv->render_idle_cnt++ > RENDER_IDEL_MAX) { glamor_priv->state = IDLE_STATE; @@ -265,9 +263,8 @@ _glamor_block_handler(void *data, OSTimePtr timeout, void *last_select_mask) { glamor_screen_private *glamor_priv = data; - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); glFlush(); - glamor_put_context(glamor_priv); } static void @@ -509,7 +506,6 @@ glamor_init(ScreenPtr screen, unsigned int flags) #ifdef GLAMOR_TRAPEZOID_SHADER glamor_init_trapezoid_shader(screen); #endif - glamor_init_putimage_shaders(screen); glamor_init_finish_access_shaders(screen); #ifdef GLAMOR_GRADIENT_SHADER glamor_init_gradient_shader(screen); @@ -543,7 +539,6 @@ glamor_release_screen_priv(ScreenPtr screen) #ifdef GLAMOR_TRAPEZOID_SHADER glamor_fini_trapezoid_shader(screen); #endif - glamor_fini_putimage_shaders(screen); glamor_fini_finish_access_shaders(screen); #ifdef GLAMOR_GRADIENT_SHADER glamor_fini_gradient_shader(screen); @@ -662,7 +657,8 @@ glamor_fd_from_pixmap(ScreenPtr screen, switch (pixmap_priv->type) { case GLAMOR_TEXTURE_DRM: case GLAMOR_TEXTURE_ONLY: - glamor_pixmap_ensure_fbo(pixmap, GL_RGBA, 0); + if (!glamor_pixmap_ensure_fbo(pixmap, GL_RGBA, 0)) + return -1; return glamor_egl_dri3_fd_name_from_tex(screen, pixmap, pixmap_priv->base.fbo->tex, @@ -686,7 +682,8 @@ glamor_name_from_pixmap(PixmapPtr pixmap, CARD16 *stride, CARD32 *size) switch (pixmap_priv->type) { case GLAMOR_TEXTURE_DRM: case GLAMOR_TEXTURE_ONLY: - glamor_pixmap_ensure_fbo(pixmap, GL_RGBA, 0); + if (!glamor_pixmap_ensure_fbo(pixmap, GL_RGBA, 0)) + return -1; return glamor_egl_dri3_fd_name_from_tex(pixmap->drawable.pScreen, pixmap, pixmap_priv->base.fbo->tex, diff --git a/xorg-server/glamor/glamor_context.h b/xorg-server/glamor/glamor_context.h index 8781afc48..47b87e620 100644 --- a/xorg-server/glamor/glamor_context.h +++ b/xorg-server/glamor/glamor_context.h @@ -43,14 +43,7 @@ struct glamor_context { /** The GLXDrawable we should MakeCurrent to */ uint32_t drawable_xid; - /** - * Count of how deep in glamor_get_context() we are, to reduce - * MakeCurrent calls. - */ - int get_count; - - void (*get_context)(struct glamor_context *glamor_ctx); - void (*put_context)(struct glamor_context *glamor_ctx); + void (*make_current)(struct glamor_context *glamor_ctx); }; Bool glamor_glx_screen_init(struct glamor_context *glamor_ctx); diff --git a/xorg-server/glamor/glamor_copyarea.c b/xorg-server/glamor/glamor_copyarea.c index 996611c6c..e1988225f 100644 --- a/xorg-server/glamor/glamor_copyarea.c +++ b/xorg-server/glamor/glamor_copyarea.c @@ -70,7 +70,7 @@ glamor_copy_n_to_n_fbo_blit(DrawablePtr src, pixmap_priv_get_fbo_off(dst_pixmap_priv, &fbo_x_off, &fbo_y_off); pixmap_priv_get_fbo_off(src_pixmap_priv, &src_fbo_x_off, &src_fbo_y_off); - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); glBindFramebuffer(GL_READ_FRAMEBUFFER_EXT, src_pixmap_priv->base.fbo->fb); glamor_get_drawable_deltas(dst, dst_pixmap, &dst_x_off, &dst_y_off); glamor_get_drawable_deltas(src, src_pixmap, &src_x_off, &src_y_off); @@ -112,7 +112,6 @@ glamor_copy_n_to_n_fbo_blit(DrawablePtr src, GL_COLOR_BUFFER_BIT, GL_NEAREST); } } - glamor_put_context(glamor_priv); glamor_priv->state = BLIT_STATE; return TRUE; } @@ -155,7 +154,7 @@ glamor_copy_n_to_n_textured(DrawablePtr src, glamor_get_drawable_deltas(dst, dst_pixmap, &dst_x_off, &dst_y_off); - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); glamor_set_destination_pixmap_priv_nc(dst_pixmap_priv); glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_FLOAT, @@ -206,7 +205,6 @@ glamor_copy_n_to_n_textured(DrawablePtr src, glDisableVertexAttribArray(GLAMOR_VERTEX_POS); glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE); /* The source texture is bound to a fbo, we have to flush it here. */ - glamor_put_context(glamor_priv); glamor_priv->state = RENDER_STATE; glamor_priv->render_idle_cnt = 0; return TRUE; @@ -367,12 +365,10 @@ _glamor_copy_n_to_n(DrawablePtr src, if (gc) { if (!glamor_set_planemask(dst_pixmap, gc->planemask)) goto fall_back; - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); if (!glamor_set_alu(screen, gc->alu)) { - glamor_put_context(glamor_priv); - goto fail; + goto fail_noregion; } - glamor_put_context(glamor_priv); } if (!src_pixmap_priv) { @@ -537,7 +533,6 @@ _glamor_copy_n_to_n(DrawablePtr src, if (n_dst_region == 0) ok = TRUE; free(clipped_dst_regions); - RegionUninit(®ion); } else { ok = __glamor_copy_n_to_n(src, dst, gc, box, nbox, dx, dy, @@ -545,9 +540,10 @@ _glamor_copy_n_to_n(DrawablePtr src, } fail: - glamor_get_context(glamor_priv); + RegionUninit(®ion); + fail_noregion: + glamor_make_current(glamor_priv); glamor_set_alu(screen, GXcopy); - glamor_put_context(glamor_priv); if (ok) return TRUE; diff --git a/xorg-server/glamor/glamor_core.c b/xorg-server/glamor/glamor_core.c index 7b1615d2d..b34943761 100644 --- a/xorg-server/glamor/glamor_core.c +++ b/xorg-server/glamor/glamor_core.c @@ -127,7 +127,7 @@ glamor_prepare_access(DrawablePtr drawable, glamor_access_t access) */ assert(!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv) || access == GLAMOR_ACCESS_RO || - pixmap_priv->base.mapped_for_write); + pixmap_priv->base.map_access == GLAMOR_ACCESS_RW); return TRUE; } pixmap_priv->base.map_access = access; @@ -241,7 +241,7 @@ glamor_init_finish_access_shaders(ScreenPtr screen) char *source; glamor_priv = glamor_get_screen_private(screen); - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); glamor_priv->finish_access_prog[0] = glCreateProgram(); glamor_priv->finish_access_prog[1] = glCreateProgram(); @@ -300,7 +300,6 @@ glamor_init_finish_access_shaders(ScreenPtr screen) glUniform1i(glamor_priv->finish_access_revert[1], 0); glUniform1i(sampler_uniform_location, 0); glUniform1i(glamor_priv->finish_access_swap_rb[1], 0); - glamor_put_context(glamor_priv); } void @@ -309,10 +308,9 @@ glamor_fini_finish_access_shaders(ScreenPtr screen) glamor_screen_private *glamor_priv; glamor_priv = glamor_get_screen_private(screen); - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); glDeleteProgram(glamor_priv->finish_access_prog[0]); glDeleteProgram(glamor_priv->finish_access_prog[1]); - glamor_put_context(glamor_priv); } void @@ -341,11 +339,10 @@ glamor_finish_access(DrawablePtr drawable) if (pixmap_priv->base.fbo->pbo != 0 && pixmap_priv->base.fbo->pbo_valid) { assert(glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP); - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); glBindBuffer(GL_PIXEL_PACK_BUFFER, 0); glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); glDeleteBuffers(1, &pixmap_priv->base.fbo->pbo); - glamor_put_context(glamor_priv); pixmap_priv->base.fbo->pbo_valid = FALSE; pixmap_priv->base.fbo->pbo = 0; diff --git a/xorg-server/glamor/glamor_egl.c b/xorg-server/glamor/glamor_egl.c index d37de9b95..54af2753e 100644 --- a/xorg-server/glamor/glamor_egl.c +++ b/xorg-server/glamor/glamor_egl.c @@ -95,30 +95,22 @@ glamor_egl_get_screen_private(ScrnInfoPtr scrn) } static void -glamor_egl_get_context(struct glamor_context *glamor_ctx) +glamor_egl_make_current(struct glamor_context *glamor_ctx) { - if (glamor_ctx->get_count++) - return; - - if (glamor_ctx->ctx != eglGetCurrentContext()) { - eglMakeCurrent(glamor_ctx->display, EGL_NO_SURFACE, - EGL_NO_SURFACE, EGL_NO_CONTEXT); - if (!eglMakeCurrent(glamor_ctx->display, - EGL_NO_SURFACE, EGL_NO_SURFACE, - glamor_ctx->ctx)) { - FatalError("Failed to make EGL context current\n"); - } - } -} - -static void -glamor_egl_put_context(struct glamor_context *glamor_ctx) -{ - if (--glamor_ctx->get_count) - return; - + /* There's only a single global dispatch table in Mesa. EGL, GLX, + * and AIGLX's direct dispatch table manipulation don't talk to + * each other. We need to set the context to NULL first to avoid + * EGL's no-op context change fast path when switching back to + * EGL. + */ eglMakeCurrent(glamor_ctx->display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); + + if (!eglMakeCurrent(glamor_ctx->display, + EGL_NO_SURFACE, EGL_NO_SURFACE, + glamor_ctx->ctx)) { + FatalError("Failed to make EGL context current\n"); + } } static EGLImageKHR @@ -166,10 +158,14 @@ glamor_get_flink_name(int fd, int handle, int *name) } static Bool -glamor_create_texture_from_image(struct glamor_egl_screen_private - *glamor_egl, +glamor_create_texture_from_image(ScreenPtr screen, EGLImageKHR image, GLuint * texture) { + struct glamor_screen_private *glamor_priv = + glamor_get_screen_private(screen); + + glamor_make_current(glamor_priv); + glGenTextures(1, texture); glBindTexture(GL_TEXTURE_2D, *texture); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); @@ -177,6 +173,7 @@ glamor_create_texture_from_image(struct glamor_egl_screen_private glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, image); glBindTexture(GL_TEXTURE_2D, 0); + return TRUE; } @@ -211,7 +208,7 @@ glamor_egl_create_argb8888_based_texture(ScreenPtr screen, int w, int h) gbm_bo_destroy(bo); if (image == EGL_NO_IMAGE_KHR) return 0; - glamor_create_texture_from_image(glamor_egl, image, &texture); + glamor_create_texture_from_image(screen, image, &texture); eglDestroyImageKHR(glamor_egl->display, image); return texture; @@ -289,7 +286,7 @@ glamor_egl_create_textured_pixmap(PixmapPtr pixmap, int handle, int stride) glamor_egl = glamor_egl_get_screen_private(scrn); - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); if (glamor_egl->has_gem) { if (!glamor_get_flink_name(glamor_egl->fd, handle, &name)) { xf86DrvMsg(scrn->scrnIndex, X_ERROR, @@ -312,14 +309,13 @@ glamor_egl_create_textured_pixmap(PixmapPtr pixmap, int handle, int stride) glamor_set_pixmap_type(pixmap, GLAMOR_DRM_ONLY); goto done; } - glamor_create_texture_from_image(glamor_egl, image, &texture); + glamor_create_texture_from_image(screen, image, &texture); glamor_set_pixmap_type(pixmap, GLAMOR_TEXTURE_DRM); glamor_set_pixmap_texture(pixmap, texture); pixmap_priv->base.image = image; ret = TRUE; done: - glamor_put_context(glamor_priv); return ret; } @@ -339,7 +335,7 @@ glamor_egl_create_textured_pixmap_from_gbm_bo(PixmapPtr pixmap, void *bo) glamor_egl = glamor_egl_get_screen_private(scrn); - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); image = eglCreateImageKHR(glamor_egl->display, glamor_egl->context, @@ -348,14 +344,13 @@ glamor_egl_create_textured_pixmap_from_gbm_bo(PixmapPtr pixmap, void *bo) glamor_set_pixmap_type(pixmap, GLAMOR_DRM_ONLY); goto done; } - glamor_create_texture_from_image(glamor_egl, image, &texture); + glamor_create_texture_from_image(screen, image, &texture); glamor_set_pixmap_type(pixmap, GLAMOR_TEXTURE_DRM); glamor_set_pixmap_texture(pixmap, texture); pixmap_priv->base.image = image; ret = TRUE; done: - glamor_put_context(glamor_priv); return ret; } @@ -413,7 +408,7 @@ glamor_egl_dri3_fd_name_from_tex(ScreenPtr screen, glamor_egl = glamor_egl_get_screen_private(scrn); - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); image = pixmap_priv->base.image; if (!image) { @@ -448,7 +443,6 @@ glamor_egl_dri3_fd_name_from_tex(ScreenPtr screen, gbm_bo_destroy(bo); failure: - glamor_put_context(glamor_priv); return fd; #else return -1; @@ -678,8 +672,7 @@ glamor_egl_screen_init(ScreenPtr screen, struct glamor_context *glamor_ctx) glamor_ctx->ctx = glamor_egl->context; glamor_ctx->display = glamor_egl->display; - glamor_ctx->get_context = glamor_egl_get_context; - glamor_ctx->put_context = glamor_egl_put_context; + glamor_ctx->make_current = glamor_egl_make_current; if (glamor_egl->dri3_capable) { /* Tell the core that we have the interfaces for import/export diff --git a/xorg-server/glamor/glamor_fbo.c b/xorg-server/glamor/glamor_fbo.c index 4f6da67fb..552168381 100644 --- a/xorg-server/glamor/glamor_fbo.c +++ b/xorg-server/glamor/glamor_fbo.c @@ -129,7 +129,7 @@ glamor_pixmap_fbo_cache_get(glamor_screen_private *glamor_priv, void glamor_purge_fbo(glamor_pixmap_fbo *fbo) { - glamor_get_context(fbo->glamor_priv); + glamor_make_current(fbo->glamor_priv); if (fbo->fb) glDeleteFramebuffers(1, &fbo->fb); @@ -137,7 +137,6 @@ glamor_purge_fbo(glamor_pixmap_fbo *fbo) glDeleteTextures(1, &fbo->tex); if (fbo->pbo) glDeleteBuffers(1, &fbo->pbo); - glamor_put_context(fbo->glamor_priv); free(fbo); } @@ -175,12 +174,12 @@ glamor_pixmap_fbo_cache_put(glamor_pixmap_fbo *fbo) #endif } -static void +static int glamor_pixmap_ensure_fb(glamor_pixmap_fbo *fbo) { - int status; + int status, err = 0; - glamor_get_context(fbo->glamor_priv); + glamor_make_current(fbo->glamor_priv); if (fbo->fb == 0) glGenFramebuffers(1, &fbo->fb); @@ -216,10 +215,11 @@ glamor_pixmap_ensure_fb(glamor_pixmap_fbo *fbo) break; } - FatalError("destination is framebuffer incomplete: %s [%x]\n", - str, status); + glamor_fallback("glamor: Failed to create fbo, %s\n", str); + err = -1; } - glamor_put_context(fbo->glamor_priv); + + return err; } glamor_pixmap_fbo * @@ -241,14 +241,17 @@ glamor_create_fbo_from_tex(glamor_screen_private *glamor_priv, fbo->glamor_priv = glamor_priv; if (flag == GLAMOR_CREATE_PIXMAP_MAP) { - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); glGenBuffers(1, &fbo->pbo); - glamor_put_context(glamor_priv); goto done; } - if (flag != GLAMOR_CREATE_FBO_NO_FBO) - glamor_pixmap_ensure_fb(fbo); + if (flag != GLAMOR_CREATE_FBO_NO_FBO) { + if (glamor_pixmap_ensure_fb(fbo) != 0) { + glamor_purge_fbo(fbo); + fbo = NULL; + } + } done: return fbo; @@ -341,14 +344,13 @@ _glamor_create_tex(glamor_screen_private *glamor_priv, w, h); } if (!tex) { - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); glGenTextures(1, &tex); glBindTexture(GL_TEXTURE_2D, tex); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexImage2D(GL_TEXTURE_2D, 0, format, w, h, 0, format, GL_UNSIGNED_BYTE, NULL); - glamor_put_context(glamor_priv); } return tex; } @@ -367,10 +369,11 @@ glamor_create_fbo(glamor_screen_private *glamor_priv, if (flag == GLAMOR_CREATE_PIXMAP_MAP) goto no_tex; - if (flag == GLAMOR_CREATE_PIXMAP_FIXUP) - cache_flag = GLAMOR_CACHE_EXACT_SIZE; - else - cache_flag = 0; + /* Tiling from textures requires exact pixmap sizes. As we don't + * know which pixmaps will be used as tiles, just allocate + * everything at the requested size + */ + cache_flag = GLAMOR_CACHE_EXACT_SIZE; fbo = glamor_pixmap_fbo_cache_get(glamor_priv, w, h, format, cache_flag); if (fbo) @@ -565,7 +568,8 @@ glamor_pixmap_ensure_fbo(PixmapPtr pixmap, GLenum format, int flag) pixmap->drawable.height, format); if (flag != GLAMOR_CREATE_FBO_NO_FBO && pixmap_priv->base.fbo->fb == 0) - glamor_pixmap_ensure_fb(pixmap_priv->base.fbo); + if (glamor_pixmap_ensure_fb(pixmap_priv->base.fbo) != 0) + return FALSE; } return TRUE; diff --git a/xorg-server/glamor/glamor_fill.c b/xorg-server/glamor/glamor_fill.c index 2fa726e72..073904d2a 100644 --- a/xorg-server/glamor/glamor_fill.c +++ b/xorg-server/glamor/glamor_fill.c @@ -156,7 +156,7 @@ glamor_init_solid_shader(ScreenPtr screen) GLint fs_prog, vs_prog; glamor_priv = glamor_get_screen_private(screen); - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); glamor_priv->solid_prog = glCreateProgram(); vs_prog = glamor_compile_glsl_prog(GL_VERTEX_SHADER, solid_vs); fs_prog = glamor_compile_glsl_prog(GL_FRAGMENT_SHADER, solid_fs); @@ -169,7 +169,6 @@ glamor_init_solid_shader(ScreenPtr screen) glamor_priv->solid_color_uniform_location = glGetUniformLocation(glamor_priv->solid_prog, "color"); - glamor_put_context(glamor_priv); } void @@ -178,9 +177,8 @@ glamor_fini_solid_shader(ScreenPtr screen) glamor_screen_private *glamor_priv; glamor_priv = glamor_get_screen_private(screen); - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); glDeleteProgram(glamor_priv->solid_prog); - glamor_put_context(glamor_priv); } static void @@ -196,7 +194,7 @@ _glamor_solid_boxes(PixmapPtr pixmap, BoxPtr box, int nbox, float *color) glamor_set_destination_pixmap_priv_nc(pixmap_priv); - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); glUseProgram(glamor_priv->solid_prog); glUniform4fv(glamor_priv->solid_color_uniform_location, 1, color); @@ -255,7 +253,6 @@ _glamor_solid_boxes(PixmapPtr pixmap, BoxPtr box, int nbox, float *color) free(vertices); glDisableVertexAttribArray(GLAMOR_VERTEX_POS); - glamor_put_context(glamor_priv); glamor_priv->state = RENDER_STATE; glamor_priv->render_idle_cnt = 0; } @@ -338,13 +335,12 @@ glamor_solid(PixmapPtr pixmap, int x, int y, int width, int height, return FALSE; } - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); if (!glamor_set_alu(screen, alu)) { if (alu == GXclear) fg_pixel = 0; else { glamor_fallback("unsupported alu %x\n", alu); - glamor_put_context(glamor_priv); return FALSE; } } @@ -355,7 +351,6 @@ glamor_solid(PixmapPtr pixmap, int x, int y, int width, int height, glamor_solid_boxes(pixmap, &box, 1, fg_pixel); glamor_set_alu(screen, GXcopy); - glamor_put_context(glamor_priv); return TRUE; } diff --git a/xorg-server/glamor/glamor_font.c b/xorg-server/glamor/glamor_font.c index 47dfe2a69..f747d59a1 100644 --- a/xorg-server/glamor/glamor_font.c +++ b/xorg-server/glamor/glamor_font.c @@ -89,7 +89,7 @@ glamor_font_get(ScreenPtr screen, FontPtr font) glamor_font->default_col = font->info.defaultCh; glamor_priv = glamor_get_screen_private(screen); - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); glGenTextures(1, &glamor_font->texture_id); glActiveTexture(GL_TEXTURE0); @@ -119,8 +119,6 @@ glamor_font_get(ScreenPtr screen, FontPtr font) } } - glamor_put_context(glamor_priv); - return glamor_font; } @@ -150,9 +148,8 @@ glamor_unrealize_font(ScreenPtr screen, FontPtr font) glamor_font->realized = FALSE; glamor_priv = glamor_get_screen_private(screen); - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); glDeleteTextures(1, &glamor_font->texture_id); - glamor_put_context(glamor_priv); /* Check to see if all of the screens are done with this font * and free the private when that happens diff --git a/xorg-server/glamor/glamor_getimage.c b/xorg-server/glamor/glamor_getimage.c deleted file mode 100644 index a932473e8..000000000 --- a/xorg-server/glamor/glamor_getimage.c +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright © 2009 Intel Corporation - * Copyright © 1998 Keith Packard - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - * - * Authors: - * Zhigang Gong - * - */ - -#include "glamor_priv.h" - -static Bool -_glamor_get_image(DrawablePtr drawable, int x, int y, int w, int h, - unsigned int format, unsigned long planeMask, char *d, - Bool fallback) -{ - PixmapPtr pixmap, sub_pixmap; - struct glamor_pixmap_private *pixmap_priv; - int x_off, y_off; - int stride; - void *data; - - pixmap = glamor_get_drawable_pixmap(drawable); - glamor_get_drawable_deltas(drawable, pixmap, &x_off, &y_off); - - if (format != ZPixmap) - goto fall_back; - - if (!glamor_set_planemask(pixmap, planeMask)) { - glamor_fallback("Failedto set planemask in glamor_solid.\n"); - goto fall_back; - } - pixmap_priv = glamor_get_pixmap_private(pixmap); - - if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) - goto fall_back; - stride = PixmapBytePad(w, drawable->depth); - - x += drawable->x + x_off; - y += drawable->y + y_off; - - data = glamor_download_sub_pixmap_to_cpu(pixmap, x, y, w, h, stride, - d, 0, GLAMOR_ACCESS_RO); - if (data != NULL) { - assert(data == d); - return TRUE; - } - fall_back: - sub_pixmap = glamor_get_sub_pixmap(pixmap, x + x_off + drawable->x, - y + y_off + drawable->y, w, h, - GLAMOR_ACCESS_RO); - if (sub_pixmap) { - fbGetImage(&sub_pixmap->drawable, 0, 0, w, h, format, planeMask, d); - glamor_put_sub_pixmap(sub_pixmap, pixmap, - x + x_off + drawable->x, - y + y_off + drawable->y, w, h, GLAMOR_ACCESS_RO); - } - else - miGetImage(drawable, x, y, w, h, format, planeMask, d); - - return TRUE; -} - -void -glamor_get_image(DrawablePtr pDrawable, int x, int y, int w, int h, - unsigned int format, unsigned long planeMask, char *d) -{ - _glamor_get_image(pDrawable, x, y, w, h, format, planeMask, d, TRUE); -} - -Bool -glamor_get_image_nf(DrawablePtr pDrawable, int x, int y, int w, int h, - unsigned int format, unsigned long planeMask, char *d) -{ - return _glamor_get_image(pDrawable, x, y, w, - h, format, planeMask, d, FALSE); -} diff --git a/xorg-server/glamor/glamor_glx.c b/xorg-server/glamor/glamor_glx.c index 8f47c3d2c..7107c7c17 100644 --- a/xorg-server/glamor/glamor_glx.c +++ b/xorg-server/glamor/glamor_glx.c @@ -34,28 +34,21 @@ */ static void -glamor_glx_get_context(struct glamor_context *glamor_ctx) +glamor_glx_make_current(struct glamor_context *glamor_ctx) { - GLXContext old_ctx; - - if (glamor_ctx->get_count++) - return; - - old_ctx = glXGetCurrentContext(); - if (old_ctx == glamor_ctx->ctx) - return; + /* There's only a single global dispatch table in Mesa. EGL, GLX, + * and AIGLX's direct dispatch table manipulation don't talk to + * each other. We need to set the context to NULL first to avoid + * GLX's no-op context change fast path when switching back to + * GLX. + */ + glXMakeCurrent(glamor_ctx->display, None, None); glXMakeCurrent(glamor_ctx->display, glamor_ctx->drawable_xid, glamor_ctx->ctx); } -static void -glamor_glx_put_context(struct glamor_context *glamor_ctx) -{ - --glamor_ctx->get_count; -} - Bool glamor_glx_screen_init(struct glamor_context *glamor_ctx) { @@ -69,8 +62,7 @@ glamor_glx_screen_init(struct glamor_context *glamor_ctx) glamor_ctx->drawable_xid = glXGetCurrentDrawable(); - glamor_ctx->get_context = glamor_glx_get_context; - glamor_ctx->put_context = glamor_glx_put_context; + glamor_ctx->make_current = glamor_glx_make_current; return True; } diff --git a/xorg-server/glamor/glamor_glyphblt.c b/xorg-server/glamor/glamor_glyphblt.c index c031747f7..1c511ff2b 100644 --- a/xorg-server/glamor/glamor_glyphblt.c +++ b/xorg-server/glamor/glamor_glyphblt.c @@ -54,7 +54,7 @@ glamor_poly_glyph_blt_gl(DrawablePtr drawable, GCPtr gc, if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) goto bail; - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); prog = glamor_use_program_fill(pixmap, gc, &glamor_priv->poly_glyph_blt_progs, &glamor_facet_poly_glyph_blt); @@ -137,11 +137,9 @@ glamor_poly_glyph_blt_gl(DrawablePtr drawable, GCPtr gc, glDisable(GL_COLOR_LOGIC_OP); glDisableVertexAttribArray(GLAMOR_VERTEX_POS); - glamor_put_context(glamor_priv); return TRUE; bail_ctx: glDisable(GL_COLOR_LOGIC_OP); - glamor_put_context(glamor_priv); bail: return FALSE; } @@ -212,20 +210,18 @@ glamor_push_pixels_points(GCPtr gc, PixmapPtr bitmap, if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) return FALSE; - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); if (!glamor_set_alu(screen, gc->alu)) { if (gc->alu == GXclear) fg_pixel = 0; else { glamor_fallback("unsupported alu %x\n", gc->alu); - glamor_put_context(glamor_priv); return FALSE; } } if (!glamor_set_planemask(pixmap, gc->planemask)) { glamor_fallback("Failed to set planemask in %s.\n", __FUNCTION__); - glamor_put_context(glamor_priv); return FALSE; } @@ -281,8 +277,6 @@ glamor_push_pixels_points(GCPtr gc, PixmapPtr bitmap, glDisableVertexAttribArray(GLAMOR_VERTEX_POS); - glamor_put_context(glamor_priv); - return TRUE; } diff --git a/xorg-server/glamor/glamor_glyphs.c b/xorg-server/glamor/glamor_glyphs.c index a04ae8261..42f5f65f6 100644 --- a/xorg-server/glamor/glamor_glyphs.c +++ b/xorg-server/glamor/glamor_glyphs.c @@ -1285,9 +1285,8 @@ glamor_buffer_glyph(glamor_screen_private *glamor_priv, * thus we have to composite from the cache picture * to the cache picture, we need a flush here to make * sure latter we get the corret glyphs data.*/ - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); glFlush(); - glamor_put_context(glamor_priv); } } else { diff --git a/xorg-server/glamor/glamor_gradient.c b/xorg-server/glamor/glamor_gradient.c index c24f3427f..28d66917f 100644 --- a/xorg-server/glamor/glamor_gradient.c +++ b/xorg-server/glamor/glamor_gradient.c @@ -324,7 +324,7 @@ _glamor_create_radial_gradient_program(ScreenPtr screen, int stops_count, return; } - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); if (dyn_gen && glamor_priv->gradient_prog[SHADER_GRADIENT_RADIAL][2]) { glDeleteProgram(glamor_priv->gradient_prog[SHADER_GRADIENT_RADIAL][2]); @@ -371,8 +371,6 @@ _glamor_create_radial_gradient_program(ScreenPtr screen, int stops_count, } glamor_priv->gradient_prog[SHADER_GRADIENT_RADIAL][index] = gradient_prog; - - glamor_put_context(glamor_priv); } static void @@ -519,7 +517,7 @@ _glamor_create_linear_gradient_program(ScreenPtr screen, int stops_count, return; } - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); if (dyn_gen && glamor_priv->gradient_prog[SHADER_GRADIENT_LINEAR][2]) { glDeleteProgram(glamor_priv->gradient_prog[SHADER_GRADIENT_LINEAR][2]); glamor_priv->gradient_prog[SHADER_GRADIENT_LINEAR][2] = 0; @@ -562,8 +560,6 @@ _glamor_create_linear_gradient_program(ScreenPtr screen, int stops_count, } glamor_priv->gradient_prog[SHADER_GRADIENT_LINEAR][index] = gradient_prog; - - glamor_put_context(glamor_priv); } void @@ -595,7 +591,7 @@ glamor_fini_gradient_shader(ScreenPtr screen) int i = 0; glamor_priv = glamor_get_screen_private(screen); - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); for (i = 0; i < 3; i++) { /* Linear Gradient */ @@ -607,8 +603,6 @@ glamor_fini_gradient_shader(ScreenPtr screen) glDeleteProgram(glamor_priv->gradient_prog [SHADER_GRADIENT_RADIAL][i]); } - - glamor_put_context(glamor_priv); } static void @@ -739,7 +733,7 @@ _glamor_gradient_set_pixmap_destination(ScreenPtr screen, tex_vertices[0], tex_vertices[1], tex_vertices[2], tex_vertices[3], tex_vertices[4], tex_vertices[5], tex_vertices[6], tex_vertices[7]); - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_FLOAT, GL_FALSE, 0, vertices); @@ -749,8 +743,6 @@ _glamor_gradient_set_pixmap_destination(ScreenPtr screen, glEnableVertexAttribArray(GLAMOR_VERTEX_POS); glEnableVertexAttribArray(GLAMOR_VERTEX_SOURCE); - glamor_put_context(glamor_priv); - return 1; } @@ -892,7 +884,7 @@ glamor_generate_radial_gradient_picture(ScreenPtr screen, GLint r2_uniform_location = 0; glamor_priv = glamor_get_screen_private(screen); - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); /* Create a pixmap with VBO. */ pixmap = glamor_create_pixmap(screen, @@ -1123,7 +1115,6 @@ glamor_generate_radial_gradient_picture(ScreenPtr screen, glDisableVertexAttribArray(GLAMOR_VERTEX_POS); glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE); - glamor_put_context(glamor_priv); return dst_picture; GRADIENT_FAIL: @@ -1140,7 +1131,6 @@ glamor_generate_radial_gradient_picture(ScreenPtr screen, glDisableVertexAttribArray(GLAMOR_VERTEX_POS); glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE); - glamor_put_context(glamor_priv); return NULL; } @@ -1204,7 +1194,7 @@ glamor_generate_linear_gradient_picture(ScreenPtr screen, GLint pt_distance_uniform_location = 0; glamor_priv = glamor_get_screen_private(screen); - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); /* Create a pixmap with VBO. */ pixmap = glamor_create_pixmap(screen, @@ -1468,7 +1458,6 @@ glamor_generate_linear_gradient_picture(ScreenPtr screen, glDisableVertexAttribArray(GLAMOR_VERTEX_POS); glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE); - glamor_put_context(glamor_priv); return dst_picture; GRADIENT_FAIL: @@ -1485,7 +1474,6 @@ glamor_generate_linear_gradient_picture(ScreenPtr screen, glDisableVertexAttribArray(GLAMOR_VERTEX_POS); glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE); - glamor_put_context(glamor_priv); return NULL; } diff --git a/xorg-server/glamor/glamor_image.c b/xorg-server/glamor/glamor_image.c new file mode 100644 index 000000000..4791d089f --- /dev/null +++ b/xorg-server/glamor/glamor_image.c @@ -0,0 +1,180 @@ +/* + * Copyright © 2014 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation, and + * that the name of the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#include "glamor_priv.h" +#include "glamor_transfer.h" +#include "glamor_transform.h" + +/* + * PutImage. Only does ZPixmap right now as other formats are quite a bit harder + */ + +static Bool +glamor_put_image_gl(DrawablePtr drawable, GCPtr gc, int depth, int x, int y, + int w, int h, int leftPad, int format, char *bits) +{ + ScreenPtr screen = drawable->pScreen; + glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); + PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable); + glamor_pixmap_private *pixmap_priv; + uint32_t byte_stride = PixmapBytePad(w, drawable->depth); + RegionRec region; + BoxRec box; + int off_x, off_y; + + pixmap_priv = glamor_get_pixmap_private(pixmap); + + if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) + return FALSE; + + if (gc->alu != GXcopy) + goto bail; + + if (!glamor_pm_is_solid(&pixmap->drawable, gc->planemask)) + goto bail; + + if (format == XYPixmap && drawable->depth == 1 && leftPad == 0) + format = ZPixmap; + + if (format != ZPixmap) + goto bail; + + x += drawable->x; + y += drawable->y; + box.x1 = x; + box.y1 = y; + box.x2 = box.x1 + w; + box.y2 = box.y1 + h; + RegionInit(®ion, &box, 1); + RegionIntersect(®ion, ®ion, gc->pCompositeClip); + + glamor_get_drawable_deltas(drawable, pixmap, &off_x, &off_y); + if (off_x || off_y) { + x += off_x; + y += off_y; + RegionTranslate(®ion, off_x, off_y); + } + + glamor_make_current(glamor_priv); + + glamor_upload_region(pixmap, ®ion, x, y, (uint8_t *) bits, byte_stride); + + RegionUninit(®ion); + return TRUE; +bail: + return FALSE; +} + +static void +glamor_put_image_bail(DrawablePtr drawable, GCPtr gc, int depth, int x, int y, + int w, int h, int leftPad, int format, char *bits) +{ + if (glamor_prepare_access(drawable, GLAMOR_ACCESS_RW) && + glamor_prepare_access_gc(gc)) + fbPutImage(drawable, gc, depth, x, y, w, h, leftPad, format, bits); + glamor_finish_access(drawable); +} + +void +glamor_put_image(DrawablePtr drawable, GCPtr gc, int depth, int x, int y, + int w, int h, int leftPad, int format, char *bits) +{ + if (glamor_put_image_gl(drawable, gc, depth, x, y, w, h, leftPad, format, bits)) + return; + glamor_put_image_bail(drawable, gc, depth, x, y, w, h, leftPad, format, bits); +} + +Bool +glamor_put_image_nf(DrawablePtr drawable, GCPtr gc, int depth, int x, int y, + int w, int h, int leftPad, int format, char *bits) +{ + if (glamor_put_image_gl(drawable, gc, depth, x, y, w, h, leftPad, format, bits)) + return TRUE; + if (glamor_ddx_fallback_check_pixmap(drawable) && + glamor_ddx_fallback_check_gc(gc)) + return FALSE; + glamor_put_image_bail(drawable, gc, depth, x, y, w, h, leftPad, format, bits); + return TRUE; +} + +static Bool +glamor_get_image_gl(DrawablePtr drawable, int x, int y, int w, int h, + unsigned int format, unsigned long plane_mask, char *d) +{ + PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable); + glamor_pixmap_private *pixmap_priv; + uint32_t byte_stride = PixmapBytePad(w, drawable->depth); + BoxRec box; + int off_x, off_y; + + pixmap_priv = glamor_get_pixmap_private(pixmap); + if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) + goto bail; + + if (format != ZPixmap || !glamor_pm_is_solid(drawable, plane_mask)) + goto bail; + + glamor_get_drawable_deltas(drawable, pixmap, &off_x, &off_y); + box.x1 = x; + box.x2 = x + w; + box.y1 = y; + box.y2 = y + h; + glamor_download_boxes(pixmap, &box, 1, + drawable->x + off_x, drawable->y + off_y, + -x, -y, + (uint8_t *) d, byte_stride); + return TRUE; +bail: + return FALSE; +} + +static void +glamor_get_image_bail(DrawablePtr drawable, int x, int y, int w, int h, + unsigned int format, unsigned long plane_mask, char *d) +{ + if (glamor_prepare_access(drawable, GLAMOR_ACCESS_RO)) + fbGetImage(drawable, x, y, w, h, format, plane_mask, d); + glamor_finish_access(drawable); +} + +void +glamor_get_image(DrawablePtr drawable, int x, int y, int w, int h, + unsigned int format, unsigned long plane_mask, char *d) +{ + if (glamor_get_image_gl(drawable, x, y, w, h, format, plane_mask, d)) + return; + glamor_get_image_bail(drawable, x, y, w, h, format, plane_mask, d); +} + +Bool +glamor_get_image_nf(DrawablePtr drawable, int x, int y, int w, int h, + unsigned int format, unsigned long plane_mask, char *d) +{ + if (glamor_get_image_gl(drawable, x, y, w, h, format, plane_mask, d)) + return TRUE; + + if (glamor_ddx_fallback_check_pixmap(drawable)) + return FALSE; + + glamor_get_image_bail(drawable, x, y, w, h, format, plane_mask, d); + return TRUE; +} diff --git a/xorg-server/glamor/glamor_pixmap.c b/xorg-server/glamor/glamor_pixmap.c index a811f6015..54b414bc2 100644 --- a/xorg-server/glamor/glamor_pixmap.c +++ b/xorg-server/glamor/glamor_pixmap.c @@ -66,12 +66,10 @@ void glamor_set_destination_pixmap_fbo(glamor_pixmap_fbo *fbo, int x0, int y0, int width, int height) { - glamor_get_context(fbo->glamor_priv); + glamor_make_current(fbo->glamor_priv); glBindFramebuffer(GL_FRAMEBUFFER, fbo->fb); glViewport(x0, y0, width, height); - - glamor_put_context(fbo->glamor_priv); } void @@ -707,7 +705,7 @@ __glamor_upload_pixmap_to_texture(PixmapPtr pixmap, unsigned int *tex, int non_sub = 0; unsigned int iformat = 0; - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); if (*tex == 0) { glGenTextures(1, tex); if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) @@ -735,7 +733,6 @@ __glamor_upload_pixmap_to_texture(PixmapPtr pixmap, unsigned int *tex, if (bits == NULL) glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); - glamor_put_context(glamor_priv); } static Bool @@ -832,7 +829,7 @@ _glamor_upload_bits_to_pixmap_texture(PixmapPtr pixmap, GLenum format, x + w, y + h, glamor_priv->yInverted, vertices); /* Slow path, we need to flip y or wire alpha to 1. */ - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_FLOAT, GL_FALSE, 2 * sizeof(float), vertices); glEnableVertexAttribArray(GLAMOR_VERTEX_POS); @@ -859,8 +856,6 @@ _glamor_upload_bits_to_pixmap_texture(PixmapPtr pixmap, GLenum format, glDeleteTextures(1, &tex); glBindFramebuffer(GL_FRAMEBUFFER, 0); - glamor_put_context(glamor_priv); - if (need_free_bits) free(bits); return TRUE; @@ -1140,7 +1135,7 @@ glamor_es2_pixmap_read_prepare(PixmapPtr source, int x, int y, int w, int h, if (temp_fbo == NULL) return NULL; - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); temp_xscale = 1.0 / w; temp_yscale = 1.0 / h; @@ -1177,7 +1172,6 @@ glamor_es2_pixmap_read_prepare(PixmapPtr source, int x, int y, int w, int h, glDisableVertexAttribArray(GLAMOR_VERTEX_POS); glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE); - glamor_put_context(glamor_priv); return temp_fbo; } @@ -1223,6 +1217,7 @@ _glamor_download_sub_pixmap_to_cpu(PixmapPtr pixmap, GLenum format, assert(0); } + glamor_make_current(glamor_priv); glamor_set_destination_pixmap_priv_nc(pixmap_priv); need_post_conversion = (revert > REVERT_NORMAL); @@ -1255,7 +1250,6 @@ _glamor_download_sub_pixmap_to_cpu(PixmapPtr pixmap, GLenum format, fbo_y_off = 0; } - glamor_get_context(glamor_priv); glPixelStorei(GL_PACK_ALIGNMENT, 4); if (glamor_priv->has_pack_invert || glamor_priv->yInverted) { @@ -1286,7 +1280,7 @@ _glamor_download_sub_pixmap_to_cpu(PixmapPtr pixmap, GLenum format, unsigned int temp_pbo; int yy; - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); glGenBuffers(1, &temp_pbo); glBindBuffer(GL_PIXEL_PACK_BUFFER, temp_pbo); glBufferData(GL_PIXEL_PACK_BUFFER, stride * h, NULL, GL_STREAM_READ); @@ -1301,7 +1295,6 @@ _glamor_download_sub_pixmap_to_cpu(PixmapPtr pixmap, GLenum format, } glBindFramebuffer(GL_FRAMEBUFFER, 0); - glamor_put_context(glamor_priv); if (need_post_conversion) { /* As OpenGL desktop version never enters here. @@ -1473,10 +1466,9 @@ glamor_download_pixmap_to_cpu(PixmapPtr pixmap, glamor_access_t access) data = malloc(stride * pixmap->drawable.height); } else { - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); if (pixmap_priv->base.fbo->pbo == 0) glGenBuffers(1, &pixmap_priv->base.fbo->pbo); - glamor_put_context(glamor_priv); pbo = pixmap_priv->base.fbo->pbo; } diff --git a/xorg-server/glamor/glamor_points.c b/xorg-server/glamor/glamor_points.c index 0d58e555f..d4525e294 100644 --- a/xorg-server/glamor/glamor_points.c +++ b/xorg-server/glamor/glamor_points.c @@ -52,7 +52,7 @@ glamor_poly_point_gl(DrawablePtr drawable, GCPtr gc, int mode, int npt, DDXPoint if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) goto bail; - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); if (prog->failed) goto bail_ctx; @@ -105,8 +105,6 @@ glamor_poly_point_gl(DrawablePtr drawable, GCPtr gc, int mode, int npt, DDXPoint glDisable(GL_COLOR_LOGIC_OP); glDisableVertexAttribArray(GLAMOR_VERTEX_POS); - glamor_put_context(glamor_priv); - glamor_priv->state = RENDER_STATE; glamor_priv->render_idle_cnt = 0; @@ -114,7 +112,6 @@ glamor_poly_point_gl(DrawablePtr drawable, GCPtr gc, int mode, int npt, DDXPoint bail_ctx: glDisable(GL_COLOR_LOGIC_OP); - glamor_put_context(glamor_priv); bail: return FALSE; } diff --git a/xorg-server/glamor/glamor_priv.h b/xorg-server/glamor/glamor_priv.h index 0cafac4b5..a2a21fca0 100644 --- a/xorg-server/glamor/glamor_priv.h +++ b/xorg-server/glamor/glamor_priv.h @@ -277,11 +277,6 @@ typedef struct glamor_screen_private { /* glamor trapezoid shader. */ GLint trapezoid_prog; - /* glamor_putimage */ - GLint put_image_xybitmap_prog; - GLint put_image_xybitmap_fg_uniform_location; - GLint put_image_xybitmap_bg_uniform_location; - PixmapPtr *back_pixmap; int screen_fbo; struct glamor_saved_procs saved_procs; @@ -704,12 +699,6 @@ void glamor_glyphs(CARD8 op, void glamor_poly_lines(DrawablePtr drawable, GCPtr gc, int mode, int n, DDXPointPtr points); -/* glamor_putimage.c */ -void glamor_put_image(DrawablePtr drawable, GCPtr gc, int depth, int x, int y, - int w, int h, int leftPad, int format, char *bits); -void glamor_init_putimage_shaders(ScreenPtr screen); -void glamor_fini_putimage_shaders(ScreenPtr screen); - /* glamor_render.c */ Bool glamor_composite_clipped_region(CARD8 op, PicturePtr source, @@ -951,9 +940,6 @@ Bool glamor_fixup_pixmap_priv(ScreenPtr screen, void glamor_picture_format_fixup(PicturePtr picture, glamor_pixmap_private *pixmap_priv); -void glamor_get_image(DrawablePtr pDrawable, int x, int y, int w, int h, - unsigned int format, unsigned long planeMask, char *d); - void glamor_add_traps(PicturePtr pPicture, INT16 x_off, INT16 y_off, int ntrap, xTrap *traps); @@ -994,6 +980,15 @@ void glamor_poly_fill_rect(DrawablePtr drawable, GCPtr gc, int nrect, xRectangle *prect); +/* glamor_image.c */ +void +glamor_put_image(DrawablePtr drawable, GCPtr gc, int depth, int x, int y, + int w, int h, int leftPad, int format, char *bits); + +void +glamor_get_image(DrawablePtr pDrawable, int x, int y, int w, int h, + unsigned int format, unsigned long planeMask, char *d); + /* glamor_glyphblt.c */ void glamor_image_glyph_blt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int nglyph, diff --git a/xorg-server/glamor/glamor_putimage.c b/xorg-server/glamor/glamor_putimage.c deleted file mode 100644 index cf7197bfc..000000000 --- a/xorg-server/glamor/glamor_putimage.c +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Copyright © 2009 Intel Corporation - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - * - * Authors: - * Eric Anholt - * Zhigang Gong - * - */ - -/** @file glamor_putaimge.c - * - * XPutImage implementation - */ -#include "glamor_priv.h" - -void -glamor_init_putimage_shaders(ScreenPtr screen) -{ -} - -void -glamor_fini_putimage_shaders(ScreenPtr screen) -{ -} - -static Bool -_glamor_put_image(DrawablePtr drawable, GCPtr gc, int depth, int x, int y, - int w, int h, int left_pad, int image_format, char *bits, - Bool fallback) -{ - PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable); - glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap); - RegionPtr clip; - int x_off, y_off; - Bool ret = FALSE; - PixmapPtr temp_pixmap, sub_pixmap; - glamor_pixmap_private *temp_pixmap_priv; - BoxRec box; - - glamor_get_drawable_deltas(drawable, pixmap, &x_off, &y_off); - clip = fbGetCompositeClip(gc); - if (image_format == XYBitmap) { - assert(depth == 1); - goto fail; - } - - if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) { - glamor_fallback("has no fbo.\n"); - goto fail; - } - - if (image_format != ZPixmap) { - glamor_fallback("non-ZPixmap\n"); - goto fail; - } - - if (!glamor_set_planemask(pixmap, gc->planemask)) { - goto fail; - } - /* create a temporary pixmap and upload the bits to that - * pixmap, then apply clip copy it to the destination pixmap.*/ - box.x1 = x + drawable->x; - box.y1 = y + drawable->y; - box.x2 = x + w + drawable->x; - box.y2 = y + h + drawable->y; - - if ((clip != NULL && RegionContainsRect(clip, &box) != rgnIN) - || gc->alu != GXcopy) { - temp_pixmap = glamor_create_pixmap(drawable->pScreen, w, h, depth, 0); - if (temp_pixmap == NULL) - goto fail; - - temp_pixmap_priv = glamor_get_pixmap_private(temp_pixmap); - - if (GLAMOR_PIXMAP_PRIV_IS_PICTURE(pixmap_priv)) { - temp_pixmap_priv->base.picture = pixmap_priv->base.picture; - temp_pixmap_priv->base.is_picture = pixmap_priv->base.is_picture; - } - - glamor_upload_sub_pixmap_to_texture(temp_pixmap, 0, 0, w, h, - pixmap->devKind, bits, 0); - - glamor_copy_area(&temp_pixmap->drawable, drawable, gc, 0, 0, w, h, x, - y); - glamor_destroy_pixmap(temp_pixmap); - } - else - glamor_upload_sub_pixmap_to_texture(pixmap, x + drawable->x + x_off, - y + drawable->y + y_off, w, h, - PixmapBytePad(w, depth), bits, 0); - ret = TRUE; - goto done; - - fail: - glamor_set_planemask(pixmap, ~0); - - if (!fallback && glamor_ddx_fallback_check_pixmap(&pixmap->drawable)) - goto done; - - glamor_fallback("to %p (%c)\n", - drawable, glamor_get_drawable_location(drawable)); - - sub_pixmap = glamor_get_sub_pixmap(pixmap, x + x_off + drawable->x, - y + y_off + drawable->y, w, h, - GLAMOR_ACCESS_RW); - if (sub_pixmap) { - if (clip != NULL) - pixman_region_translate(clip, -x - drawable->x, -y - drawable->y); - - fbPutImage(&sub_pixmap->drawable, gc, depth, 0, 0, w, h, - left_pad, image_format, bits); - - glamor_put_sub_pixmap(sub_pixmap, pixmap, - x + x_off + drawable->x, - y + y_off + drawable->y, w, h, GLAMOR_ACCESS_RW); - if (clip != NULL) - pixman_region_translate(clip, x + drawable->x, y + drawable->y); - } - else - fbPutImage(drawable, gc, depth, x, y, w, h, - left_pad, image_format, bits); - ret = TRUE; - - done: - return ret; -} - -void -glamor_put_image(DrawablePtr drawable, GCPtr gc, int depth, int x, int y, - int w, int h, int left_pad, int image_format, char *bits) -{ - _glamor_put_image(drawable, gc, depth, x, y, w, h, - left_pad, image_format, bits, TRUE); -} - -Bool -glamor_put_image_nf(DrawablePtr drawable, GCPtr gc, int depth, int x, int y, - int w, int h, int left_pad, int image_format, char *bits) -{ - return _glamor_put_image(drawable, gc, depth, x, y, w, h, - left_pad, image_format, bits, FALSE); -} diff --git a/xorg-server/glamor/glamor_rects.c b/xorg-server/glamor/glamor_rects.c index 7731edec4..3a5c3f3f9 100644 --- a/xorg-server/glamor/glamor_rects.c +++ b/xorg-server/glamor/glamor_rects.c @@ -57,7 +57,7 @@ glamor_poly_fill_rect_gl(DrawablePtr drawable, if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) goto bail; - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); if (glamor_priv->glsl_version >= 130) { prog = glamor_use_program_fill(pixmap, gc, @@ -144,11 +144,9 @@ glamor_poly_fill_rect_gl(DrawablePtr drawable, glVertexAttribDivisor(GLAMOR_VERTEX_POS, 0); glDisableVertexAttribArray(GLAMOR_VERTEX_POS); - glamor_put_context(glamor_priv); return TRUE; bail_ctx: glDisable(GL_COLOR_LOGIC_OP); - glamor_put_context(glamor_priv); bail: return FALSE; } diff --git a/xorg-server/glamor/glamor_render.c b/xorg-server/glamor/glamor_render.c index cdf8effdc..5a7a23880 100644 --- a/xorg-server/glamor/glamor_render.c +++ b/xorg-server/glamor/glamor_render.c @@ -316,13 +316,13 @@ glamor_create_composite_shader(ScreenPtr screen, struct shader_key *key, GLint source_sampler_uniform_location, mask_sampler_uniform_location; glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); vs = glamor_create_composite_vs(key); if (vs == 0) - goto out; + return; fs = glamor_create_composite_fs(key); if (fs == 0) - goto out; + return; prog = glCreateProgram(); glAttachShader(prog, vs); @@ -363,9 +363,6 @@ glamor_create_composite_shader(ScreenPtr screen, struct shader_key *key, glGetUniformLocation(prog, "mask_repeat_mode"); } } - - out: - glamor_put_context(glamor_priv); } static glamor_composite_shader * @@ -406,7 +403,7 @@ glamor_init_composite_shaders(ScreenPtr screen) int eb_size; glamor_priv = glamor_get_screen_private(screen); - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); glGenBuffers(1, &glamor_priv->ebo); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, glamor_priv->ebo); @@ -416,8 +413,6 @@ glamor_init_composite_shaders(ScreenPtr screen) glamor_init_eb(eb, GLAMOR_COMPOSITE_VBO_VERT_CNT); glBufferData(GL_ELEMENT_ARRAY_BUFFER, eb_size, eb, GL_STATIC_DRAW); free(eb); - - glamor_put_context(glamor_priv); } void @@ -428,7 +423,7 @@ glamor_fini_composite_shaders(ScreenPtr screen) int i, j, k; glamor_priv = glamor_get_screen_private(screen); - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); glDeleteBuffers(1, &glamor_priv->ebo); @@ -439,8 +434,6 @@ glamor_fini_composite_shaders(ScreenPtr screen) if (shader->prog) glDeleteProgram(shader->prog); } - - glamor_put_context(glamor_priv); } static Bool @@ -496,7 +489,7 @@ glamor_set_composite_texture(glamor_screen_private *glamor_priv, int unit, float wh[4]; int repeat_type; - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); glActiveTexture(GL_TEXTURE0 + unit); glBindTexture(GL_TEXTURE_2D, pixmap_priv->base.fbo->tex); repeat_type = picture->repeatType; @@ -564,7 +557,6 @@ glamor_set_composite_texture(glamor_screen_private *glamor_priv, int unit, repeat_type -= RepeatFix; } glUniform1i(repeat_location, repeat_type); - glamor_put_context(glamor_priv); } static void @@ -685,7 +677,7 @@ glamor_setup_composite_vbo(ScreenPtr screen, int n_verts) vert_size = n_verts * glamor_priv->vb_stride; - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); vb = glamor_get_vbo_space(screen, vert_size, &vbo_offset); glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_FLOAT, GL_FALSE, @@ -707,7 +699,6 @@ glamor_setup_composite_vbo(ScreenPtr screen, int n_verts) 4 : 2) * sizeof(float)); glEnableVertexAttribArray(GLAMOR_VERTEX_MASK); } - glamor_put_context(glamor_priv); return vb; } @@ -717,7 +708,7 @@ glamor_flush_composite_rects(ScreenPtr screen) { glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); if (!glamor_priv->render_nr_verts) return; @@ -730,7 +721,6 @@ glamor_flush_composite_rects(ScreenPtr screen) glDrawElements(GL_TRIANGLES, (glamor_priv->render_nr_verts * 3) / 2, GL_UNSIGNED_SHORT, NULL); } - glamor_put_context(glamor_priv); } int pict_format_combine_tab[][3] = { @@ -880,7 +870,10 @@ glamor_composite_choose_shader(CARD8 op, goto fail; } else { - key.source = SHADER_SOURCE_TEXTURE_ALPHA; + if (PICT_FORMAT_A(source->format)) + key.source = SHADER_SOURCE_TEXTURE_ALPHA; + else + key.source = SHADER_SOURCE_TEXTURE; } if (mask) { @@ -1038,6 +1031,16 @@ glamor_composite_choose_shader(CARD8 op, } #endif + /* If the source and mask are two differently-formatted views of + * the same pixmap bits, and the pixmap was already uploaded (so + * the dynamic code above doesn't apply), then fall back to + * software. We should use texture views to fix this properly. + */ + if (source_pixmap && source_pixmap == mask_pixmap && + source->format != mask->format) { + goto fail; + } + /*Before enter the rendering stage, we need to fixup * transformed source and mask, if the transform is not int translate. */ if (key.source != SHADER_SOURCE_SOLID @@ -1102,7 +1105,7 @@ glamor_composite_set_shader_blend(glamor_pixmap_private *dest_priv, glamor_priv = dest_priv->base.glamor_priv; - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); glUseProgram(shader->prog); if (key->source == SHADER_SOURCE_SOLID) { @@ -1136,8 +1139,6 @@ glamor_composite_set_shader_blend(glamor_pixmap_private *dest_priv, glEnable(GL_BLEND); glBlendFunc(op_info->source_blend, op_info->dest_blend); } - - glamor_put_context(glamor_priv); } static Bool @@ -1192,7 +1193,7 @@ glamor_composite_with_shader(CARD8 op, glamor_set_destination_pixmap_priv_nc(dest_pixmap_priv); glamor_composite_set_shader_blend(dest_pixmap_priv, &key, shader, &op_info); - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); glamor_priv->has_source_coords = key.source != SHADER_SOURCE_SOLID; glamor_priv->has_mask_coords = (key.mask != SHADER_MASK_NONE && @@ -1318,7 +1319,6 @@ glamor_composite_with_shader(CARD8 op, glamor_priv->render_idle_cnt = 0; if (saved_source_format) source->format = saved_source_format; - glamor_put_context(glamor_priv); ret = TRUE; return ret; @@ -1450,8 +1450,8 @@ glamor_composite_clipped_region(CARD8 op, || source_pixmap->drawable.height != height)))) { temp_src = glamor_convert_gradient_picture(screen, source, - extent->x1 + x_source - x_dest, - extent->y1 + y_source - y_dest, + x_source, + y_source, width, height); if (!temp_src) { temp_src = source; @@ -1459,8 +1459,8 @@ glamor_composite_clipped_region(CARD8 op, } temp_src_priv = glamor_get_pixmap_private((PixmapPtr) (temp_src->pDrawable)); - x_temp_src = -extent->x1 + x_dest; - y_temp_src = -extent->y1 + y_dest; + x_temp_src = 0; + y_temp_src = 0; } if (mask @@ -1474,8 +1474,8 @@ glamor_composite_clipped_region(CARD8 op, * to do reduce one convertion. */ temp_mask = glamor_convert_gradient_picture(screen, mask, - extent->x1 + x_mask - x_dest, - extent->y1 + y_mask - y_dest, + x_mask, + y_mask, width, height); if (!temp_mask) { temp_mask = mask; @@ -1483,8 +1483,8 @@ glamor_composite_clipped_region(CARD8 op, } temp_mask_priv = glamor_get_pixmap_private((PixmapPtr) (temp_mask->pDrawable)); - x_temp_mask = -extent->x1 + x_dest; - y_temp_mask = -extent->y1 + y_dest; + x_temp_mask = 0; + y_temp_mask = 0; } /* Do two-pass PictOpOver componentAlpha, until we enable * dual source color blending. diff --git a/xorg-server/glamor/glamor_spans.c b/xorg-server/glamor/glamor_spans.c index 98842cdde..46ba6c38f 100644 --- a/xorg-server/glamor/glamor_spans.c +++ b/xorg-server/glamor/glamor_spans.c @@ -61,7 +61,7 @@ glamor_fill_spans_gl(DrawablePtr drawable, if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) goto bail; - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); if (glamor_priv->glsl_version >= 130) { prog = glamor_use_program_fill(pixmap, gc, &glamor_priv->fill_spans_program, @@ -152,11 +152,9 @@ glamor_fill_spans_gl(DrawablePtr drawable, glVertexAttribDivisor(GLAMOR_VERTEX_POS, 0); glDisableVertexAttribArray(GLAMOR_VERTEX_POS); - glamor_put_context(glamor_priv); return TRUE; bail_ctx: glDisable(GL_COLOR_LOGIC_OP); - glamor_put_context(glamor_priv); bail: return FALSE; } @@ -222,7 +220,7 @@ glamor_get_spans_gl(DrawablePtr drawable, int wmax, glamor_format_for_pixmap(pixmap, &format, &type); - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); glamor_pixmap_loop(pixmap_priv, box_x, box_y) { BoxPtr box = glamor_pixmap_box_at(pixmap_priv, box_x, box_y); @@ -261,7 +259,6 @@ glamor_get_spans_gl(DrawablePtr drawable, int wmax, } } - glamor_put_context(glamor_priv); return TRUE; bail: return FALSE; @@ -327,7 +324,7 @@ glamor_set_spans_gl(DrawablePtr drawable, GCPtr gc, char *src, glamor_get_drawable_deltas(drawable, pixmap, &off_x, &off_y); glamor_format_for_pixmap(pixmap, &format, &type); - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); @@ -397,7 +394,6 @@ glamor_set_spans_gl(DrawablePtr drawable, GCPtr gc, char *src, } } - glamor_put_context(glamor_priv); return TRUE; bail: diff --git a/xorg-server/glamor/glamor_text.c b/xorg-server/glamor/glamor_text.c index 0e4b74c56..395116d5b 100644 --- a/xorg-server/glamor/glamor_text.c +++ b/xorg-server/glamor/glamor_text.c @@ -267,7 +267,7 @@ glamor_poly_text(DrawablePtr drawable, GCPtr gc, if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) goto bail; - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); prog = glamor_use_program_fill(pixmap, gc, &glamor_priv->poly_text_progs, &glamor_facet_poly_text); @@ -279,8 +279,6 @@ glamor_poly_text(DrawablePtr drawable, GCPtr gc, glDisable(GL_COLOR_LOGIC_OP); - glamor_put_context(glamor_priv); - glamor_priv->state = RENDER_STATE; glamor_priv->render_idle_cnt = 0; @@ -289,7 +287,6 @@ glamor_poly_text(DrawablePtr drawable, GCPtr gc, bail_ctx: glDisable(GL_COLOR_LOGIC_OP); - glamor_put_context(glamor_priv); bail: return FALSE; } @@ -420,7 +417,7 @@ glamor_image_text(DrawablePtr drawable, GCPtr gc, glamor_get_glyphs(gc->font, glamor_font, count, chars, sixteen, charinfo); - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); if (TERMINALFONT(gc->font)) prog = &glamor_priv->te_text_prog; @@ -482,8 +479,6 @@ glamor_image_text(DrawablePtr drawable, GCPtr gc, (void) glamor_text(drawable, gc, glamor_font, prog, x, y, count, chars, charinfo, sixteen); - glamor_put_context(glamor_priv); - glamor_priv->state = RENDER_STATE; glamor_priv->render_idle_cnt = 0; @@ -491,7 +486,6 @@ glamor_image_text(DrawablePtr drawable, GCPtr gc, bail: glDisable(GL_COLOR_LOGIC_OP); - glamor_put_context(glamor_priv); return FALSE; } diff --git a/xorg-server/glamor/glamor_tile.c b/xorg-server/glamor/glamor_tile.c index 9e115cad1..4e479763e 100644 --- a/xorg-server/glamor/glamor_tile.c +++ b/xorg-server/glamor/glamor_tile.c @@ -62,7 +62,7 @@ glamor_init_tile_shader(ScreenPtr screen) GLint sampler_uniform_location; glamor_priv = glamor_get_screen_private(screen); - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); glamor_priv->tile_prog = glCreateProgram(); vs_prog = glamor_compile_glsl_prog(GL_VERTEX_SHADER, tile_vs); fs_prog = glamor_compile_glsl_prog(GL_FRAGMENT_SHADER, tile_fs); @@ -82,7 +82,6 @@ glamor_init_tile_shader(ScreenPtr screen) glamor_priv->tile_wh = glGetUniformLocation(glamor_priv->tile_prog, "wh"); - glamor_put_context(glamor_priv); } void @@ -91,9 +90,8 @@ glamor_fini_tile_shader(ScreenPtr screen) glamor_screen_private *glamor_priv; glamor_priv = glamor_get_screen_private(screen); - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); glDeleteProgram(glamor_priv->tile_prog); - glamor_put_context(glamor_priv); } static void @@ -123,7 +121,7 @@ _glamor_tile(PixmapPtr pixmap, PixmapPtr tile, glamor_set_destination_pixmap_priv_nc(dst_pixmap_priv); pixmap_priv_get_dest_scale(dst_pixmap_priv, &dst_xscale, &dst_yscale); pixmap_priv_get_scale(src_pixmap_priv, &src_xscale, &src_yscale); - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); glUseProgram(glamor_priv->tile_prog); glamor_pixmap_fbo_fix_wh_ratio(wh, src_pixmap_priv); @@ -155,7 +153,6 @@ _glamor_tile(PixmapPtr pixmap, PixmapPtr tile, glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE); glDisableVertexAttribArray(GLAMOR_VERTEX_POS); - glamor_put_context(glamor_priv); glamor_priv->state = RENDER_STATE; glamor_priv->render_idle_cnt = 0; @@ -193,10 +190,9 @@ glamor_tile(PixmapPtr pixmap, PixmapPtr tile, goto fail; } - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); if (!glamor_set_alu(screen, alu)) { glamor_fallback("unsupported alu %x\n", alu); - glamor_put_context(glamor_priv); goto fail; } @@ -290,7 +286,6 @@ glamor_tile(PixmapPtr pixmap, PixmapPtr tile, _glamor_tile(pixmap, tile, x, y, width, height, tile_x, tile_y); glamor_set_alu(screen, GXcopy); - glamor_put_context(glamor_priv); return TRUE; fail: return FALSE; diff --git a/xorg-server/glamor/glamor_transfer.c b/xorg-server/glamor/glamor_transfer.c index 0378bb076..ad875c962 100644 --- a/xorg-server/glamor/glamor_transfer.c +++ b/xorg-server/glamor/glamor_transfer.c @@ -70,7 +70,7 @@ glamor_upload_boxes(PixmapPtr pixmap, BoxPtr in_boxes, int in_nbox, glamor_format_for_pixmap(pixmap, &format, &type); - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); @@ -127,7 +127,6 @@ glamor_upload_boxes(PixmapPtr pixmap, BoxPtr in_boxes, int in_nbox, glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); - glamor_put_context(glamor_priv); } /* @@ -180,7 +179,7 @@ glamor_download_boxes(PixmapPtr pixmap, BoxPtr in_boxes, int in_nbox, glamor_format_for_pixmap(pixmap, &format, &type); - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); glPixelStorei(GL_PACK_ALIGNMENT, 4); glPixelStorei(GL_PACK_ROW_LENGTH, byte_stride / bytes_per_pixel); @@ -226,7 +225,6 @@ glamor_download_boxes(PixmapPtr pixmap, BoxPtr in_boxes, int in_nbox, glPixelStorei(GL_PACK_ROW_LENGTH, 0); glPixelStorei(GL_PACK_SKIP_ROWS, 0); glPixelStorei(GL_PACK_SKIP_PIXELS, 0); - glamor_put_context(glamor_priv); } /* diff --git a/xorg-server/glamor/glamor_trapezoid.c b/xorg-server/glamor/glamor_trapezoid.c index c76b8bb2a..4aba469af 100644 --- a/xorg-server/glamor/glamor_trapezoid.c +++ b/xorg-server/glamor/glamor_trapezoid.c @@ -235,14 +235,13 @@ glamor_flush_composite_triangles(ScreenPtr screen) { glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); glamor_put_vbo_space(screen); if (!glamor_priv->render_nr_verts) return; glDrawArrays(GL_TRIANGLES, 0, glamor_priv->render_nr_verts); - glamor_put_context(glamor_priv); } static Bool @@ -627,7 +626,7 @@ glamor_setup_composite_vbo_for_trapezoid(ScreenPtr screen, int n_verts) vert_size = n_verts * glamor_priv->vb_stride; - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); glDisableVertexAttribArray(GLAMOR_VERTEX_POS); glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE); @@ -667,8 +666,6 @@ glamor_setup_composite_vbo_for_trapezoid(ScreenPtr screen, int n_verts) vbo_offset + stride * sizeof(float)); glEnableVertexAttribArray(GLAMOR_VERTEX_RIGHT_PARAM); - glamor_put_context(glamor_priv); - return vb; } @@ -811,7 +808,7 @@ _glamor_trapezoids_with_shader(CARD8 op, goto TRAPEZOID_OUT; } - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); box = REGION_RECTS(®ion); nbox = REGION_NUM_RECTS(®ion); @@ -979,7 +976,6 @@ _glamor_trapezoids_with_shader(CARD8 op, glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE); glDisableVertexAttribArray(GLAMOR_VERTEX_MASK); glDisable(GL_BLEND); - glamor_put_context(glamor_priv); TRAPEZOID_OUT: if (box) { @@ -1332,7 +1328,7 @@ glamor_init_trapezoid_shader(ScreenPtr screen) "}\n"; glamor_priv = glamor_get_screen_private(screen); - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); glamor_priv->trapezoid_prog = glCreateProgram(); @@ -1354,8 +1350,6 @@ glamor_init_trapezoid_shader(ScreenPtr screen) GLAMOR_VERTEX_RIGHT_PARAM, "v_right_param"); glamor_link_glsl_prog(screen, glamor_priv->trapezoid_prog, "trapezoid"); - - glamor_put_context(glamor_priv); } void @@ -1364,9 +1358,8 @@ glamor_fini_trapezoid_shader(ScreenPtr screen) glamor_screen_private *glamor_priv; glamor_priv = glamor_get_screen_private(screen); - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); glDeleteProgram(glamor_priv->trapezoid_prog); - glamor_put_context(glamor_priv); } static Bool @@ -1406,7 +1399,7 @@ _glamor_generate_trapezoid_with_shader(ScreenPtr screen, PicturePtr picture, return FALSE; } - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); glamor_set_destination_pixmap_priv_nc(pixmap_priv); @@ -1564,7 +1557,6 @@ _glamor_generate_trapezoid_with_shader(ScreenPtr screen, PicturePtr picture, glDisableVertexAttribArray(GLAMOR_VERTEX_TOP_BOTTOM); glDisableVertexAttribArray(GLAMOR_VERTEX_LEFT_PARAM); glDisableVertexAttribArray(GLAMOR_VERTEX_RIGHT_PARAM); - glamor_put_context(glamor_priv); return TRUE; } diff --git a/xorg-server/glamor/glamor_utils.h b/xorg-server/glamor/glamor_utils.h index 53b7d9bec..4c1581ef5 100644 --- a/xorg-server/glamor/glamor_utils.h +++ b/xorg-server/glamor/glamor_utils.h @@ -1499,15 +1499,12 @@ __fls(unsigned long x) #endif static inline void -glamor_get_context(glamor_screen_private * glamor_priv) +glamor_make_current(glamor_screen_private *glamor_priv) { - glamor_priv->ctx.get_context(&glamor_priv->ctx); -} - -static inline void -glamor_put_context(glamor_screen_private * glamor_priv) -{ - glamor_priv->ctx.put_context(&glamor_priv->ctx); + if (lastGLContext != &glamor_priv->ctx) { + lastGLContext = &glamor_priv->ctx; + glamor_priv->ctx.make_current(&glamor_priv->ctx); + } } #endif diff --git a/xorg-server/glamor/glamor_vbo.c b/xorg-server/glamor/glamor_vbo.c index 2731692d6..c6785594b 100644 --- a/xorg-server/glamor/glamor_vbo.c +++ b/xorg-server/glamor/glamor_vbo.c @@ -48,7 +48,7 @@ glamor_get_vbo_space(ScreenPtr screen, unsigned size, char **vbo_offset) glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); void *data; - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); glBindBuffer(GL_ARRAY_BUFFER, glamor_priv->vbo); @@ -79,7 +79,6 @@ glamor_get_vbo_space(ScreenPtr screen, unsigned size, char **vbo_offset) */ glamor_priv->has_buffer_storage = false; glamor_priv->vbo_size = 0; - glamor_put_context(glamor_priv); return glamor_get_vbo_space(screen, size, vbo_offset); } @@ -130,8 +129,6 @@ glamor_get_vbo_space(ScreenPtr screen, unsigned size, char **vbo_offset) data = glamor_priv->vb; } - glamor_put_context(glamor_priv); - return data; } @@ -140,7 +137,7 @@ glamor_put_vbo_space(ScreenPtr screen) { glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); if (glamor_priv->has_buffer_storage) { /* If we're in the ARB_buffer_storage path, we have a @@ -155,8 +152,6 @@ glamor_put_vbo_space(ScreenPtr screen) } glBindBuffer(GL_ARRAY_BUFFER, 0); - - glamor_put_context(glamor_priv); } void @@ -164,11 +159,9 @@ glamor_init_vbo(ScreenPtr screen) { glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); glGenBuffers(1, &glamor_priv->vbo); - - glamor_put_context(glamor_priv); } void @@ -176,11 +169,9 @@ glamor_fini_vbo(ScreenPtr screen) { glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); glDeleteBuffers(1, &glamor_priv->vbo); if (!glamor_priv->has_map_buffer_range) free(glamor_priv->vb); - - glamor_put_context(glamor_priv); } diff --git a/xorg-server/glamor/glamor_xv.c b/xorg-server/glamor/glamor_xv.c index 4e60fa3a4..369b02b61 100644 --- a/xorg-server/glamor/glamor_xv.c +++ b/xorg-server/glamor/glamor_xv.c @@ -97,7 +97,7 @@ glamor_init_xv_shader(ScreenPtr screen) GLint fs_prog, vs_prog; glamor_priv = glamor_get_screen_private(screen); - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); glamor_priv->xv_prog = glCreateProgram(); vs_prog = glamor_compile_glsl_prog(GL_VERTEX_SHADER, xv_vs); @@ -110,8 +110,6 @@ glamor_init_xv_shader(ScreenPtr screen) glBindAttribLocation(glamor_priv->xv_prog, GLAMOR_VERTEX_SOURCE, "v_texcoord0"); glamor_link_glsl_prog(screen, glamor_priv->xv_prog, "xv"); - - glamor_put_context(glamor_priv); } #define ClipValue(v,min,max) ((v) < (min) ? (min) : (v) > (max) ? (max) : (v)) @@ -316,7 +314,7 @@ glamor_display_textured_video(glamor_port_private *port_priv) &src_yscale[i]); } } - glamor_get_context(glamor_priv); + glamor_make_current(glamor_priv); glUseProgram(glamor_priv->xv_prog); uloc = glGetUniformLocation(glamor_priv->xv_prog, "offsetyco"); @@ -404,7 +402,6 @@ glamor_display_textured_video(glamor_port_private *port_priv) glDisableVertexAttribArray(GLAMOR_VERTEX_POS); glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE); - glamor_put_context(glamor_priv); DamageDamageRegion(port_priv->pDraw, &port_priv->clip); } diff --git a/xorg-server/glx/glxcmds.c b/xorg-server/glx/glxcmds.c index 187e42665..2fc3f4cc8 100644 --- a/xorg-server/glx/glxcmds.c +++ b/xorg-server/glx/glxcmds.c @@ -188,7 +188,7 @@ validGlxDrawable(ClientPtr client, XID id, int type, int access_mode, void __glXContextDestroy(__GLXcontext * context) { - __glXFlushContextCache(); + lastGLContext = NULL; } static void @@ -275,6 +275,17 @@ DoCreateContext(__GLXclientState * cl, GLXContextID gcId, ** Allocate memory for the new context */ if (!isDirect) { + /* Only allow creating indirect GLX contexts if allowed by + * server command line. Indirect GLX is of limited use (since + * it's only GL 1.4), it's slower than direct contexts, and + * it's a massive attack surface for buffer overflow type + * errors. + */ + if (!enableIndirectGLX) { + client->errorValue = isDirect; + return BadValue; + } + /* Without any attributes, the only error that the driver should be * able to generate is BadAlloc. As result, just drop the error * returned from the driver on the floor. @@ -434,10 +445,6 @@ static void StopUsingContext(__GLXcontext * glxc) { if (glxc) { - if (glxc == __glXLastContext) { - /* Tell server GL library */ - __glXLastContext = 0; - } glxc->currentClient = NULL; if (!glxc->idExists) { FreeResourceByType(glxc->id, __glXContextRes, FALSE); @@ -448,7 +455,6 @@ StopUsingContext(__GLXcontext * glxc) static void StartUsingContext(__GLXclientState * cl, __GLXcontext * glxc) { - __glXLastContext = glxc; glxc->currentClient = cl->client; } @@ -627,7 +633,7 @@ DoMakeCurrent(__GLXclientState * cl, if (!(*prevglxc->loseCurrent) (prevglxc)) { return __glXError(GLXBadContext); } - __glXFlushContextCache(); + lastGLContext = NULL; if (!prevglxc->isDirect) { prevglxc->drawPriv = NULL; prevglxc->readPriv = NULL; @@ -640,7 +646,9 @@ DoMakeCurrent(__GLXclientState * cl, glxc->readPriv = readPriv; /* make the context current */ + lastGLContext = glxc; if (!(*glxc->makeCurrent) (glxc)) { + lastGLContext = NULL; glxc->drawPriv = NULL; glxc->readPriv = NULL; return __glXError(GLXBadContext); diff --git a/xorg-server/glx/glxdri2.c b/xorg-server/glx/glxdri2.c index 5d1a45bff..c756bf570 100644 --- a/xorg-server/glx/glxdri2.c +++ b/xorg-server/glx/glxdri2.c @@ -115,55 +115,54 @@ __glXDRIdrawableDestroy(__GLXdrawable * drawable) } static void -__glXDRIdrawableCopySubBuffer(__GLXdrawable * drawable, - int x, int y, int w, int h) +copy_box(__GLXdrawable * drawable, + int dst, int src, + int x, int y, int w, int h) { - __GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable; BoxRec box; RegionRec region; + __GLXcontext *cx = lastGLContext; box.x1 = x; - box.y1 = private->height - y - h; + box.y1 = y; box.x2 = x + w; - box.y2 = private->height - y; + box.y2 = y + h; RegionInit(®ion, &box, 0); - DRI2CopyRegion(drawable->pDraw, ®ion, - DRI2BufferFrontLeft, DRI2BufferBackLeft); + DRI2CopyRegion(drawable->pDraw, ®ion, dst, src); + if (cx != lastGLContext) { + lastGLContext = cx; + cx->makeCurrent(cx); + } } static void -__glXDRIdrawableWaitX(__GLXdrawable * drawable) +__glXDRIdrawableCopySubBuffer(__GLXdrawable * drawable, + int x, int y, int w, int h) { __GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable; - BoxRec box; - RegionRec region; - box.x1 = 0; - box.y1 = 0; - box.x2 = private->width; - box.y2 = private->height; - RegionInit(®ion, &box, 0); + copy_box(drawable, x, private->height - y - h, + w, h, + DRI2BufferFrontLeft, DRI2BufferBackLeft); +} + +static void +__glXDRIdrawableWaitX(__GLXdrawable * drawable) +{ + __GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable; - DRI2CopyRegion(drawable->pDraw, ®ion, - DRI2BufferFakeFrontLeft, DRI2BufferFrontLeft); + copy_box(drawable, DRI2BufferFakeFrontLeft, DRI2BufferFrontLeft, + 0, 0, private->width, private->height); } static void __glXDRIdrawableWaitGL(__GLXdrawable * drawable) { __GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable; - BoxRec box; - RegionRec region; - - box.x1 = 0; - box.y1 = 0; - box.x2 = private->width; - box.y2 = private->height; - RegionInit(®ion, &box, 0); - DRI2CopyRegion(drawable->pDraw, ®ion, - DRI2BufferFrontLeft, DRI2BufferFakeFrontLeft); + copy_box(drawable, DRI2BufferFrontLeft, DRI2BufferFakeFrontLeft, + 0, 0, private->width, private->height); } static void @@ -204,26 +203,37 @@ __glXDRIdrawableSwapBuffers(ClientPtr client, __GLXdrawable * drawable) __GLXDRIdrawable *priv = (__GLXDRIdrawable *) drawable; __GLXDRIscreen *screen = priv->screen; CARD64 unused; + __GLXcontext *cx = lastGLContext; + int status; if (screen->flush) { (*screen->flush->flush) (priv->driDrawable); (*screen->flush->invalidate) (priv->driDrawable); } - if (DRI2SwapBuffers(client, drawable->pDraw, 0, 0, 0, &unused, - __glXdriSwapEvent, drawable) != Success) - return FALSE; + status = DRI2SwapBuffers(client, drawable->pDraw, 0, 0, 0, &unused, + __glXdriSwapEvent, drawable); + if (cx != lastGLContext) { + lastGLContext = cx; + cx->makeCurrent(cx); + } - return TRUE; + return status == Success; } static int __glXDRIdrawableSwapInterval(__GLXdrawable * drawable, int interval) { + __GLXcontext *cx = lastGLContext; + if (interval <= 0) /* || interval > BIGNUM? */ return GLX_BAD_VALUE; DRI2SwapInterval(drawable->pDraw, interval); + if (cx != lastGLContext) { + lastGLContext = cx; + cx->makeCurrent(cx); + } return 0; } @@ -276,7 +286,16 @@ static Bool __glXDRIcontextWait(__GLXcontext * baseContext, __GLXclientState * cl, int *error) { - if (DRI2WaitSwap(cl->client, baseContext->drawPriv->pDraw)) { + __GLXcontext *cx = lastGLContext; + Bool ret; + + ret = DRI2WaitSwap(cl->client, baseContext->drawPriv->pDraw); + if (cx != lastGLContext) { + lastGLContext = cx; + cx->makeCurrent(cx); + } + + if (ret) { *error = cl->client->noClientException; return TRUE; } @@ -600,6 +619,8 @@ __glXDRIscreenCreateDrawable(ClientPtr client, __GLXDRIscreen *driScreen = (__GLXDRIscreen *) screen; __GLXDRIconfig *config = (__GLXDRIconfig *) glxConfig; __GLXDRIdrawable *private; + __GLXcontext *cx = lastGLContext; + Bool ret; private = calloc(1, sizeof *private); if (private == NULL) @@ -618,9 +639,15 @@ __glXDRIscreenCreateDrawable(ClientPtr client, private->base.waitGL = __glXDRIdrawableWaitGL; private->base.waitX = __glXDRIdrawableWaitX; - if (DRI2CreateDrawable2(client, pDraw, drawId, - __glXDRIinvalidateBuffers, private, - &private->dri2_id)) { + ret = DRI2CreateDrawable2(client, pDraw, drawId, + __glXDRIinvalidateBuffers, private, + &private->dri2_id); + if (cx != lastGLContext) { + lastGLContext = cx; + cx->makeCurrent(cx); + } + + if (ret) { free(private); return NULL; } @@ -642,9 +669,22 @@ dri2GetBuffers(__DRIdrawable * driDrawable, DRI2BufferPtr *buffers; int i; int j; + __GLXcontext *cx = lastGLContext; buffers = DRI2GetBuffers(private->base.pDraw, width, height, attachments, count, out_count); + if (cx != lastGLContext) { + lastGLContext = cx; + cx->makeCurrent(cx); + + /* If DRI2GetBuffers() changed the GL context, it may also have + * invalidated the DRI2 buffers, so let's get them again + */ + buffers = DRI2GetBuffers(private->base.pDraw, + width, height, attachments, count, out_count); + assert(lastGLContext == cx); + } + if (*out_count > MAX_DRAWABLE_BUFFERS) { *out_count = 0; return NULL; @@ -686,10 +726,24 @@ dri2GetBuffersWithFormat(__DRIdrawable * driDrawable, DRI2BufferPtr *buffers; int i; int j = 0; + __GLXcontext *cx = lastGLContext; buffers = DRI2GetBuffersWithFormat(private->base.pDraw, width, height, attachments, count, out_count); + if (cx != lastGLContext) { + lastGLContext = cx; + cx->makeCurrent(cx); + + /* If DRI2GetBuffersWithFormat() changed the GL context, it may also have + * invalidated the DRI2 buffers, so let's get them again + */ + buffers = DRI2GetBuffersWithFormat(private->base.pDraw, + width, height, attachments, count, + out_count); + assert(lastGLContext == cx); + } + if (*out_count > MAX_DRAWABLE_BUFFERS) { *out_count = 0; return NULL; diff --git a/xorg-server/glx/glxdriswrast.c b/xorg-server/glx/glxdriswrast.c index 6fa328831..c30ce9aed 100644 --- a/xorg-server/glx/glxdriswrast.c +++ b/xorg-server/glx/glxdriswrast.c @@ -337,6 +337,7 @@ swrastPutImage(__DRIdrawable * draw, int op, __GLXDRIdrawable *drawable = loaderPrivate; DrawablePtr pDraw = drawable->base.pDraw; GCPtr gc; + __GLXcontext *cx = lastGLContext; switch (op) { case __DRI_SWRAST_IMAGE_OP_DRAW: @@ -352,6 +353,10 @@ swrastPutImage(__DRIdrawable * draw, int op, ValidateGC(pDraw, gc); gc->ops->PutImage(pDraw, gc, pDraw->depth, x, y, w, h, 0, ZPixmap, data); + if (cx != lastGLContext) { + lastGLContext = cx; + cx->makeCurrent(cx); + } } static void @@ -361,8 +366,13 @@ swrastGetImage(__DRIdrawable * draw, __GLXDRIdrawable *drawable = loaderPrivate; DrawablePtr pDraw = drawable->base.pDraw; ScreenPtr pScreen = pDraw->pScreen; + __GLXcontext *cx = lastGLContext; pScreen->GetImage(pDraw, x, y, w, h, ZPixmap, ~0L, data); + if (cx != lastGLContext) { + lastGLContext = cx; + cx->makeCurrent(cx); + } } static const __DRIswrastLoaderExtension swrastLoaderExtension = { diff --git a/xorg-server/glx/glxext.c b/xorg-server/glx/glxext.c index c9b8cc5b3..c0142fe2e 100644 --- a/xorg-server/glx/glxext.c +++ b/xorg-server/glx/glxext.c @@ -47,12 +47,6 @@ #include "indirect_table.h" #include "indirect_util.h" -/* -** The last context used by the server. It is the context that is current -** from the server's perspective. -*/ -__GLXcontext *__glXLastContext; - /* ** X resources. */ @@ -79,7 +73,7 @@ static int __glXDispatch(ClientPtr); static void ResetExtension(ExtensionEntry * extEntry) { - __glXFlushContextCache(); + lastGLContext = NULL; } /* @@ -141,8 +135,7 @@ DrawableGone(__GLXdrawable * glxPriv, XID xid) (c->drawPriv == glxPriv || c->readPriv == glxPriv)) { /* just force a re-bind the next time through */ (*c->loseCurrent) (c); - if (c == __glXLastContext) - __glXFlushContextCache(); + lastGLContext = NULL; } if (c->drawPriv == glxPriv) c->drawPriv = NULL; @@ -203,8 +196,8 @@ __glXFreeContext(__GLXcontext * cx) free(cx->feedbackBuf); free(cx->selectBuf); - if (cx == __glXLastContext) { - __glXFlushContextCache(); + if (cx == lastGLContext) { + lastGLContext = NULL; } /* We can get here through both regular dispatching from @@ -296,6 +289,7 @@ glxClientCallback(CallbackListPtr *list, void *closure, void *data) next = c->next; if (c->currentClient == pClient) { c->loseCurrent(c); + lastGLContext = NULL; c->currentClient = NULL; __glXFreeContext(c); } @@ -406,12 +400,6 @@ GlxExtensionInit(void) /************************************************************************/ -void -__glXFlushContextCache(void) -{ - __glXLastContext = 0; -} - /* ** Make a context the current one for the GL (in this implementation, there ** is only one instance of the GL, and we use it to serve all GL clients by @@ -449,21 +437,22 @@ __glXForceCurrent(__GLXclientState * cl, GLXContextTag tag, int *error) if (cx->wait && (*cx->wait) (cx, cl, error)) return NULL; - if (cx == __glXLastContext) { + if (cx == lastGLContext) { /* No need to re-bind */ return cx; } /* Make this context the current one for the GL. */ if (!cx->isDirect) { + lastGLContext = cx; if (!(*cx->makeCurrent) (cx)) { /* Bind failed, and set the error code. Bummer */ + lastGLContext = NULL; cl->client->errorValue = cx->id; *error = __glXError(GLXBadContextState); return 0; } } - __glXLastContext = cx; return cx; } diff --git a/xorg-server/glx/glxserver.h b/xorg-server/glx/glxserver.h index 3f2ae3593..a324b290f 100644 --- a/xorg-server/glx/glxserver.h +++ b/xorg-server/glx/glxserver.h @@ -84,7 +84,6 @@ void __glXScreenInitVisuals(__GLXscreen * screen); /* ** The last context used (from the server's persective) is cached. */ -extern __GLXcontext *__glXLastContext; extern __GLXcontext *__glXForceCurrent(__GLXclientState *, GLXContextTag, int *); diff --git a/xorg-server/hw/dmx/config/xdmxconfig.c b/xorg-server/hw/dmx/config/xdmxconfig.c index 2b7b9683b..0540d0173 100644 --- a/xorg-server/hw/dmx/config/xdmxconfig.c +++ b/xorg-server/hw/dmx/config/xdmxconfig.c @@ -303,7 +303,6 @@ dmxConfigCanvasUpdate(void) fs = XQueryFont(dpy, gcontext); for (pt = dmxConfigCurrent->subentry; pt; pt = pt->next) { int x, y, len; - int xo = 3, yo = fs->ascent + fs->descent + 2; GC gc; if (pt->type != dmxConfigDisplay) @@ -321,6 +320,8 @@ dmxConfigCanvasUpdate(void) y = dmxConfigWidgetHeight - 1; XDrawRectangle(dpy, win, gc, x, y, w, h); if (fs && len) { + int xo = 3, yo = fs->ascent + fs->descent + 2; + while (len && XTextWidth(fs, pt->display->name, len) >= w - 2 * xo) --len; if (len) diff --git a/xorg-server/hw/kdrive/linux/linux.c b/xorg-server/hw/kdrive/linux/linux.c index 6284de576..73a8169bf 100644 --- a/xorg-server/hw/kdrive/linux/linux.c +++ b/xorg-server/hw/kdrive/linux/linux.c @@ -68,13 +68,16 @@ LinuxCheckChown(const char *file) struct stat st; __uid_t u; __gid_t g; + int r; if (stat(file, &st) < 0) return; u = getuid(); g = getgid(); - if (st.st_uid != u || st.st_gid != g) - chown(file, u, g); + if (st.st_uid != u || st.st_gid != g) { + r = chown(file, u, g); + (void) r; + } } static int diff --git a/xorg-server/hw/kdrive/src/kdrive.c b/xorg-server/hw/kdrive/src/kdrive.c index 8eb8cd02e..9814fc66a 100644 --- a/xorg-server/hw/kdrive/src/kdrive.c +++ b/xorg-server/hw/kdrive/src/kdrive.c @@ -118,10 +118,17 @@ KdDoSwitchCmd(const char *reason) { if (kdSwitchCmd) { char *command; + int ret; if (asprintf(&command, "%s %s", kdSwitchCmd, reason) == -1) return; - system(command); + + /* Ignore the return value from system; I'm not sure + * there's anything more useful to be done when + * it fails + */ + ret = system(command); + (void) ret; free(command); } } diff --git a/xorg-server/hw/xfree86/.gitignore b/xorg-server/hw/xfree86/.gitignore index fb6830b2c..c84c37ffb 100644 --- a/xorg-server/hw/xfree86/.gitignore +++ b/xorg-server/hw/xfree86/.gitignore @@ -1,4 +1,5 @@ Xorg +Xorg.wrap Xorg.sh xorg.conf.example sdksyms.c diff --git a/xorg-server/hw/xfree86/common/compiler.h b/xorg-server/hw/xfree86/common/compiler.h index 3a57186be..fb95f58bf 100644 --- a/xorg-server/hw/xfree86/common/compiler.h +++ b/xorg-server/hw/xfree86/common/compiler.h @@ -103,6 +103,7 @@ #if !defined(__sparc__) && !defined(__sparc) && !defined(__arm32__) && !defined(__nds32__) \ && !(defined(__alpha__) && defined(linux)) \ && !(defined(__ia64__) && defined(linux)) \ + && !(defined(__mips64) && defined(linux)) \ extern _X_EXPORT void outb(unsigned short, unsigned char); extern _X_EXPORT void outw(unsigned short, unsigned short); @@ -721,7 +722,7 @@ xf86WriteMmio32LeNB(__volatile__ void *base, const unsigned long offset, } #elif defined(__mips__) || (defined(__arm32__) && !defined(__linux__)) -#ifdef __arm32__ +#if defined(__arm32__) || defined(__mips64) #define PORT_SIZE long #else #define PORT_SIZE short diff --git a/xorg-server/hw/xfree86/dri/dri.c b/xorg-server/hw/xfree86/dri/dri.c index 60339995d..95828bbac 100644 --- a/xorg-server/hw/xfree86/dri/dri.c +++ b/xorg-server/hw/xfree86/dri/dri.c @@ -177,19 +177,15 @@ DRIOpenDRMMaster(ScrnInfoPtr pScrn, memset(&tmp, 0, sizeof(tmp)); /* Check the DRM lib version. - * drmGetLibVersion was not supported in version 1.0, so check for - * symbol first to avoid possible crash or hang. */ drmlibmajor = 1; drmlibminor = 0; - if (xf86LoaderCheckSymbol("drmGetLibVersion")) { - drmlibv = drmGetLibVersion(-1); - if (drmlibv != NULL) { - drmlibmajor = drmlibv->version_major; - drmlibminor = drmlibv->version_minor; - drmFreeVersion(drmlibv); - } + drmlibv = drmGetLibVersion(-1); + if (drmlibv != NULL) { + drmlibmajor = drmlibv->version_major; + drmlibminor = drmlibv->version_minor; + drmFreeVersion(drmlibv); } /* Check if the libdrm can handle falling back to loading based on name diff --git a/xorg-server/hw/xfree86/dri2/dri2.c b/xorg-server/hw/xfree86/dri2/dri2.c index 729a323da..76708cabc 100644 --- a/xorg-server/hw/xfree86/dri2/dri2.c +++ b/xorg-server/hw/xfree86/dri2/dri2.c @@ -1092,6 +1092,14 @@ DRI2SwapBuffers(ClientPtr client, DrawablePtr pDraw, CARD64 target_msc, return BadDrawable; } + /* According to spec, return expected swapbuffers count SBC after this swap + * will complete. This is ignored unless we return Success, but it must be + * initialized on every path where we return Success or the caller will send + * an uninitialized value off the stack to the client. So let's initialize + * it as early as possible, just to be sure. + */ + *swap_target = pPriv->swap_count + pPriv->swapsPending + 1; + for (i = 0; i < pPriv->bufferCount; i++) { if (pPriv->buffers[i]->attachment == DRI2BufferFrontLeft) pDestBuffer = (DRI2BufferPtr) pPriv->buffers[i]; @@ -1149,17 +1157,13 @@ DRI2SwapBuffers(ClientPtr client, DrawablePtr pDraw, CARD64 target_msc, * we have to account for the current swap count, interval, and the * number of pending swaps. */ - *swap_target = pPriv->last_swap_target + pPriv->swap_interval; + target_msc = pPriv->last_swap_target + pPriv->swap_interval; } - else { - /* glXSwapBuffersMscOML could have a 0 target_msc, honor it */ - *swap_target = target_msc; - } pPriv->swapsPending++; ret = (*ds->ScheduleSwap) (client, pDraw, pDestBuffer, pSrcBuffer, - swap_target, divisor, remainder, func, data); + &target_msc, divisor, remainder, func, data); if (!ret) { pPriv->swapsPending--; /* didn't schedule */ xf86DrvMsg(pScreen->myNum, X_ERROR, @@ -1167,12 +1171,7 @@ DRI2SwapBuffers(ClientPtr client, DrawablePtr pDraw, CARD64 target_msc, return BadDrawable; } - pPriv->last_swap_target = *swap_target; - - /* According to spec, return expected swapbuffers count SBC after this swap - * will complete. - */ - *swap_target = pPriv->swap_count + pPriv->swapsPending; + pPriv->last_swap_target = target_msc; DRI2InvalidateDrawableAll(pDraw); diff --git a/xorg-server/hw/xfree86/man/Makefile.am b/xorg-server/hw/xfree86/man/Makefile.am index f41d26c4e..5da404cbb 100644 --- a/xorg-server/hw/xfree86/man/Makefile.am +++ b/xorg-server/hw/xfree86/man/Makefile.am @@ -5,4 +5,6 @@ fileman_PRE = xorg.conf.man xorg.conf.d.man if SUID_WRAPPER appman_PRE += Xorg.wrap.man fileman_PRE += Xwrapper.config.man +else +EXTRA_DIST += Xorg.wrap.man Xwrapper.config.man endif diff --git a/xorg-server/hw/xfree86/man/Xorg.wrap.man b/xorg-server/hw/xfree86/man/Xorg.wrap.man index f2153e35b..58937c74b 100644 --- a/xorg-server/hw/xfree86/man/Xorg.wrap.man +++ b/xorg-server/hw/xfree86/man/Xorg.wrap.man @@ -1,4 +1,4 @@ -.\" Xwrapper.wrap.1 +.\" Xwrapper.wrap.__appmansuffix__ .\" .\" Copyright 2014 Red Hat, Inc. .\" @@ -26,7 +26,7 @@ .\" .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH Xorg.wrap 1 __xorgversion__ +.TH Xorg.wrap __appmansuffix__ __xorgversion__ .SH NAME Xorg.wrap \- Xorg X server binary wrapper .SH DESCRIPTION diff --git a/xorg-server/hw/xfree86/man/Xwrapper.config.man b/xorg-server/hw/xfree86/man/Xwrapper.config.man index 800947c55..5c777c940 100644 --- a/xorg-server/hw/xfree86/man/Xwrapper.config.man +++ b/xorg-server/hw/xfree86/man/Xwrapper.config.man @@ -1 +1 @@ -.so man1/Xorg.wrap.1 +.so man__appmansuffix__/Xorg.wrap.__appmansuffix__ diff --git a/xorg-server/hw/xfree86/modes/xf86RandR12.c b/xorg-server/hw/xfree86/modes/xf86RandR12.c index 66139dcf0..8a04dfc2c 100644 --- a/xorg-server/hw/xfree86/modes/xf86RandR12.c +++ b/xorg-server/hw/xfree86/modes/xf86RandR12.c @@ -1256,12 +1256,13 @@ xf86RandR12CrtcSetGamma(ScreenPtr pScreen, RRCrtcPtr randr_crtc) CARD16 *tmp_ptr; tmp_ptr = - realloc(crtc->gamma_red, 3 * crtc->gamma_size * sizeof(CARD16)); + realloc(crtc->gamma_red, + 3 * randr_crtc->gammaSize * sizeof(CARD16)); if (!tmp_ptr) return FALSE; crtc->gamma_red = tmp_ptr; - crtc->gamma_green = crtc->gamma_red + crtc->gamma_size; - crtc->gamma_blue = crtc->gamma_green + crtc->gamma_size; + crtc->gamma_green = crtc->gamma_red + randr_crtc->gammaSize; + crtc->gamma_blue = crtc->gamma_green + randr_crtc->gammaSize; } crtc->gamma_size = randr_crtc->gammaSize; diff --git a/xorg-server/hw/xfree86/shadowfb/shadow.c b/xorg-server/hw/xfree86/shadowfb/shadow.c index 43529398a..10f72cc99 100644 --- a/xorg-server/hw/xfree86/shadowfb/shadow.c +++ b/xorg-server/hw/xfree86/shadowfb/shadow.c @@ -1,8 +1,8 @@ /* Copyright (C) 1999. The XFree86 Project Inc. + Copyright 2014 Red Hat, Inc. Written by Mark Vojkovich (mvojkovi@ucsd.edu) - Pre-fb-write callbacks and RENDER support - Nolan Leake (nolan@vmware.com) */ @@ -29,107 +29,23 @@ #include "picturestr.h" static Bool ShadowCloseScreen(ScreenPtr pScreen); -static void ShadowCopyWindow(WindowPtr pWin, - DDXPointRec ptOldOrg, RegionPtr prgn); -static Bool ShadowCreateGC(GCPtr pGC); - -static Bool ShadowEnterVT(ScrnInfoPtr pScrn); -static void ShadowLeaveVT(ScrnInfoPtr pScrn); - -static void ShadowComposite(CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, - INT16 xDst, - INT16 yDst, CARD16 width, CARD16 height); +static Bool ShadowCreateScreenResources(ScreenPtr pScreen); typedef struct { ScrnInfoPtr pScrn; RefreshAreaFuncPtr preRefresh; RefreshAreaFuncPtr postRefresh; CloseScreenProcPtr CloseScreen; - CopyWindowProcPtr CopyWindow; - CreateGCProcPtr CreateGC; - ModifyPixmapHeaderProcPtr ModifyPixmapHeader; - CompositeProcPtr Composite; - Bool (*EnterVT) (ScrnInfoPtr); - void (*LeaveVT) (ScrnInfoPtr); - Bool vtSema; + CreateScreenResourcesProcPtr CreateScreenResources; } ShadowScreenRec, *ShadowScreenPtr; -typedef struct { - const GCOps *ops; - const GCFuncs *funcs; -} ShadowGCRec, *ShadowGCPtr; - static DevPrivateKeyRec ShadowScreenKeyRec; -#define ShadowScreenKey (&ShadowScreenKeyRec) - -static DevPrivateKeyRec ShadowGCKeyRec; - -#define ShadowGCKey (&ShadowGCKeyRec) - -#define GET_SCREEN_PRIVATE(pScreen) \ - (ShadowScreenPtr)dixLookupPrivate(&(pScreen)->devPrivates, ShadowScreenKey) -#define GET_GC_PRIVATE(pGC) \ - (ShadowGCPtr)dixLookupPrivate(&(pGC)->devPrivates, ShadowGCKey) - -#define SHADOW_GC_FUNC_PROLOGUE(pGC)\ - ShadowGCPtr pGCPriv = GET_GC_PRIVATE(pGC);\ - (pGC)->funcs = pGCPriv->funcs;\ - if(pGCPriv->ops)\ - (pGC)->ops = pGCPriv->ops - -#define SHADOW_GC_FUNC_EPILOGUE(pGC)\ - pGCPriv->funcs = (pGC)->funcs;\ - (pGC)->funcs = &ShadowGCFuncs;\ - if(pGCPriv->ops) {\ - pGCPriv->ops = (pGC)->ops;\ - (pGC)->ops = &ShadowGCOps;\ - } - -#define SHADOW_GC_OP_PROLOGUE(pGC)\ - ShadowScreenPtr pPriv = GET_SCREEN_PRIVATE(pGC->pScreen); \ - ShadowGCPtr pGCPriv = GET_GC_PRIVATE(pGC);\ - const GCFuncs *oldFuncs = pGC->funcs;\ - pGC->funcs = pGCPriv->funcs;\ - pGC->ops = pGCPriv->ops - -#define SHADOW_GC_OP_EPILOGUE(pGC)\ - pGCPriv->ops = pGC->ops;\ - pGC->funcs = oldFuncs;\ - pGC->ops = &ShadowGCOps - -#define IS_VISIBLE(pWin) (pPriv->vtSema && \ - (((WindowPtr)pWin)->visibility != VisibilityFullyObscured)) - -#define TRIM_BOX(box, pGC) { \ - BoxPtr extents = &pGC->pCompositeClip->extents;\ - if(box.x1 < extents->x1) box.x1 = extents->x1; \ - if(box.x2 > extents->x2) box.x2 = extents->x2; \ - if(box.y1 < extents->y1) box.y1 = extents->y1; \ - if(box.y2 > extents->y2) box.y2 = extents->y2; \ - } - -#define TRANSLATE_BOX(box, pDraw) { \ - box.x1 += pDraw->x; \ - box.x2 += pDraw->x; \ - box.y1 += pDraw->y; \ - box.y2 += pDraw->y; \ - } - -#define TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC) { \ - TRANSLATE_BOX(box, pDraw); \ - TRIM_BOX(box, pGC); \ - } - -#define BOX_NOT_EMPTY(box) \ - (((box.x2 - box.x1) > 0) && ((box.y2 - box.y1) > 0)) +static ShadowScreenPtr +shadowfbGetScreenPrivate(ScreenPtr pScreen) +{ + return dixLookupPrivate(&(pScreen)->devPrivates, &ShadowScreenKeyRec); +} Bool ShadowFBInit2(ScreenPtr pScreen, @@ -138,7 +54,6 @@ ShadowFBInit2(ScreenPtr pScreen, { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); ShadowScreenPtr pPriv; - PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); if (!preRefreshArea && !postRefreshArea) return FALSE; @@ -146,39 +61,20 @@ ShadowFBInit2(ScreenPtr pScreen, if (!dixRegisterPrivateKey(&ShadowScreenKeyRec, PRIVATE_SCREEN, 0)) return FALSE; - if (!dixRegisterPrivateKey - (&ShadowGCKeyRec, PRIVATE_GC, sizeof(ShadowGCRec))) - return FALSE; - if (!(pPriv = (ShadowScreenPtr) malloc(sizeof(ShadowScreenRec)))) return FALSE; - dixSetPrivate(&pScreen->devPrivates, ShadowScreenKey, pPriv); + dixSetPrivate(&pScreen->devPrivates, &ShadowScreenKeyRec, pPriv); pPriv->pScrn = pScrn; pPriv->preRefresh = preRefreshArea; pPriv->postRefresh = postRefreshArea; - pPriv->vtSema = TRUE; pPriv->CloseScreen = pScreen->CloseScreen; - pPriv->CopyWindow = pScreen->CopyWindow; - pPriv->CreateGC = pScreen->CreateGC; - pPriv->ModifyPixmapHeader = pScreen->ModifyPixmapHeader; - - pPriv->EnterVT = pScrn->EnterVT; - pPriv->LeaveVT = pScrn->LeaveVT; + pPriv->CreateScreenResources = pScreen->CreateScreenResources; pScreen->CloseScreen = ShadowCloseScreen; - pScreen->CopyWindow = ShadowCopyWindow; - pScreen->CreateGC = ShadowCreateGC; - - pScrn->EnterVT = ShadowEnterVT; - pScrn->LeaveVT = ShadowLeaveVT; - - if (ps) { - pPriv->Composite = ps->Composite; - ps->Composite = ShadowComposite; - } + pScreen->CreateScreenResources = ShadowCreateScreenResources; return TRUE; } @@ -189,1451 +85,83 @@ ShadowFBInit(ScreenPtr pScreen, RefreshAreaFuncPtr refreshArea) return ShadowFBInit2(pScreen, NULL, refreshArea); } -/**********************************************************/ - -static Bool -ShadowEnterVT(ScrnInfoPtr pScrn) -{ - Bool ret; - ShadowScreenPtr pPriv = GET_SCREEN_PRIVATE(pScrn->pScreen); - - pScrn->EnterVT = pPriv->EnterVT; - ret = (*pPriv->EnterVT) (pScrn); - pPriv->EnterVT = pScrn->EnterVT; - pScrn->EnterVT = ShadowEnterVT; - if (ret) { - pPriv->vtSema = TRUE; - return TRUE; - } - - return FALSE; -} - -static void -ShadowLeaveVT(ScrnInfoPtr pScrn) -{ - ShadowScreenPtr pPriv = GET_SCREEN_PRIVATE(pScrn->pScreen); - - pPriv->vtSema = FALSE; - - pScrn->LeaveVT = pPriv->LeaveVT; - (*pPriv->LeaveVT) (pScrn); - pPriv->LeaveVT = pScrn->LeaveVT; - pScrn->LeaveVT = ShadowLeaveVT; -} - -/**********************************************************/ - -static Bool -ShadowCloseScreen(ScreenPtr pScreen) -{ - ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); - ShadowScreenPtr pPriv = GET_SCREEN_PRIVATE(pScreen); - PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); - - pScreen->CloseScreen = pPriv->CloseScreen; - pScreen->CopyWindow = pPriv->CopyWindow; - pScreen->CreateGC = pPriv->CreateGC; - pScreen->ModifyPixmapHeader = pPriv->ModifyPixmapHeader; - - pScrn->EnterVT = pPriv->EnterVT; - pScrn->LeaveVT = pPriv->LeaveVT; - - if (ps) { - ps->Composite = pPriv->Composite; - } - - free((void *) pPriv); - - return (*pScreen->CloseScreen) (pScreen); -} +/* + * Note that we don't do DamageEmpty, or indeed look at the region inside the + * DamagePtr at all. This is an optimization, believe it or not. The + * incoming RegionPtr is the new damage, and if we were to empty the region + * miext/damage would just have to waste time reallocating and re-unioning + * it every time, whereas if we leave it around the union gets fast-pathed + * away. + */ static void -ShadowCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgn) +shadowfbReportPre(DamagePtr damage, RegionPtr reg, void *closure) { - ScreenPtr pScreen = pWin->drawable.pScreen; - ShadowScreenPtr pPriv = GET_SCREEN_PRIVATE(pScreen); - int num = 0; - RegionRec rgnDst; - - if (pPriv->vtSema) { - RegionNull(&rgnDst); - RegionCopy(&rgnDst, prgn); - - RegionTranslate(&rgnDst, - pWin->drawable.x - ptOldOrg.x, - pWin->drawable.y - ptOldOrg.y); - RegionIntersect(&rgnDst, &pWin->borderClip, &rgnDst); - if ((num = RegionNumRects(&rgnDst))) { - if (pPriv->preRefresh) - (*pPriv->preRefresh) (pPriv->pScrn, num, RegionRects(&rgnDst)); - } - else { - RegionUninit(&rgnDst); - } - } + ShadowScreenPtr pPriv = closure; - pScreen->CopyWindow = pPriv->CopyWindow; - (*pScreen->CopyWindow) (pWin, ptOldOrg, prgn); - pScreen->CopyWindow = ShadowCopyWindow; + if (!pPriv->pScrn->vtSema) + return; - if (num) { - if (pPriv->postRefresh) - (*pPriv->postRefresh) (pPriv->pScrn, num, RegionRects(&rgnDst)); - RegionUninit(&rgnDst); - } + pPriv->preRefresh(pPriv->pScrn, RegionNumRects(reg), RegionRects(reg)); } static void -ShadowComposite(CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, - INT16 xDst, INT16 yDst, CARD16 width, CARD16 height) +shadowfbReportPost(DamagePtr damage, RegionPtr reg, void *closure) { - ScreenPtr pScreen = pDst->pDrawable->pScreen; - ShadowScreenPtr pPriv = GET_SCREEN_PRIVATE(pScreen); - PictureScreenPtr ps = GetPictureScreen(pScreen); - BoxRec box; - BoxPtr extents; - Bool boxNotEmpty = FALSE; + ShadowScreenPtr pPriv = closure; - if (pPriv->vtSema && pDst->pDrawable->type == DRAWABLE_WINDOW) { + if (!pPriv->pScrn->vtSema) + return; - box.x1 = pDst->pDrawable->x + xDst; - box.y1 = pDst->pDrawable->y + yDst; - box.x2 = box.x1 + width; - box.y2 = box.y1 + height; - - extents = &pDst->pCompositeClip->extents; - if (box.x1 < extents->x1) - box.x1 = extents->x1; - if (box.x2 > extents->x2) - box.x2 = extents->x2; - if (box.y1 < extents->y1) - box.y1 = extents->y1; - if (box.y2 > extents->y2) - box.y2 = extents->y2; - - if (BOX_NOT_EMPTY(box)) { - if (pPriv->preRefresh) - (*pPriv->preRefresh) (pPriv->pScrn, 1, &box); - boxNotEmpty = TRUE; - } - } - - ps->Composite = pPriv->Composite; - (*ps->Composite) (op, pSrc, pMask, pDst, xSrc, ySrc, - xMask, yMask, xDst, yDst, width, height); - ps->Composite = ShadowComposite; - - if (pPriv->postRefresh && boxNotEmpty) { - (*pPriv->postRefresh) (pPriv->pScrn, 1, &box); - } + pPriv->postRefresh(pPriv->pScrn, RegionNumRects(reg), RegionRects(reg)); } -/**********************************************************/ - -static void ShadowValidateGC(GCPtr, unsigned long, DrawablePtr); -static void ShadowChangeGC(GCPtr, unsigned long); -static void ShadowCopyGC(GCPtr, unsigned long, GCPtr); -static void ShadowDestroyGC(GCPtr); -static void ShadowChangeClip(GCPtr, int, void *, int); -static void ShadowDestroyClip(GCPtr); -static void ShadowCopyClip(GCPtr, GCPtr); - -GCFuncs ShadowGCFuncs = { - ShadowValidateGC, ShadowChangeGC, ShadowCopyGC, ShadowDestroyGC, - ShadowChangeClip, ShadowDestroyClip, ShadowCopyClip -}; - -extern GCOps ShadowGCOps; - static Bool -ShadowCreateGC(GCPtr pGC) +ShadowCreateScreenResources(ScreenPtr pScreen) { - ScreenPtr pScreen = pGC->pScreen; - ShadowScreenPtr pPriv = GET_SCREEN_PRIVATE(pScreen); - ShadowGCPtr pGCPriv = GET_GC_PRIVATE(pGC); Bool ret; + WindowPtr pWin = pScreen->root; + ShadowScreenPtr pPriv = shadowfbGetScreenPrivate(pScreen); - pScreen->CreateGC = pPriv->CreateGC; - if ((ret = (*pScreen->CreateGC) (pGC))) { - pGCPriv->ops = NULL; - pGCPriv->funcs = pGC->funcs; - pGC->funcs = &ShadowGCFuncs; - } - pScreen->CreateGC = ShadowCreateGC; - - return ret; -} - -static void -ShadowValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDraw) -{ - SHADOW_GC_FUNC_PROLOGUE(pGC); - (*pGC->funcs->ValidateGC) (pGC, changes, pDraw); - if (pDraw->type == DRAWABLE_WINDOW) - pGCPriv->ops = pGC->ops; /* just so it's not NULL */ - else - pGCPriv->ops = NULL; - SHADOW_GC_FUNC_EPILOGUE(pGC); -} - -static void -ShadowDestroyGC(GCPtr pGC) -{ - SHADOW_GC_FUNC_PROLOGUE(pGC); - (*pGC->funcs->DestroyGC) (pGC); - SHADOW_GC_FUNC_EPILOGUE(pGC); -} - -static void -ShadowChangeGC(GCPtr pGC, unsigned long mask) -{ - SHADOW_GC_FUNC_PROLOGUE(pGC); - (*pGC->funcs->ChangeGC) (pGC, mask); - SHADOW_GC_FUNC_EPILOGUE(pGC); -} + pScreen->CreateScreenResources = pPriv->CreateScreenResources; + ret = pScreen->CreateScreenResources(pScreen); + pPriv->CreateScreenResources = pScreen->CreateScreenResources; + pScreen->CreateScreenResources = ShadowCreateScreenResources; -static void -ShadowCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst) -{ - SHADOW_GC_FUNC_PROLOGUE(pGCDst); - (*pGCDst->funcs->CopyGC) (pGCSrc, mask, pGCDst); - SHADOW_GC_FUNC_EPILOGUE(pGCDst); -} - -static void -ShadowChangeClip(GCPtr pGC, int type, void *pvalue, int nrects) -{ - SHADOW_GC_FUNC_PROLOGUE(pGC); - (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects); - SHADOW_GC_FUNC_EPILOGUE(pGC); -} - -static void -ShadowCopyClip(GCPtr pgcDst, GCPtr pgcSrc) -{ - SHADOW_GC_FUNC_PROLOGUE(pgcDst); - (*pgcDst->funcs->CopyClip) (pgcDst, pgcSrc); - SHADOW_GC_FUNC_EPILOGUE(pgcDst); -} - -static void -ShadowDestroyClip(GCPtr pGC) -{ - SHADOW_GC_FUNC_PROLOGUE(pGC); - (*pGC->funcs->DestroyClip) (pGC); - SHADOW_GC_FUNC_EPILOGUE(pGC); -} - -/**********************************************************/ - -static void -ShadowFillSpans(DrawablePtr pDraw, - GC * pGC, - int nInit, DDXPointPtr pptInit, int *pwidthInit, int fSorted) -{ - SHADOW_GC_OP_PROLOGUE(pGC); - - if (IS_VISIBLE(pDraw) && nInit) { - DDXPointPtr ppt = pptInit; - int *pwidth = pwidthInit; - int i = nInit; - BoxRec box; - Bool boxNotEmpty = FALSE; - - box.x1 = ppt->x; - box.x2 = box.x1 + *pwidth; - box.y2 = box.y1 = ppt->y; - - while (--i) { - ppt++; - pwidth++; - if (box.x1 > ppt->x) - box.x1 = ppt->x; - if (box.x2 < (ppt->x + *pwidth)) - box.x2 = ppt->x + *pwidth; - if (box.y1 > ppt->y) - box.y1 = ppt->y; - else if (box.y2 < ppt->y) - box.y2 = ppt->y; - } - - box.y2++; - - if (!pGC->miTranslate) { - TRANSLATE_BOX(box, pDraw); - } - TRIM_BOX(box, pGC); - - if (BOX_NOT_EMPTY(box)) { - if (pPriv->preRefresh) - (*pPriv->preRefresh) (pPriv->pScrn, 1, &box); - boxNotEmpty = TRUE; - } - - (*pGC->ops->FillSpans) (pDraw, pGC, nInit, pptInit, pwidthInit, - fSorted); - - if (boxNotEmpty && pPriv->postRefresh) - (*pPriv->postRefresh) (pPriv->pScrn, 1, &box); - } - else - (*pGC->ops->FillSpans) (pDraw, pGC, nInit, pptInit, pwidthInit, - fSorted); - - SHADOW_GC_OP_EPILOGUE(pGC); -} - -static void -ShadowSetSpans(DrawablePtr pDraw, - GCPtr pGC, - char *pcharsrc, - DDXPointPtr pptInit, int *pwidthInit, int nspans, int fSorted) -{ - SHADOW_GC_OP_PROLOGUE(pGC); - - if (IS_VISIBLE(pDraw) && nspans) { - DDXPointPtr ppt = pptInit; - int *pwidth = pwidthInit; - int i = nspans; - BoxRec box; - Bool boxNotEmpty = FALSE; - - box.x1 = ppt->x; - box.x2 = box.x1 + *pwidth; - box.y2 = box.y1 = ppt->y; - - while (--i) { - ppt++; - pwidth++; - if (box.x1 > ppt->x) - box.x1 = ppt->x; - if (box.x2 < (ppt->x + *pwidth)) - box.x2 = ppt->x + *pwidth; - if (box.y1 > ppt->y) - box.y1 = ppt->y; - else if (box.y2 < ppt->y) - box.y2 = ppt->y; - } - - box.y2++; - - if (!pGC->miTranslate) { - TRANSLATE_BOX(box, pDraw); - } - TRIM_BOX(box, pGC); - - if (BOX_NOT_EMPTY(box)) { - if (pPriv->preRefresh) - (*pPriv->preRefresh) (pPriv->pScrn, 1, &box); - boxNotEmpty = TRUE; - } - - (*pGC->ops->SetSpans) (pDraw, pGC, pcharsrc, pptInit, - pwidthInit, nspans, fSorted); - - if (boxNotEmpty && pPriv->postRefresh) - (*pPriv->postRefresh) (pPriv->pScrn, 1, &box); - } - else - (*pGC->ops->SetSpans) (pDraw, pGC, pcharsrc, pptInit, - pwidthInit, nspans, fSorted); - - SHADOW_GC_OP_EPILOGUE(pGC); -} - -static void -ShadowPutImage(DrawablePtr pDraw, - GCPtr pGC, - int depth, - int x, int y, int w, int h, - int leftPad, int format, char *pImage) -{ - BoxRec box; - Bool boxNotEmpty = FALSE; - - SHADOW_GC_OP_PROLOGUE(pGC); - - if (IS_VISIBLE(pDraw)) { - box.x1 = x + pDraw->x; - box.x2 = box.x1 + w; - box.y1 = y + pDraw->y; - box.y2 = box.y1 + h; + /* this might look like it leaks, but the damage code reaps listeners + * when their drawable disappears. + */ + if (ret) { + DamagePtr damage; - TRIM_BOX(box, pGC); - if (BOX_NOT_EMPTY(box)) { - if (pPriv->preRefresh) - (*pPriv->preRefresh) (pPriv->pScrn, 1, &box); - boxNotEmpty = TRUE; + if (pPriv->preRefresh) { + damage = DamageCreate(shadowfbReportPre, NULL, + DamageReportRawRegion, + TRUE, pScreen, pPriv); + DamageRegister(&pWin->drawable, damage); } - } - - (*pGC->ops->PutImage) (pDraw, pGC, depth, x, y, w, h, - leftPad, format, pImage); - - if (boxNotEmpty && pPriv->postRefresh) - (*pPriv->postRefresh) (pPriv->pScrn, 1, &box); - - SHADOW_GC_OP_EPILOGUE(pGC); -} - -static RegionPtr -ShadowCopyArea(DrawablePtr pSrc, - DrawablePtr pDst, - GC * pGC, - int srcx, int srcy, int width, int height, int dstx, int dsty) -{ - RegionPtr ret; - BoxRec box; - Bool boxNotEmpty = FALSE; - - SHADOW_GC_OP_PROLOGUE(pGC); - - if (IS_VISIBLE(pDst)) { - box.x1 = dstx + pDst->x; - box.x2 = box.x1 + width; - box.y1 = dsty + pDst->y; - box.y2 = box.y1 + height; - - TRIM_BOX(box, pGC); - if (BOX_NOT_EMPTY(box)) { - if (pPriv->preRefresh) - (*pPriv->preRefresh) (pPriv->pScrn, 1, &box); - boxNotEmpty = TRUE; + if (pPriv->postRefresh) { + damage = DamageCreate(shadowfbReportPost, NULL, + DamageReportRawRegion, + TRUE, pScreen, pPriv); + DamageSetReportAfterOp(damage, TRUE); + DamageRegister(&pWin->drawable, damage); } } - ret = (*pGC->ops->CopyArea) (pSrc, pDst, - pGC, srcx, srcy, width, height, dstx, dsty); - - if (boxNotEmpty && pPriv->postRefresh) - (*pPriv->postRefresh) (pPriv->pScrn, 1, &box); - - SHADOW_GC_OP_EPILOGUE(pGC); - return ret; } -static RegionPtr -ShadowCopyPlane(DrawablePtr pSrc, - DrawablePtr pDst, - GCPtr pGC, - int srcx, int srcy, - int width, int height, - int dstx, int dsty, unsigned long bitPlane) -{ - RegionPtr ret; - BoxRec box; - Bool boxNotEmpty = FALSE; - - SHADOW_GC_OP_PROLOGUE(pGC); - - if (IS_VISIBLE(pDst)) { - box.x1 = dstx + pDst->x; - box.x2 = box.x1 + width; - box.y1 = dsty + pDst->y; - box.y2 = box.y1 + height; - - TRIM_BOX(box, pGC); - if (BOX_NOT_EMPTY(box)) { - if (pPriv->preRefresh) - (*pPriv->preRefresh) (pPriv->pScrn, 1, &box); - boxNotEmpty = TRUE; - } - } - - ret = (*pGC->ops->CopyPlane) (pSrc, pDst, - pGC, srcx, srcy, width, height, dstx, dsty, - bitPlane); - - if (boxNotEmpty && pPriv->postRefresh) - (*pPriv->postRefresh) (pPriv->pScrn, 1, &box); - - SHADOW_GC_OP_EPILOGUE(pGC); - - return ret; -} - -static void -ShadowPolyPoint(DrawablePtr pDraw, - GCPtr pGC, int mode, int nptInit, xPoint * pptInit) -{ - BoxRec box; - Bool boxNotEmpty = FALSE; - - SHADOW_GC_OP_PROLOGUE(pGC); - - if (IS_VISIBLE(pDraw) && nptInit) { - xPoint *ppt = pptInit; - int npt = nptInit; - - box.x2 = box.x1 = pptInit->x; - box.y2 = box.y1 = pptInit->y; - - /* this could be slow if the points were spread out */ - - while (--npt) { - ppt++; - if (box.x1 > ppt->x) - box.x1 = ppt->x; - else if (box.x2 < ppt->x) - box.x2 = ppt->x; - if (box.y1 > ppt->y) - box.y1 = ppt->y; - else if (box.y2 < ppt->y) - box.y2 = ppt->y; - } - - box.x2++; - box.y2++; - - TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC); - if (BOX_NOT_EMPTY(box)) { - if (pPriv->preRefresh) - (*pPriv->preRefresh) (pPriv->pScrn, 1, &box); - boxNotEmpty = TRUE; - } - } - - (*pGC->ops->PolyPoint) (pDraw, pGC, mode, nptInit, pptInit); - - if (boxNotEmpty && pPriv->postRefresh) - (*pPriv->postRefresh) (pPriv->pScrn, 1, &box); - - SHADOW_GC_OP_EPILOGUE(pGC); -} - -static void -ShadowPolylines(DrawablePtr pDraw, - GCPtr pGC, int mode, int nptInit, DDXPointPtr pptInit) -{ - BoxRec box; - Bool boxNotEmpty = FALSE; - - SHADOW_GC_OP_PROLOGUE(pGC); - - if (IS_VISIBLE(pDraw) && nptInit) { - DDXPointPtr ppt = pptInit; - int npt = nptInit; - int extra = pGC->lineWidth >> 1; - - box.x2 = box.x1 = pptInit->x; - box.y2 = box.y1 = pptInit->y; - - if (npt > 1) { - if (pGC->joinStyle == JoinMiter) - extra = 6 * pGC->lineWidth; - else if (pGC->capStyle == CapProjecting) - extra = pGC->lineWidth; - } - - if (mode == CoordModePrevious) { - int x = box.x1; - int y = box.y1; - - while (--npt) { - ppt++; - x += ppt->x; - y += ppt->y; - if (box.x1 > x) - box.x1 = x; - else if (box.x2 < x) - box.x2 = x; - if (box.y1 > y) - box.y1 = y; - else if (box.y2 < y) - box.y2 = y; - } - } - else { - while (--npt) { - ppt++; - if (box.x1 > ppt->x) - box.x1 = ppt->x; - else if (box.x2 < ppt->x) - box.x2 = ppt->x; - if (box.y1 > ppt->y) - box.y1 = ppt->y; - else if (box.y2 < ppt->y) - box.y2 = ppt->y; - } - } - - box.x2++; - box.y2++; - - if (extra) { - box.x1 -= extra; - box.x2 += extra; - box.y1 -= extra; - box.y2 += extra; - } - - TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC); - if (BOX_NOT_EMPTY(box)) { - if (pPriv->preRefresh) - (*pPriv->preRefresh) (pPriv->pScrn, 1, &box); - boxNotEmpty = TRUE; - } - } - - (*pGC->ops->Polylines) (pDraw, pGC, mode, nptInit, pptInit); - - if (boxNotEmpty && pPriv->postRefresh) - (*pPriv->postRefresh) (pPriv->pScrn, 1, &box); - - SHADOW_GC_OP_EPILOGUE(pGC); -} - -static void -ShadowPolySegment(DrawablePtr pDraw, - GCPtr pGC, int nsegInit, xSegment * pSegInit) -{ - BoxRec box; - Bool boxNotEmpty = FALSE; - - SHADOW_GC_OP_PROLOGUE(pGC); - - if (IS_VISIBLE(pDraw) && nsegInit) { - int extra = pGC->lineWidth; - xSegment *pSeg = pSegInit; - int nseg = nsegInit; - - if (pGC->capStyle != CapProjecting) - extra >>= 1; - - if (pSeg->x2 > pSeg->x1) { - box.x1 = pSeg->x1; - box.x2 = pSeg->x2; - } - else { - box.x2 = pSeg->x1; - box.x1 = pSeg->x2; - } - - if (pSeg->y2 > pSeg->y1) { - box.y1 = pSeg->y1; - box.y2 = pSeg->y2; - } - else { - box.y2 = pSeg->y1; - box.y1 = pSeg->y2; - } - - while (--nseg) { - pSeg++; - if (pSeg->x2 > pSeg->x1) { - if (pSeg->x1 < box.x1) - box.x1 = pSeg->x1; - if (pSeg->x2 > box.x2) - box.x2 = pSeg->x2; - } - else { - if (pSeg->x2 < box.x1) - box.x1 = pSeg->x2; - if (pSeg->x1 > box.x2) - box.x2 = pSeg->x1; - } - if (pSeg->y2 > pSeg->y1) { - if (pSeg->y1 < box.y1) - box.y1 = pSeg->y1; - if (pSeg->y2 > box.y2) - box.y2 = pSeg->y2; - } - else { - if (pSeg->y2 < box.y1) - box.y1 = pSeg->y2; - if (pSeg->y1 > box.y2) - box.y2 = pSeg->y1; - } - } - - box.x2++; - box.y2++; - - if (extra) { - box.x1 -= extra; - box.x2 += extra; - box.y1 -= extra; - box.y2 += extra; - } - - TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC); - if (BOX_NOT_EMPTY(box)) { - if (pPriv->preRefresh) - (*pPriv->preRefresh) (pPriv->pScrn, 1, &box); - boxNotEmpty = TRUE; - } - } - - (*pGC->ops->PolySegment) (pDraw, pGC, nsegInit, pSegInit); - - if (boxNotEmpty && pPriv->postRefresh) - (*pPriv->postRefresh) (pPriv->pScrn, 1, &box); - - SHADOW_GC_OP_EPILOGUE(pGC); -} - -static void -ShadowPolyRectangle(DrawablePtr pDraw, - GCPtr pGC, int nRectsInit, xRectangle *pRectsInit) -{ - BoxRec box; - BoxPtr pBoxInit = NULL; - Bool boxNotEmpty = FALSE; - int num = 0; - - SHADOW_GC_OP_PROLOGUE(pGC); - - if (IS_VISIBLE(pDraw) && nRectsInit) { - xRectangle *pRects = pRectsInit; - int nRects = nRectsInit; - - if (nRects >= 32) { - int extra = pGC->lineWidth >> 1; - - box.x1 = pRects->x; - box.x2 = box.x1 + pRects->width; - box.y1 = pRects->y; - box.y2 = box.y1 + pRects->height; - - while (--nRects) { - pRects++; - if (box.x1 > pRects->x) - box.x1 = pRects->x; - if (box.x2 < (pRects->x + pRects->width)) - box.x2 = pRects->x + pRects->width; - if (box.y1 > pRects->y) - box.y1 = pRects->y; - if (box.y2 < (pRects->y + pRects->height)) - box.y2 = pRects->y + pRects->height; - } - - if (extra) { - box.x1 -= extra; - box.x2 += extra; - box.y1 -= extra; - box.y2 += extra; - } - - box.x2++; - box.y2++; - - TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC); - if (BOX_NOT_EMPTY(box)) { - if (pPriv->preRefresh) - (*pPriv->preRefresh) (pPriv->pScrn, 1, &box); - boxNotEmpty = TRUE; - } - } - else { - BoxPtr pbox; - int offset1, offset2, offset3; - - offset2 = pGC->lineWidth; - if (!offset2) - offset2 = 1; - offset1 = offset2 >> 1; - offset3 = offset2 - offset1; - - pBoxInit = (BoxPtr) malloc(nRects * 4 * sizeof(BoxRec)); - pbox = pBoxInit; - - while (nRects--) { - pbox->x1 = pRects->x - offset1; - pbox->y1 = pRects->y - offset1; - pbox->x2 = pbox->x1 + pRects->width + offset2; - pbox->y2 = pbox->y1 + offset2; - TRIM_AND_TRANSLATE_BOX((*pbox), pDraw, pGC); - if (BOX_NOT_EMPTY((*pbox))) { - num++; - pbox++; - } - - pbox->x1 = pRects->x - offset1; - pbox->y1 = pRects->y + offset3; - pbox->x2 = pbox->x1 + offset2; - pbox->y2 = pbox->y1 + pRects->height - offset2; - TRIM_AND_TRANSLATE_BOX((*pbox), pDraw, pGC); - if (BOX_NOT_EMPTY((*pbox))) { - num++; - pbox++; - } - - pbox->x1 = pRects->x + pRects->width - offset1; - pbox->y1 = pRects->y + offset3; - pbox->x2 = pbox->x1 + offset2; - pbox->y2 = pbox->y1 + pRects->height - offset2; - TRIM_AND_TRANSLATE_BOX((*pbox), pDraw, pGC); - if (BOX_NOT_EMPTY((*pbox))) { - num++; - pbox++; - } - - pbox->x1 = pRects->x - offset1; - pbox->y1 = pRects->y + pRects->height - offset1; - pbox->x2 = pbox->x1 + pRects->width + offset2; - pbox->y2 = pbox->y1 + offset2; - TRIM_AND_TRANSLATE_BOX((*pbox), pDraw, pGC); - if (BOX_NOT_EMPTY((*pbox))) { - num++; - pbox++; - } - - pRects++; - } - - if (num) { - if (pPriv->preRefresh) - (*pPriv->preRefresh) (pPriv->pScrn, num, pBoxInit); - } - else { - free(pBoxInit); - } - } - } - - (*pGC->ops->PolyRectangle) (pDraw, pGC, nRectsInit, pRectsInit); - - if (boxNotEmpty && pPriv->postRefresh) { - (*pPriv->postRefresh) (pPriv->pScrn, 1, &box); - } - else if (num) { - if (pPriv->postRefresh) - (*pPriv->postRefresh) (pPriv->pScrn, num, pBoxInit); - free(pBoxInit); - } - - SHADOW_GC_OP_EPILOGUE(pGC); - -} - -static void -ShadowPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcsInit, xArc * parcsInit) -{ - BoxRec box; - Bool boxNotEmpty = FALSE; - - SHADOW_GC_OP_PROLOGUE(pGC); - - if (IS_VISIBLE(pDraw) && narcsInit) { - int narcs = narcsInit; - xArc *parcs = parcsInit; - int extra = pGC->lineWidth >> 1; - - box.x1 = parcs->x; - box.x2 = box.x1 + parcs->width; - box.y1 = parcs->y; - box.y2 = box.y1 + parcs->height; - - /* should I break these up instead ? */ - - while (--narcs) { - parcs++; - if (box.x1 > parcs->x) - box.x1 = parcs->x; - if (box.x2 < (parcs->x + parcs->width)) - box.x2 = parcs->x + parcs->width; - if (box.y1 > parcs->y) - box.y1 = parcs->y; - if (box.y2 < (parcs->y + parcs->height)) - box.y2 = parcs->y + parcs->height; - } - - if (extra) { - box.x1 -= extra; - box.x2 += extra; - box.y1 -= extra; - box.y2 += extra; - } - - box.x2++; - box.y2++; - - TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC); - if (BOX_NOT_EMPTY(box)) { - if (pPriv->preRefresh) - (*pPriv->preRefresh) (pPriv->pScrn, 1, &box); - boxNotEmpty = TRUE; - } - } - - (*pGC->ops->PolyArc) (pDraw, pGC, narcsInit, parcsInit); - - if (boxNotEmpty && pPriv->postRefresh) - (*pPriv->postRefresh) (pPriv->pScrn, 1, &box); - - SHADOW_GC_OP_EPILOGUE(pGC); - -} - -static void -ShadowFillPolygon(DrawablePtr pDraw, - GCPtr pGC, - int shape, int mode, int count, DDXPointPtr pptInit) -{ - SHADOW_GC_OP_PROLOGUE(pGC); - - if (IS_VISIBLE(pDraw) && (count > 2)) { - DDXPointPtr ppt = pptInit; - int i = count; - BoxRec box; - Bool boxNotEmpty = FALSE; - - box.x2 = box.x1 = ppt->x; - box.y2 = box.y1 = ppt->y; - - if (mode != CoordModeOrigin) { - int x = box.x1; - int y = box.y1; - - while (--i) { - ppt++; - x += ppt->x; - y += ppt->y; - if (box.x1 > x) - box.x1 = x; - else if (box.x2 < x) - box.x2 = x; - if (box.y1 > y) - box.y1 = y; - else if (box.y2 < y) - box.y2 = y; - } - } - else { - while (--i) { - ppt++; - if (box.x1 > ppt->x) - box.x1 = ppt->x; - else if (box.x2 < ppt->x) - box.x2 = ppt->x; - if (box.y1 > ppt->y) - box.y1 = ppt->y; - else if (box.y2 < ppt->y) - box.y2 = ppt->y; - } - } - - box.x2++; - box.y2++; - - TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC); - if (BOX_NOT_EMPTY(box)) { - if (pPriv->preRefresh) - (*pPriv->preRefresh) (pPriv->pScrn, 1, &box); - boxNotEmpty = TRUE; - } - - (*pGC->ops->FillPolygon) (pDraw, pGC, shape, mode, count, pptInit); - - if (boxNotEmpty && pPriv->postRefresh) - (*pPriv->postRefresh) (pPriv->pScrn, 1, &box); - } - else - (*pGC->ops->FillPolygon) (pDraw, pGC, shape, mode, count, pptInit); - - SHADOW_GC_OP_EPILOGUE(pGC); -} - -static void -ShadowPolyFillRect(DrawablePtr pDraw, - GCPtr pGC, int nRectsInit, xRectangle *pRectsInit) -{ - SHADOW_GC_OP_PROLOGUE(pGC); - - if (IS_VISIBLE(pDraw) && nRectsInit) { - BoxRec box; - Bool boxNotEmpty = FALSE; - xRectangle *pRects = pRectsInit; - int nRects = nRectsInit; - - box.x1 = pRects->x; - box.x2 = box.x1 + pRects->width; - box.y1 = pRects->y; - box.y2 = box.y1 + pRects->height; - - while (--nRects) { - pRects++; - if (box.x1 > pRects->x) - box.x1 = pRects->x; - if (box.x2 < (pRects->x + pRects->width)) - box.x2 = pRects->x + pRects->width; - if (box.y1 > pRects->y) - box.y1 = pRects->y; - if (box.y2 < (pRects->y + pRects->height)) - box.y2 = pRects->y + pRects->height; - } - - /* cfb messes with the pRectsInit so we have to do our - calculations first */ - - TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC); - if (BOX_NOT_EMPTY(box)) { - if (pPriv->preRefresh) - (*pPriv->preRefresh) (pPriv->pScrn, 1, &box); - boxNotEmpty = TRUE; - } - - (*pGC->ops->PolyFillRect) (pDraw, pGC, nRectsInit, pRectsInit); - - if (boxNotEmpty && pPriv->postRefresh) - (*pPriv->postRefresh) (pPriv->pScrn, 1, &box); - } - else - (*pGC->ops->PolyFillRect) (pDraw, pGC, nRectsInit, pRectsInit); - - SHADOW_GC_OP_EPILOGUE(pGC); -} - -static void -ShadowPolyFillArc(DrawablePtr pDraw, GCPtr pGC, int narcsInit, xArc * parcsInit) -{ - BoxRec box; - Bool boxNotEmpty = FALSE; - - SHADOW_GC_OP_PROLOGUE(pGC); - - if (IS_VISIBLE(pDraw) && narcsInit) { - xArc *parcs = parcsInit; - int narcs = narcsInit; - - box.x1 = parcs->x; - box.x2 = box.x1 + parcs->width; - box.y1 = parcs->y; - box.y2 = box.y1 + parcs->height; - - /* should I break these up instead ? */ - - while (--narcs) { - parcs++; - if (box.x1 > parcs->x) - box.x1 = parcs->x; - if (box.x2 < (parcs->x + parcs->width)) - box.x2 = parcs->x + parcs->width; - if (box.y1 > parcs->y) - box.y1 = parcs->y; - if (box.y2 < (parcs->y + parcs->height)) - box.y2 = parcs->y + parcs->height; - } - - TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC); - if (BOX_NOT_EMPTY(box)) { - if (pPriv->preRefresh) - (*pPriv->preRefresh) (pPriv->pScrn, 1, &box); - boxNotEmpty = TRUE; - } - } - - (*pGC->ops->PolyFillArc) (pDraw, pGC, narcsInit, parcsInit); - - if (boxNotEmpty && pPriv->postRefresh) - (*pPriv->postRefresh) (pPriv->pScrn, 1, &box); - - SHADOW_GC_OP_EPILOGUE(pGC); -} - -static void -ShadowTextExtent(FontPtr pFont, int count, char *chars, - FontEncoding fontEncoding, BoxPtr box) -{ - unsigned long n, i; - int w; - CharInfoPtr charinfo[255]; /* encoding only has 1 byte for count */ - - GetGlyphs(pFont, (unsigned long) count, (unsigned char *) chars, - fontEncoding, &n, charinfo); - w = 0; - for (i = 0; i < n; i++) { - w += charinfo[i]->metrics.characterWidth; - } - if (i) { - w += charinfo[i - 1]->metrics.rightSideBearing; - } - - box->x1 = 0; - if (n) { - if (charinfo[0]->metrics.leftSideBearing < 0) { - box->x1 = charinfo[0]->metrics.leftSideBearing; - } - } - box->x2 = w; - box->y1 = -FONTMAXBOUNDS(pFont, ascent); - box->y2 = FONTMAXBOUNDS(pFont, descent); -} - -static void -ShadowFontToBox(BoxPtr BB, DrawablePtr pDrawable, GCPtr pGC, int x, int y, - int count, char *chars, int wide) -{ - FontPtr pFont; - - pFont = pGC->font; - if (pFont->info.constantWidth) { - int ascent, descent, left, right = 0; - - ascent = max(pFont->info.fontAscent, pFont->info.maxbounds.ascent); - descent = max(pFont->info.fontDescent, pFont->info.maxbounds.descent); - left = pFont->info.maxbounds.leftSideBearing; - if (count > 0) { - right = (count - 1) * pFont->info.maxbounds.characterWidth; - } - right += pFont->info.maxbounds.rightSideBearing; - BB->x1 = - max(pDrawable->x + x - left, - RegionExtents(&((WindowPtr) pDrawable)->winSize)->x1); - BB->y1 = - max(pDrawable->y + y - ascent, - RegionExtents(&((WindowPtr) pDrawable)->winSize)->y1); - BB->x2 = - min(pDrawable->x + x + right, - RegionExtents(&((WindowPtr) pDrawable)->winSize)->x2); - BB->y2 = - min(pDrawable->y + y + descent, - RegionExtents(&((WindowPtr) pDrawable)->winSize)->y2); - } - else { - ShadowTextExtent(pFont, count, chars, wide ? (FONTLASTROW(pFont) == 0) - ? Linear16Bit : TwoD16Bit : Linear8Bit, BB); - BB->x1 = - max(pDrawable->x + x + BB->x1, - RegionExtents(&((WindowPtr) pDrawable)->winSize)->x1); - BB->y1 = - max(pDrawable->y + y + BB->y1, - RegionExtents(&((WindowPtr) pDrawable)->winSize)->y1); - BB->x2 = - min(pDrawable->x + x + BB->x2, - RegionExtents(&((WindowPtr) pDrawable)->winSize)->x2); - BB->y2 = - min(pDrawable->y + y + BB->y2, - RegionExtents(&((WindowPtr) pDrawable)->winSize)->y2); - } -} - -static int -ShadowPolyText8(DrawablePtr pDraw, - GCPtr pGC, int x, int y, int count, char *chars) -{ - int width; - BoxRec box; - Bool boxNotEmpty = FALSE; - - SHADOW_GC_OP_PROLOGUE(pGC); - - if (IS_VISIBLE(pDraw)) { - ShadowFontToBox(&box, pDraw, pGC, x, y, count, chars, 0); - - TRIM_BOX(box, pGC); - if (BOX_NOT_EMPTY(box)) { - if (pPriv->preRefresh) - (*pPriv->preRefresh) (pPriv->pScrn, 1, &box); - boxNotEmpty = TRUE; - } - } - - width = (*pGC->ops->PolyText8) (pDraw, pGC, x, y, count, chars); - - if (boxNotEmpty && pPriv->postRefresh) - (*pPriv->postRefresh) (pPriv->pScrn, 1, &box); - - SHADOW_GC_OP_EPILOGUE(pGC); - - return width; -} - -static int -ShadowPolyText16(DrawablePtr pDraw, - GCPtr pGC, int x, int y, int count, unsigned short *chars) -{ - int width; - BoxRec box; - Bool boxNotEmpty = FALSE; - - SHADOW_GC_OP_PROLOGUE(pGC); - - if (IS_VISIBLE(pDraw)) { - ShadowFontToBox(&box, pDraw, pGC, x, y, count, (char *) chars, 1); - - TRIM_BOX(box, pGC); - if (BOX_NOT_EMPTY(box)) { - if (pPriv->preRefresh) - (*pPriv->preRefresh) (pPriv->pScrn, 1, &box); - boxNotEmpty = TRUE; - } - } - - width = (*pGC->ops->PolyText16) (pDraw, pGC, x, y, count, chars); - - if (boxNotEmpty && pPriv->postRefresh) - (*pPriv->postRefresh) (pPriv->pScrn, 1, &box); - - SHADOW_GC_OP_EPILOGUE(pGC); - - return width; -} - -static void -ShadowImageText8(DrawablePtr pDraw, - GCPtr pGC, int x, int y, int count, char *chars) -{ - BoxRec box; - Bool boxNotEmpty = FALSE; - - SHADOW_GC_OP_PROLOGUE(pGC); - - if (IS_VISIBLE(pDraw) && count) { - int top, bot, Min, Max; - - top = max(FONTMAXBOUNDS(pGC->font, ascent), FONTASCENT(pGC->font)); - bot = max(FONTMAXBOUNDS(pGC->font, descent), FONTDESCENT(pGC->font)); - - Min = count * FONTMINBOUNDS(pGC->font, characterWidth); - if (Min > 0) - Min = 0; - Max = count * FONTMAXBOUNDS(pGC->font, characterWidth); - if (Max < 0) - Max = 0; - - /* ugh */ - box.x1 = pDraw->x + x + Min + FONTMINBOUNDS(pGC->font, leftSideBearing); - box.x2 = pDraw->x + x + Max + - FONTMAXBOUNDS(pGC->font, rightSideBearing); - - box.y1 = pDraw->y + y - top; - box.y2 = pDraw->y + y + bot; - - TRIM_BOX(box, pGC); - if (BOX_NOT_EMPTY(box)) { - if (pPriv->preRefresh) - (*pPriv->preRefresh) (pPriv->pScrn, 1, &box); - boxNotEmpty = TRUE; - } - } - - (*pGC->ops->ImageText8) (pDraw, pGC, x, y, count, chars); - - if (boxNotEmpty && pPriv->postRefresh) - (*pPriv->postRefresh) (pPriv->pScrn, 1, &box); - - SHADOW_GC_OP_EPILOGUE(pGC); -} - -static void -ShadowImageText16(DrawablePtr pDraw, - GCPtr pGC, int x, int y, int count, unsigned short *chars) -{ - BoxRec box; - Bool boxNotEmpty = FALSE; - - SHADOW_GC_OP_PROLOGUE(pGC); - - if (IS_VISIBLE(pDraw) && count) { - int top, bot, Min, Max; - - top = max(FONTMAXBOUNDS(pGC->font, ascent), FONTASCENT(pGC->font)); - bot = max(FONTMAXBOUNDS(pGC->font, descent), FONTDESCENT(pGC->font)); - - Min = count * FONTMINBOUNDS(pGC->font, characterWidth); - if (Min > 0) - Min = 0; - Max = count * FONTMAXBOUNDS(pGC->font, characterWidth); - if (Max < 0) - Max = 0; - - /* ugh */ - box.x1 = pDraw->x + x + Min + FONTMINBOUNDS(pGC->font, leftSideBearing); - box.x2 = pDraw->x + x + Max + - FONTMAXBOUNDS(pGC->font, rightSideBearing); - - box.y1 = pDraw->y + y - top; - box.y2 = pDraw->y + y + bot; - - TRIM_BOX(box, pGC); - if (BOX_NOT_EMPTY(box)) { - if (pPriv->preRefresh) - (*pPriv->preRefresh) (pPriv->pScrn, 1, &box); - boxNotEmpty = TRUE; - } - } - - (*pGC->ops->ImageText16) (pDraw, pGC, x, y, count, chars); - - if (boxNotEmpty && pPriv->postRefresh) - (*pPriv->postRefresh) (pPriv->pScrn, 1, &box); - - SHADOW_GC_OP_EPILOGUE(pGC); -} - -static void -ShadowImageGlyphBlt(DrawablePtr pDraw, - GCPtr pGC, - int x, int y, - unsigned int nglyphInit, - CharInfoPtr * ppciInit, void *pglyphBase) -{ - BoxRec box; - Bool boxNotEmpty = FALSE; - - SHADOW_GC_OP_PROLOGUE(pGC); - - if (IS_VISIBLE(pDraw) && nglyphInit) { - CharInfoPtr *ppci = ppciInit; - unsigned int nglyph = nglyphInit; - int top, bot, width = 0; - - top = max(FONTMAXBOUNDS(pGC->font, ascent), FONTASCENT(pGC->font)); - bot = max(FONTMAXBOUNDS(pGC->font, descent), FONTDESCENT(pGC->font)); - - box.x1 = ppci[0]->metrics.leftSideBearing; - if (box.x1 > 0) - box.x1 = 0; - box.x2 = ppci[nglyph - 1]->metrics.rightSideBearing - - ppci[nglyph - 1]->metrics.characterWidth; - if (box.x2 < 0) - box.x2 = 0; - - box.x2 += pDraw->x + x; - box.x1 += pDraw->x + x; - - while (nglyph--) { - width += (*ppci)->metrics.characterWidth; - ppci++; - } - - if (width > 0) - box.x2 += width; - else - box.x1 += width; - - box.y1 = pDraw->y + y - top; - box.y2 = pDraw->y + y + bot; - - TRIM_BOX(box, pGC); - if (BOX_NOT_EMPTY(box)) { - if (pPriv->preRefresh) - (*pPriv->preRefresh) (pPriv->pScrn, 1, &box); - boxNotEmpty = TRUE; - } - } - - (*pGC->ops->ImageGlyphBlt) (pDraw, pGC, x, y, nglyphInit, - ppciInit, pglyphBase); - - if (boxNotEmpty && pPriv->postRefresh) - (*pPriv->postRefresh) (pPriv->pScrn, 1, &box); - - SHADOW_GC_OP_EPILOGUE(pGC); -} - -static void -ShadowPolyGlyphBlt(DrawablePtr pDraw, - GCPtr pGC, - int x, int y, - unsigned int nglyphInit, - CharInfoPtr * ppciInit, void *pglyphBase) -{ - BoxRec box; - Bool boxNotEmpty = FALSE; - - SHADOW_GC_OP_PROLOGUE(pGC); - - if (IS_VISIBLE(pDraw) && nglyphInit) { - CharInfoPtr *ppci = ppciInit; - unsigned int nglyph = nglyphInit; - - /* ugh */ - box.x1 = pDraw->x + x + ppci[0]->metrics.leftSideBearing; - box.x2 = pDraw->x + x + ppci[nglyph - 1]->metrics.rightSideBearing; - - if (nglyph > 1) { - int width = 0; - - while (--nglyph) { - width += (*ppci)->metrics.characterWidth; - ppci++; - } - - if (width > 0) - box.x2 += width; - else - box.x1 += width; - } - - box.y1 = pDraw->y + y - FONTMAXBOUNDS(pGC->font, ascent); - box.y2 = pDraw->y + y + FONTMAXBOUNDS(pGC->font, descent); - - TRIM_BOX(box, pGC); - if (BOX_NOT_EMPTY(box)) { - if (pPriv->preRefresh) - (*pPriv->preRefresh) (pPriv->pScrn, 1, &box); - boxNotEmpty = TRUE; - } - } - - (*pGC->ops->PolyGlyphBlt) (pDraw, pGC, x, y, nglyphInit, - ppciInit, pglyphBase); - - if (boxNotEmpty && pPriv->postRefresh) - (*pPriv->postRefresh) (pPriv->pScrn, 1, &box); - - SHADOW_GC_OP_EPILOGUE(pGC); -} - -static void -ShadowPushPixels(GCPtr pGC, - PixmapPtr pBitMap, - DrawablePtr pDraw, int dx, int dy, int xOrg, int yOrg) +static Bool +ShadowCloseScreen(ScreenPtr pScreen) { - BoxRec box; - Bool boxNotEmpty = FALSE; - - SHADOW_GC_OP_PROLOGUE(pGC); - - if (IS_VISIBLE(pDraw)) { - box.x1 = xOrg; - box.y1 = yOrg; - - if (!pGC->miTranslate) { - box.x1 += pDraw->x; - box.y1 += pDraw->y; - } + ShadowScreenPtr pPriv = shadowfbGetScreenPrivate(pScreen); - box.x2 = box.x1 + dx; - box.y2 = box.y1 + dy; - - TRIM_BOX(box, pGC); - if (BOX_NOT_EMPTY(box)) { - if (pPriv->preRefresh) - (*pPriv->preRefresh) (pPriv->pScrn, 1, &box); - boxNotEmpty = TRUE; - } - } - - (*pGC->ops->PushPixels) (pGC, pBitMap, pDraw, dx, dy, xOrg, yOrg); + pScreen->CloseScreen = pPriv->CloseScreen; + pScreen->CreateScreenResources = pPriv->CreateScreenResources; - if (boxNotEmpty && pPriv->postRefresh) - (*pPriv->postRefresh) (pPriv->pScrn, 1, &box); + free(pPriv); - SHADOW_GC_OP_EPILOGUE(pGC); + return (*pScreen->CloseScreen) (pScreen); } - -GCOps ShadowGCOps = { - ShadowFillSpans, ShadowSetSpans, - ShadowPutImage, ShadowCopyArea, - ShadowCopyPlane, ShadowPolyPoint, - ShadowPolylines, ShadowPolySegment, - ShadowPolyRectangle, ShadowPolyArc, - ShadowFillPolygon, ShadowPolyFillRect, - ShadowPolyFillArc, ShadowPolyText8, - ShadowPolyText16, ShadowImageText8, - ShadowImageText16, ShadowImageGlyphBlt, - ShadowPolyGlyphBlt, ShadowPushPixels, -}; diff --git a/xorg-server/hw/xfree86/xorg-wrapper.c b/xorg-server/hw/xfree86/xorg-wrapper.c index 90c8c11ef..4ea47331b 100644 --- a/xorg-server/hw/xfree86/xorg-wrapper.c +++ b/xorg-server/hw/xfree86/xorg-wrapper.c @@ -25,6 +25,7 @@ #include "dix-config.h" +#include #include #include #include @@ -34,12 +35,17 @@ #include #include #include +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) +#include +#endif #include -#include +#include #include /* For DRM_DEV_NAME */ #define CONFIG_FILE SYSCONFDIR "/X11/Xwrapper.config" +static const char *progname; + enum { ROOT_ONLY, CONSOLE_ONLY, ANYBODY }; /* KISS non locale / LANG parsing isspace version */ @@ -88,18 +94,21 @@ static void parse_config(int *allowed, int *needs_root_rights) /* Split in a key + value pair */ equals = strchr(stripped, '='); if (!equals) { - fprintf(stderr, "Syntax error at %s line %d\n", CONFIG_FILE, line); + fprintf(stderr, "%s: Syntax error at %s line %d\n", progname, + CONFIG_FILE, line); exit(1); } *equals = 0; key = strip(stripped); /* To remove trailing whitespace from key */ value = strip(equals + 1); /* To remove leading whitespace from val */ if (!key[0]) { - fprintf(stderr, "Missing key at %s line %d\n", CONFIG_FILE, line); + fprintf(stderr, "%s: Missing key at %s line %d\n", progname, + CONFIG_FILE, line); exit(1); } if (!value[0]) { - fprintf(stderr, "Missing value at %s line %d\n", CONFIG_FILE, line); + fprintf(stderr, "%s: Missing value at %s line %d\n", progname, + CONFIG_FILE, line); exit(1); } @@ -113,8 +122,8 @@ static void parse_config(int *allowed, int *needs_root_rights) *allowed = ANYBODY; else { fprintf(stderr, - "Invalid value '%s' for 'allowed_users' at %s line %d\n", - value, CONFIG_FILE, line); + "%s: Invalid value '%s' for 'allowed_users' at %s line %d\n", + progname, value, CONFIG_FILE, line); exit(1); } } @@ -127,8 +136,8 @@ static void parse_config(int *allowed, int *needs_root_rights) *needs_root_rights = -1; else { fprintf(stderr, - "Invalid value '%s' for 'needs_root_rights' at %s line %d\n", - value, CONFIG_FILE, line); + "%s: Invalid value '%s' for 'needs_root_rights' at %s line %d\n", + progname, value, CONFIG_FILE, line); exit(1); } } @@ -136,18 +145,45 @@ static void parse_config(int *allowed, int *needs_root_rights) /* Backward compatibility with older Debian Xwrapper, ignore */ } else { - fprintf(stderr, "Invalid key '%s' at %s line %d\n", key, - CONFIG_FILE, line); + fprintf(stderr, "%s: Invalid key '%s' at %s line %d\n", key, + progname, CONFIG_FILE, line); exit(1); } } fclose(f); } +static int on_console(int fd) +{ +#if defined(__linux__) + struct stat st; + int r; + + r = fstat(fd, &st); + if (r == 0 && S_ISCHR(st.st_mode) && major(st.st_rdev) == 4) + return 1; +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) + int idx; + + if (ioctl(fd, VT_GETINDEX, &idx) != -1) + return 1; +#else +#warning This program needs porting to your kernel. + static int seen; + + if (!seen) { + fprintf(stderr, "%s: Unable to determine if running on a console\n", + progname); + seen = 1; + } +#endif + + return 0; +} + int main(int argc, char *argv[]) { struct drm_mode_card_res res; - struct stat st; char buf[PATH_MAX]; int i, r, fd; int kms_cards = 0; @@ -155,6 +191,8 @@ int main(int argc, char *argv[]) int allowed = CONSOLE_ONLY; int needs_root_rights = -1; + progname = argv[0]; + parse_config(&allowed, &needs_root_rights); /* For non root users check if they are allowed to run the X server */ @@ -168,8 +206,7 @@ int main(int argc, char *argv[]) case CONSOLE_ONLY: /* Some of stdin / stdout / stderr maybe redirected to a file */ for (i = STDIN_FILENO; i <= STDERR_FILENO; i++) { - r = fstat(i, &st); - if (r == 0 && S_ISCHR(st.st_mode) && major(st.st_rdev) == 4) + if (on_console(i)) break; } if (i > STDERR_FILENO) { @@ -207,11 +244,13 @@ int main(int argc, char *argv[]) uid_t realuid = getuid(); if (setresgid(-1, realgid, realgid) != 0) { - perror("Could not drop setgid privileges"); + fprintf(stderr, "%s: Could not drop setgid privileges: %s\n", + progname, strerror(errno)); exit(1); } if (setresuid(-1, realuid, realuid) != 0) { - perror("Could not drop setuid privileges"); + fprintf(stderr, "%s: Could not drop setuid privileges: %s\n", + progname, strerror(errno)); exit(1); } } @@ -220,12 +259,14 @@ int main(int argc, char *argv[]) /* Check if the server is executable by our real uid */ if (access(buf, X_OK) != 0) { - perror("Missing execute permissions for " SUID_WRAPPER_DIR "Xorg.bin"); + fprintf(stderr, "%s: Missing execute permissions for %s/Xorg.bin: %s\n", + progname, SUID_WRAPPER_DIR, strerror(errno)); exit(1); } argv[0] = buf; (void) execv(argv[0], argv); - perror("Failed to execute " SUID_WRAPPER_DIR "/Xorg.bin"); + fprintf(stderr, "%s: Failed to execute %s/Xorg.bin: %s\n", + progname, SUID_WRAPPER_DIR, strerror(errno)); exit(1); } diff --git a/xorg-server/hw/xwayland/xwayland.c b/xorg-server/hw/xwayland/xwayland.c index c2c6481af..b966e5070 100644 --- a/xorg-server/hw/xwayland/xwayland.c +++ b/xorg-server/hw/xwayland/xwayland.c @@ -218,7 +218,6 @@ xwl_realize_window(WindowPtr window) screen->RealizeWindow = xwl_realize_window; if (xwl_screen->rootless && !window->parent) { - ErrorF("Clearing root clip\n"); RegionNull(&window->clipList); RegionNull(&window->borderClip); RegionNull(&window->winSize); @@ -573,8 +572,10 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) fbPictureInit(pScreen, 0, 0); +#ifdef HAVE_XSHMFENCE if (!miSyncShmScreenInit(pScreen)) return FALSE; +#endif xwl_screen->wayland_fd = wl_display_get_fd(xwl_screen->display); AddGeneralSocket(xwl_screen->wayland_fd); @@ -616,8 +617,10 @@ xwl_log_handler(const char *format, va_list args) FatalError("%s", msg); } -static const ExtensionModule glx_extension[] = { +static const ExtensionModule xwayland_extensions[] = { +#ifdef GLXEXT { GlxExtensionInit, "GLX", &noGlxExtension }, +#endif }; void @@ -639,7 +642,8 @@ InitOutput(ScreenInfo * screen_info, int argc, char **argv) screen_info->bitmapBitOrder = BITMAP_BIT_ORDER; screen_info->numPixmapFormats = ARRAY_SIZE(depths); - LoadExtensionList(glx_extension, ARRAY_SIZE(glx_extension), FALSE); + LoadExtensionList(xwayland_extensions, + ARRAY_SIZE(xwayland_extensions), FALSE); /* Cast away warning from missing printf annotation for * wl_log_func_t. Wayland 1.5 will have the annotation, so we can diff --git a/xorg-server/include/dix.h b/xorg-server/include/dix.h index 8371df072..f42e23655 100644 --- a/xorg-server/include/dix.h +++ b/xorg-server/include/dix.h @@ -608,4 +608,6 @@ CorePointerProc(DeviceIntPtr dev, int what); extern _X_HIDDEN int CoreKeyboardProc(DeviceIntPtr dev, int what); +extern _X_EXPORT void *lastGLContext; + #endif /* DIX_H */ diff --git a/xorg-server/include/opaque.h b/xorg-server/include/opaque.h index 6b8071c5b..a2c54aa6a 100644 --- a/xorg-server/include/opaque.h +++ b/xorg-server/include/opaque.h @@ -56,6 +56,7 @@ extern _X_EXPORT Bool explicit_display; extern _X_EXPORT int defaultBackingStore; extern _X_EXPORT Bool disableBackingStore; extern _X_EXPORT Bool enableBackingStore; +extern _X_EXPORT Bool enableIndirectGLX; extern _X_EXPORT Bool PartialNetwork; extern _X_EXPORT Bool RunFromSigStopParent; diff --git a/xorg-server/os/busfault.c b/xorg-server/os/busfault.c index 43bb6ea8a..ac0268fd5 100644 --- a/xorg-server/os/busfault.c +++ b/xorg-server/os/busfault.c @@ -142,6 +142,7 @@ busfault_init(void) act.sa_sigaction = busfault_sigaction; act.sa_flags = SA_SIGINFO; + sigemptyset(&act.sa_mask); if (sigaction(SIGBUS, &act, &old_act) < 0) return FALSE; previous_busfault_sigaction = old_act.sa_sigaction; diff --git a/xorg-server/os/connection.c b/xorg-server/os/connection.c index e914d9d94..40d9ff39b 100644 --- a/xorg-server/os/connection.c +++ b/xorg-server/os/connection.c @@ -353,9 +353,12 @@ NotifyParentProcess(void) { #if !defined(WIN32) if (displayfd >= 0) { - write(displayfd, display, strlen(display)); - write(displayfd, "\n", 1); + if (write(displayfd, display, strlen(display)) != strlen(display)) + FatalError("Cannot write display number to fd %d\n", displayfd); + if (write(displayfd, "\n", 1) != 1) + FatalError("Cannot write display number to fd %d\n", displayfd); close(displayfd); + displayfd = -1; } if (RunFromSmartParent) { if (ParentProcess > 1) { diff --git a/xorg-server/os/log.c b/xorg-server/os/log.c index 38193eed6..a0f2a81f3 100644 --- a/xorg-server/os/log.c +++ b/xorg-server/os/log.c @@ -491,13 +491,14 @@ static void LogSWrite(int verb, const char *buf, size_t len, Bool end_line) { static Bool newline = TRUE; + int ret; if (verb < 0 || logVerbosity >= verb) - write(2, buf, len); + ret = write(2, buf, len); if (verb < 0 || logFileVerbosity >= verb) { if (inSignalContext && logFileFd >= 0) { - write(logFileFd, buf, len); + ret = write(logFileFd, buf, len); #ifndef WIN32 if (logFlush && logSync) fsync(logFileFd); @@ -529,6 +530,11 @@ LogSWrite(int verb, const char *buf, size_t len, Bool end_line) bufferPos += len; } } + + /* There's no place to log an error message if the log write + * fails... + */ + (void) ret; } void diff --git a/xorg-server/os/utils.c b/xorg-server/os/utils.c index 6e6974e89..bc5e7df4d 100644 --- a/xorg-server/os/utils.c +++ b/xorg-server/os/utils.c @@ -194,6 +194,8 @@ Bool noGEExtension = FALSE; Bool CoreDump; +Bool enableIndirectGLX = TRUE; + #ifdef PANORAMIX Bool PanoramiXExtensionDisabledHack = FALSE; #endif @@ -313,7 +315,8 @@ LockServer(void) if (lfd < 0) FatalError("Could not create lock file in %s\n", tmp); snprintf(pid_str, sizeof(pid_str), "%10ld\n", (long) getpid()); - (void) write(lfd, pid_str, 11); + if (write(lfd, pid_str, 11) != 11) + FatalError("Could not write pid to lock file in %s\n", tmp); (void) fchmod(lfd, 0444); (void) close(lfd); @@ -537,6 +540,8 @@ UseMsg(void) ErrorF("-fn string default font name\n"); ErrorF("-fp string default font path\n"); ErrorF("-help prints message with these options\n"); + ErrorF("+iglx Allow creating indirect GLX contexts (default)\n"); + ErrorF("-iglx Prohibit creating indirect GLX contexts\n"); ErrorF("-I ignore all remaining arguments\n"); #ifdef RLIMIT_DATA ErrorF("-ld int limit data space to N Kb\n"); @@ -783,6 +788,10 @@ ProcessCommandLine(int argc, char *argv[]) UseMsg(); exit(0); } + else if (strcmp(argv[i], "+iglx") == 0) + enableIndirectGLX = TRUE; + else if (strcmp(argv[i], "-iglx") == 0) + enableIndirectGLX = FALSE; else if ((skip = XkbProcessArguments(argc, argv, i)) != 0) { if (skip > 0) i += skip - 1; diff --git a/xorg-server/randr/randr.c b/xorg-server/randr/randr.c index 3c97714d8..6e3f14b4e 100644 --- a/xorg-server/randr/randr.c +++ b/xorg-server/randr/randr.c @@ -679,7 +679,7 @@ static int SProcRRDispatch(ClientPtr client) { REQUEST(xReq); - if (stuff->data >= RRNumberRequests || !ProcRandrVector[stuff->data]) + if (stuff->data >= RRNumberRequests || !SProcRandrVector[stuff->data]) return BadRequest; return (*SProcRandrVector[stuff->data]) (client); } diff --git a/xorg-server/randr/rrprovider.c b/xorg-server/randr/rrprovider.c index 3ce7d75b0..4507ba894 100644 --- a/xorg-server/randr/rrprovider.c +++ b/xorg-server/randr/rrprovider.c @@ -285,7 +285,7 @@ ProcRRSetProviderOutputSource(ClientPtr client) RRProviderPtr provider, source_provider = NULL; ScreenPtr pScreen; - REQUEST_AT_LEAST_SIZE(xRRSetProviderOutputSourceReq); + REQUEST_SIZE_MATCH(xRRSetProviderOutputSourceReq); VERIFY_RR_PROVIDER(stuff->provider, provider, DixReadAccess); @@ -320,7 +320,7 @@ ProcRRSetProviderOffloadSink(ClientPtr client) RRProviderPtr provider, sink_provider = NULL; ScreenPtr pScreen; - REQUEST_AT_LEAST_SIZE(xRRSetProviderOffloadSinkReq); + REQUEST_SIZE_MATCH(xRRSetProviderOffloadSinkReq); VERIFY_RR_PROVIDER(stuff->provider, provider, DixReadAccess); if (!(provider->capabilities & RR_Capability_SourceOffload)) diff --git a/xorg-server/randr/rrsdispatch.c b/xorg-server/randr/rrsdispatch.c index 9968c7f81..08c3b6abe 100644 --- a/xorg-server/randr/rrsdispatch.c +++ b/xorg-server/randr/rrsdispatch.c @@ -434,6 +434,133 @@ SProcRRGetOutputPrimary(ClientPtr client) return ProcRandrVector[stuff->randrReqType] (client); } +static int SProcRRGetProviders(ClientPtr client) +{ + REQUEST(xRRGetProvidersReq); + + REQUEST_SIZE_MATCH(xRRGetProvidersReq); + swaps(&stuff->length); + swapl(&stuff->window); + return ProcRandrVector[stuff->randrReqType] (client); +} + +static int SProcRRGetProviderInfo(ClientPtr client) +{ + REQUEST(xRRGetProviderInfoReq); + + REQUEST_SIZE_MATCH(xRRGetProviderInfoReq); + swaps(&stuff->length); + swapl(&stuff->provider); + swapl(&stuff->configTimestamp); + return ProcRandrVector[stuff->randrReqType] (client); +} + +static int SProcRRSetProviderOffloadSink(ClientPtr client) +{ + REQUEST(xRRSetProviderOffloadSinkReq); + + REQUEST_SIZE_MATCH(xRRSetProviderOffloadSinkReq); + swaps(&stuff->length); + swapl(&stuff->provider); + swapl(&stuff->sink_provider); + swapl(&stuff->configTimestamp); + return ProcRandrVector[stuff->randrReqType] (client); +} + +static int SProcRRSetProviderOutputSource(ClientPtr client) +{ + REQUEST(xRRSetProviderOutputSourceReq); + + REQUEST_SIZE_MATCH(xRRSetProviderOutputSourceReq); + swaps(&stuff->length); + swapl(&stuff->provider); + swapl(&stuff->source_provider); + swapl(&stuff->configTimestamp); + return ProcRandrVector[stuff->randrReqType] (client); +} + +static int SProcRRListProviderProperties(ClientPtr client) +{ + REQUEST(xRRListProviderPropertiesReq); + + REQUEST_SIZE_MATCH(xRRListProviderPropertiesReq); + swaps(&stuff->length); + swapl(&stuff->provider); + return ProcRandrVector[stuff->randrReqType] (client); +} + +static int SProcRRQueryProviderProperty(ClientPtr client) +{ + REQUEST(xRRQueryProviderPropertyReq); + + REQUEST_SIZE_MATCH(xRRQueryProviderPropertyReq); + swaps(&stuff->length); + swapl(&stuff->provider); + swapl(&stuff->property); + return ProcRandrVector[stuff->randrReqType] (client); +} + +static int SProcRRConfigureProviderProperty(ClientPtr client) +{ + REQUEST(xRRConfigureProviderPropertyReq); + + REQUEST_AT_LEAST_SIZE(xRRConfigureProviderPropertyReq); + swaps(&stuff->length); + swapl(&stuff->provider); + swapl(&stuff->property); + /* TODO: no way to specify format? */ + SwapRestL(stuff); + return ProcRandrVector[stuff->randrReqType] (client); +} + +static int SProcRRChangeProviderProperty(ClientPtr client) +{ + REQUEST(xRRChangeProviderPropertyReq); + + REQUEST_AT_LEAST_SIZE(xRRChangeProviderPropertyReq); + swaps(&stuff->length); + swapl(&stuff->provider); + swapl(&stuff->property); + swapl(&stuff->type); + swapl(&stuff->nUnits); + switch (stuff->format) { + case 8: + break; + case 16: + SwapRestS(stuff); + break; + case 32: + SwapRestL(stuff); + break; + } + return ProcRandrVector[stuff->randrReqType] (client); +} + +static int SProcRRDeleteProviderProperty(ClientPtr client) +{ + REQUEST(xRRDeleteProviderPropertyReq); + + REQUEST_SIZE_MATCH(xRRDeleteProviderPropertyReq); + swaps(&stuff->length); + swapl(&stuff->provider); + swapl(&stuff->property); + return ProcRandrVector[stuff->randrReqType] (client); +} + +static int SProcRRGetProviderProperty(ClientPtr client) +{ + REQUEST(xRRGetProviderPropertyReq); + + REQUEST_SIZE_MATCH(xRRGetProviderPropertyReq); + swaps(&stuff->length); + swapl(&stuff->provider); + swapl(&stuff->property); + swapl(&stuff->type); + swapl(&stuff->longOffset); + swapl(&stuff->longLength); + return ProcRandrVector[stuff->randrReqType] (client); +} + int (*SProcRandrVector[RRNumberRequests]) (ClientPtr) = { SProcRRQueryVersion, /* 0 */ /* we skip 1 to make old clients fail pretty immediately */ @@ -472,4 +599,15 @@ int (*SProcRandrVector[RRNumberRequests]) (ClientPtr) = { SProcRRSetPanning, /* 29 */ SProcRRSetOutputPrimary, /* 30 */ SProcRRGetOutputPrimary, /* 31 */ +/* V1.4 additions */ + SProcRRGetProviders, /* 32 */ + SProcRRGetProviderInfo, /* 33 */ + SProcRRSetProviderOffloadSink, /* 34 */ + SProcRRSetProviderOutputSource, /* 35 */ + SProcRRListProviderProperties, /* 36 */ + SProcRRQueryProviderProperty, /* 37 */ + SProcRRConfigureProviderProperty, /* 38 */ + SProcRRChangeProviderProperty, /* 39 */ + SProcRRDeleteProviderProperty, /* 40 */ + SProcRRGetProviderProperty, /* 41 */ }; diff --git a/xorg-server/render/render.c b/xorg-server/render/render.c index 3b7151a69..9ac4a98e7 100644 --- a/xorg-server/render/render.c +++ b/xorg-server/render/render.c @@ -638,7 +638,7 @@ ProcRenderSetPictureClipRectangles(ClientPtr client) REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq); VERIFY_PICTURE(pPicture, stuff->picture, client, DixSetAttrAccess); if (!pPicture->pDrawable) - return BadDrawable; + return RenderErrBase + BadPicture; nr = (client->req_len << 2) - sizeof(xRenderSetPictureClipRectanglesReq); if (nr & 4) diff --git a/xorg-server/test/.gitignore b/xorg-server/test/.gitignore index acbda7a57..a62fc3d70 100644 --- a/xorg-server/test/.gitignore +++ b/xorg-server/test/.gitignore @@ -4,9 +4,12 @@ input list misc os +sdksyms.c string touch xfree86 xkb xtest signal-logging +*.log +*.trs diff --git a/xorg-server/test/Makefile.am b/xorg-server/test/Makefile.am index 3ad24d9ec..32edc7a3b 100644 --- a/xorg-server/test/Makefile.am +++ b/xorg-server/test/Makefile.am @@ -41,7 +41,7 @@ os_LDADD=$(TEST_LDADD) libxservertest_la_LIBADD = $(XSERVER_LIBS) if XORG -nodist_libxservertest_la_SOURCES = $(top_builddir)/hw/xfree86/sdksyms.c +nodist_libxservertest_la_SOURCES = sdksyms.c libxservertest_la_LIBADD += \ $(top_builddir)/hw/xfree86/loader/libloader.la \ $(top_builddir)/hw/xfree86/os-support/libxorgos.la \ @@ -55,6 +55,12 @@ libxservertest_la_LIBADD += \ $(top_builddir)/hw/xfree86/dixmods/libxorgxkb.la \ @XORG_LIBS@ +BUILT_SOURCES = sdksyms.c +CLEANFILES = sdksyms.c + +sdksyms.c: $(top_builddir)/hw/xfree86/sdksyms.c + $(AM_V_GEN)$(LN_S) $(top_builddir)/hw/xfree86/sdksyms.c + if DRI libxservertest_la_LIBADD += $(top_builddir)/hw/xfree86/dri/libdri.la endif diff --git a/xorg-server/test/signal-logging.c b/xorg-server/test/signal-logging.c index 88b37c14e..432012195 100644 --- a/xorg-server/test/signal-logging.c +++ b/xorg-server/test/signal-logging.c @@ -178,9 +178,14 @@ static void logging_format(void) LogInit(log_file_path, NULL); assert(f = fopen(log_file_path, "r")); -#define read_log_msg(msg) \ - fgets(read_buf, sizeof(read_buf), f); \ - msg = strchr(read_buf, ']') + 2; /* advance past [time.stamp] */ +#define read_log_msg(msg) do { \ + msg = fgets(read_buf, sizeof(read_buf), f); \ + assert(msg != NULL); \ + msg = strchr(read_buf, ']'); \ + assert(msg != NULL); \ + assert(strlen(msg) > 2); \ + msg = msg + 2; /* advance past [time.stamp] */ \ + } while (0) /* boring test message */ LogMessageVerbSigSafe(X_ERROR, -1, "test message\n"); diff --git a/xorg-server/xfixes/region.c b/xorg-server/xfixes/region.c index cc8f1a5ef..f9de52542 100644 --- a/xorg-server/xfixes/region.c +++ b/xorg-server/xfixes/region.c @@ -269,6 +269,9 @@ ProcXFixesCreateRegionFromPicture(ClientPtr client) VERIFY_PICTURE(pPicture, stuff->picture, client, DixGetAttrAccess); + if (!pPicture->pDrawable) + return RenderErrBase + BadPicture; + switch (pPicture->clientClipType) { case CT_PIXMAP: pRegion = BitmapToRegion(pPicture->pDrawable->pScreen, @@ -750,6 +753,9 @@ ProcXFixesSetPictureClipRegion(ClientPtr client) VERIFY_PICTURE(pPicture, stuff->picture, client, DixSetAttrAccess); VERIFY_REGION_OR_NONE(pRegion, stuff->region, client, DixReadAccess); + if (!pPicture->pDrawable) + return RenderErrBase + BadPicture; + return SetPictureClipRegion(pPicture, stuff->xOrigin, stuff->yOrigin, pRegion); } diff --git a/xorg-server/xkb/xkmread.c b/xorg-server/xkb/xkmread.c index 258bb91b5..b6241b5c7 100644 --- a/xorg-server/xkb/xkmread.c +++ b/xorg-server/xkb/xkmread.c @@ -1204,7 +1204,8 @@ XkmReadTOC(FILE * file, xkmFileInfo * file_info, int max_toc, } return 0; } - fread(file_info, SIZEOF(xkmFileInfo), 1, file); + if (fread(file_info, SIZEOF(xkmFileInfo), 1, file) != 1) + return 0; size_toc = file_info->num_toc; if (size_toc > max_toc) { DebugF("Warning! Too many TOC entries; last %d ignored\n", @@ -1212,7 +1213,8 @@ XkmReadTOC(FILE * file, xkmFileInfo * file_info, int max_toc, size_toc = max_toc; } for (i = 0; i < size_toc; i++) { - fread(&toc[i], SIZEOF(xkmSectionInfo), 1, file); + if (fread(&toc[i], SIZEOF(xkmSectionInfo), 1, file) != 1) + return 0; } return 1; } diff --git a/xorg-server/xkeyboard-config/rules/base.xml.in b/xorg-server/xkeyboard-config/rules/base.xml.in index c924edf6d..59b03c338 100644 --- a/xorg-server/xkeyboard-config/rules/base.xml.in +++ b/xorg-server/xkeyboard-config/rules/base.xml.in @@ -3905,7 +3905,7 @@ cyrillicyz - <_description>Montenegrin (Cyrillic, Z and ZHE swapped) + <_description>Montenegrin (Cyrillic, ZE and ZHE swapped) diff --git a/xorg-server/xkeyboard-config/symbols/fi b/xorg-server/xkeyboard-config/symbols/fi index 1818243dd..1bf9ff074 100644 --- a/xorg-server/xkeyboard-config/symbols/fi +++ b/xorg-server/xkeyboard-config/symbols/fi @@ -101,8 +101,7 @@ xkb_symbols "classic" { partial alphanumeric_keys hidden xkb_symbols "fi" { - // Classic Finnish keyboard layout with dead keys support - // and all ISO-8859-1 and ISO-8859-15 characters available + // Classic Finnish keyboard layout with dead keys key { [ section, onehalf, onequarter, threequarters ] }; key { [ 1, exclam, exclamdown, onesuperior ] }; @@ -112,8 +111,8 @@ xkb_symbols "fi" { key { [ 5, percent, EuroSign, masculine ] }; key { [ 6, ampersand, yen, ordfeminine ] }; key { [ 7, slash, braceleft, plusminus ] }; - key { [ 8, parenleft, bracketleft, guillemotleft ] }; - key { [ 9, parenright, bracketright, guillemotright ] }; + key { [ 8, parenleft, bracketleft, less ] }; + key { [ 9, parenright, bracketright, greater ] }; key { [ 0, equal, braceright, degree ] }; key { [ plus, question, backslash, questiondown ] }; key { [ dead_acute, dead_grave, dead_cedilla, dead_ogonek ] }; @@ -205,9 +204,10 @@ xkb_symbols "mac" { name[Group1]="Finnish (Macintosh)"; }; -// EXTRAS: - partial alphanumeric_keys - xkb_symbols "sun_type6" { - include "sun_vndr/fi(sun_type6)" +xkb_symbols "sun_type6" { + + // Sun Type 6/7 keyboard for Finland + + include "sun_vndr/fi(sun_type6)" }; diff --git a/xorg-server/xkeyboard-config/symbols/hr b/xorg-server/xkeyboard-config/symbols/hr index 61fc39221..cdceea1fe 100644 --- a/xorg-server/xkeyboard-config/symbols/hr +++ b/xorg-server/xkeyboard-config/symbols/hr @@ -4,12 +4,12 @@ xkb_symbols "basic" { include "rs(latin)" name[Group1]="Croatian"; - // Redefine these keys to match XFree86 Croatian layout - key { [ 1, exclam, asciitilde, dead_tilde ] }; - key { [ 3, numbersign, asciicircum, dead_circumflex ] }; - key { [ 5, percent, degree, dead_abovering ] }; - key { [ 7, slash, grave, dead_grave ] }; - key { [ minus, underscore, dead_belowdot, dead_abovedot ] }; + // Redefine these keys to match the XFree86 Croatian layout. + key { [ 1, exclam, asciitilde, dead_tilde ] }; + key { [ 3, numbersign, asciicircum, dead_circumflex ] }; + key { [ 5, percent, degree, dead_abovering ] }; + key { [ 7, slash, grave, dead_grave ] }; + key { [ minus, underscore, dead_belowdot, dead_abovedot ] }; }; partial alphanumeric_keys @@ -18,28 +18,28 @@ xkb_symbols "us" { include "us" name[Group1]= "Croatian (US keyboard with Croatian letters)"; - key { [ any, any, backslash ] }; - key { [ any, any, bar ] }; - key { [ any, any, EuroSign ] }; - key { [ any, any, z, Z ] }; - key { [ any, any, scaron, Scaron ] }; - key { [ any, any, dstroke, Dstroke ] }; - key { [ any, any, bracketleft ] }; - key { [ any, any, bracketright ] }; - key { [ any, any, lstroke ] }; - key { [ any, any, Lstroke ] }; - key { [ any, any, ccaron, Ccaron ] }; - key { [ any, any, cacute, Cacute ] }; - key { [ any, any, bar ] }; - key { [ any, any, y, Y ] }; - key { [ any, any, at ] }; - key { [ any, any, braceleft ] }; - key { [ any, any, braceright ] }; - key { [ any, any, section ] }; - key { [ any, any, semicolon ] }; - key { [ any, any, colon ] }; - key { [ any, any, minus, underscore ] }; - key { [ any, any, zcaron, Zcaron ] }; + key { [ any, any, backslash ] }; + key { [ any, any, bar ] }; + key { [ any, any, EuroSign ] }; + key { [ any, any, z, Z ] }; + key { [ any, any, scaron, Scaron ] }; + key { [ any, any, dstroke, Dstroke ] }; + key { [ any, any, bracketleft ] }; + key { [ any, any, bracketright ] }; + key { [ any, any, lstroke ] }; + key { [ any, any, Lstroke ] }; + key { [ any, any, ccaron, Ccaron ] }; + key { [ any, any, cacute, Cacute ] }; + key { [ any, any, bar ] }; + key { [ any, any, y, Y ] }; + key { [ any, any, at ] }; + key { [ any, any, braceleft ] }; + key { [ any, any, braceright ] }; + key { [ any, any, section ] }; + key { [ any, any, semicolon ] }; + key { [ any, any, colon ] }; + key { [ any, any, minus, underscore ] }; + key { [ any, any, zcaron, Zcaron ] }; include "level3(ralt_switch)" }; diff --git a/xorg-server/xkeyboard-config/symbols/jp b/xorg-server/xkeyboard-config/symbols/jp index f0b2c4d75..26dfdf9bd 100644 --- a/xorg-server/xkeyboard-config/symbols/jp +++ b/xorg-server/xkeyboard-config/symbols/jp @@ -131,7 +131,7 @@ xkb_symbols "kana86" { name[Group1]= "Japanese (Kana 86)"; key { [ Escape ] }; - key { [ Num_Lock, Pointer_EnableKeys ] }; + key { [ Num_Lock ] }; key { [ BackSpace ] }; key { [ Tab, ISO_Left_Tab ] }; key { [ Return ] }; diff --git a/xorg-server/xkeyboard-config/symbols/keypad b/xorg-server/xkeyboard-config/symbols/keypad index 9b49a5773..0187ecbeb 100644 --- a/xorg-server/xkeyboard-config/symbols/keypad +++ b/xorg-server/xkeyboard-config/symbols/keypad @@ -211,7 +211,7 @@ xkb_symbols "core" { modifier_map Mod2 { Num_Lock }; - key { [ Num_Lock, Pointer_EnableKeys ] }; + key { [ Num_Lock ] }; key { [ KP_Enter ] }; key { [ KP_Equal ] }; }; diff --git a/xorg-server/xkeyboard-config/symbols/me b/xorg-server/xkeyboard-config/symbols/me index acb37e76d..1ada63493 100644 --- a/xorg-server/xkeyboard-config/symbols/me +++ b/xorg-server/xkeyboard-config/symbols/me @@ -21,7 +21,7 @@ xkb_symbols "cyrillic" { partial alphanumeric_keys xkb_symbols "cyrillicyz" { include "rs(yz)" - name[Group1]= "Montenegrin (Cyrillic, Z and ZHE swapped)"; + name[Group1]= "Montenegrin (Cyrillic, ZE and ZHE swapped)"; }; partial alphanumeric_keys diff --git a/xorg-server/xkeyboard-config/symbols/rs b/xorg-server/xkeyboard-config/symbols/rs index 06025e17e..c39f4ed49 100644 --- a/xorg-server/xkeyboard-config/symbols/rs +++ b/xorg-server/xkeyboard-config/symbols/rs @@ -1,342 +1,331 @@ -// Bosnian, Croatian, Serbian and Slovenian XKB keyboard mapping -// (derived from "Danube" D.2) +// Bosnian, Croatian, Serbian and Slovenian XKB keyboard mappings. // -// Danube D.2 from 2003-05-12 is available at http://srpski.org/dunav/ +// Derived from "Danube" D.2 from 2003-05-12, +// which is available at http://srpski.org/dunav/. // // Original authors: // Danilo Segan (Данило Шеган) // Chusslove Illich (Часлав Илић) // // Danilo Segan : -// - Modified for inclusion in XFree86 -// - Further modifications on 2005-08-18 to support Bosnian, Croatian -// and Slovenian in xkeyboard-config -// +// - Modified for inclusion in XFree86. +// - Further modifications on 2005-08-18 to support Bosnian, +// Croatian and Slovenian in xkeyboard-config. default partial alphanumeric_keys xkb_symbols "basic" { - name[Group1]= "Serbian"; + name[Group1]= "Serbian"; - include "rs(cyrlevel3)" - include "rs(common)" - include "rs(cyralpha)" - include "level3(ralt_switch)" + include "rs(cyrlevel3)" + include "rs(common)" + include "rs(cyralpha)" + include "level3(ralt_switch)" }; - partial alphanumeric_keys xkb_symbols "latin" { - name[Group1]= "Serbian (Latin)"; + name[Group1]= "Serbian (Latin)"; - include "latin(type3)" - include "rs(latalpha)" - include "rs(latlevel3)" - include "rs(common)" - include "level3(ralt_switch)" + include "latin(type3)" + include "rs(latalpha)" + include "rs(latlevel3)" + include "rs(common)" + include "level3(ralt_switch)" }; - partial alphanumeric_keys xkb_symbols "yz" { - include "rs(basic)" - name[Group1]= "Serbian (Cyrillic, ZE and ZHE swapped)"; + include "rs(basic)" + name[Group1]= "Serbian (Cyrillic, ZE and ZHE swapped)"; - key { [ Cyrillic_zhe, Cyrillic_ZHE, any,any ] }; // y - key { [ Cyrillic_ze, Cyrillic_ZE, any,any ] }; // z + key { [ Cyrillic_zhe, Cyrillic_ZHE, any, any ] }; // y + key { [ Cyrillic_ze, Cyrillic_ZE, any, any ] }; // z }; partial hidden alphanumeric_keys xkb_symbols "common" { - // "Common" keys: keys which are same for both latin and cyrillic keyboards - - key.type[Group1] = "FOUR_LEVEL"; - - key { [ grave, asciitilde, any,any ] }; // - key { [ 1, exclam, any,any ] }; // - key { [ 2, quotedbl, any,any ] }; // - key { [ 3, numbersign, any,any ] }; // - key { [ 4, dollar, any,any ] }; // - key { [ 5, percent, any,any ] }; // - key { [ 6, ampersand, any,any ] }; // - key { [ 7, slash, any,any ] }; // - key { [ 8, parenleft, any,any ] }; // - key { [ 9, parenright, any,any ] }; // - key { [ 0, equal, any,any ] }; // - key { [ apostrophe, question, any,any ] }; // - key { [ plus, asterisk, any,any ] }; // - - key { [ comma, semicolon, any,any ] }; // - key { [ period, colon, any,any ] }; // - key { [ minus, underscore, any,any ] }; // - - include "kpdl(comma)" + // "Common" keys: keys that are the same + // for both latin and cyrillic keyboards. + + key.type[Group1] = "FOUR_LEVEL"; + + key { [ grave, asciitilde, any, any ] }; + key { [ 1, exclam, any, any ] }; + key { [ 2, quotedbl, any, any ] }; + key { [ 3, numbersign, any, any ] }; + key { [ 4, dollar, any, any ] }; + key { [ 5, percent, any, any ] }; + key { [ 6, ampersand, any, any ] }; + key { [ 7, slash, any, any ] }; + key { [ 8, parenleft, any, any ] }; + key { [ 9, parenright, any, any ] }; + key { [ 0, equal, any, any ] }; + key { [ apostrophe, question, any, any ] }; + key { [ plus, asterisk, any, any ] }; + + key { [ comma, semicolon, any, any ] }; + key { [ period, colon, any, any ] }; + key { [ minus, underscore, any, any ] }; + + include "kpdl(comma)" }; partial hidden alphanumeric_keys xkb_symbols "cyralpha" { - key.type[Group1] = "FOUR_LEVEL_ALPHABETIC"; - - key { [ Cyrillic_lje, Cyrillic_LJE, any,any ] }; // q - key { [ Cyrillic_nje, Cyrillic_NJE, any,any ] }; // w - key { [ Cyrillic_ie, Cyrillic_IE, any,any ] }; // e - key { [ Cyrillic_er, Cyrillic_ER, any,any ] }; // r - key { [ Cyrillic_te, Cyrillic_TE, any,any ] }; // t - key { [ Cyrillic_ze, Cyrillic_ZE, any,any ] }; // y - key { [ Cyrillic_u, Cyrillic_U, any,any ] }; // u - key { [ Cyrillic_i, Cyrillic_I, any,any ] }; // i - key { [ Cyrillic_o, Cyrillic_O, any,any ] }; // o - key { [ Cyrillic_pe, Cyrillic_PE, any,any ] }; // p - key { [ Cyrillic_sha, Cyrillic_SHA, any,any ] }; // [ { - key { [ Serbian_dje, Serbian_DJE, any,any ] }; // ] } - - key { [ Cyrillic_a, Cyrillic_A, any,any ] }; // a - key { [ Cyrillic_es, Cyrillic_ES, any,any ] }; // s - key { [ Cyrillic_de, Cyrillic_DE, any,any ] }; // d - key { [ Cyrillic_ef, Cyrillic_EF, any,any ] }; // f - key { [ Cyrillic_ghe, Cyrillic_GHE, any,any ] }; // g - key { [ Cyrillic_ha, Cyrillic_HA, any,any ] }; // h - key { [ Cyrillic_je, Cyrillic_JE, any,any ] }; // j - key { [ Cyrillic_ka, Cyrillic_KA, any,any ] }; // k - key { [ Cyrillic_el, Cyrillic_EL, any,any ] }; // l - key { [ Cyrillic_che, Cyrillic_CHE, any,any ] }; // ; : - key { [ Serbian_tshe, Serbian_TSHE, any,any ] }; // ' " - key { [ Cyrillic_zhe, Cyrillic_ZHE, any,any ] }; // \ | - - key { [ Cyrillic_zhe, Cyrillic_ZHE, any,any ] }; // z - key { [ Cyrillic_dzhe, Cyrillic_DZHE, any,any ] }; // x - key { [ Cyrillic_tse, Cyrillic_TSE, any,any ] }; // c - key { [ Cyrillic_ve, Cyrillic_VE, any,any ] }; // v - key { [ Cyrillic_be, Cyrillic_BE, any,any ] }; // b - key { [ Cyrillic_en, Cyrillic_EN, any,any ] }; // n - key { [ Cyrillic_em, Cyrillic_EM, any,any ] }; // m + key.type[Group1] = "FOUR_LEVEL_ALPHABETIC"; + + key { [ Cyrillic_lje, Cyrillic_LJE, any, any ] }; // q + key { [ Cyrillic_nje, Cyrillic_NJE, any, any ] }; // w + key { [ Cyrillic_ie, Cyrillic_IE, any, any ] }; // e + key { [ Cyrillic_er, Cyrillic_ER, any, any ] }; // r + key { [ Cyrillic_te, Cyrillic_TE, any, any ] }; // t + key { [ Cyrillic_ze, Cyrillic_ZE, any, any ] }; // y + key { [ Cyrillic_u, Cyrillic_U, any, any ] }; // u + key { [ Cyrillic_i, Cyrillic_I, any, any ] }; // i + key { [ Cyrillic_o, Cyrillic_O, any, any ] }; // o + key { [ Cyrillic_pe, Cyrillic_PE, any, any ] }; // p + key { [ Cyrillic_sha, Cyrillic_SHA, any, any ] }; // [ { + key { [ Serbian_dje, Serbian_DJE, any, any ] }; // ] } + + key { [ Cyrillic_a, Cyrillic_A, any, any ] }; // a + key { [ Cyrillic_es, Cyrillic_ES, any, any ] }; // s + key { [ Cyrillic_de, Cyrillic_DE, any, any ] }; // d + key { [ Cyrillic_ef, Cyrillic_EF, any, any ] }; // f + key { [ Cyrillic_ghe, Cyrillic_GHE, any, any ] }; // g + key { [ Cyrillic_ha, Cyrillic_HA, any, any ] }; // h + key { [ Cyrillic_je, Cyrillic_JE, any, any ] }; // j + key { [ Cyrillic_ka, Cyrillic_KA, any, any ] }; // k + key { [ Cyrillic_el, Cyrillic_EL, any, any ] }; // l + key { [ Cyrillic_che, Cyrillic_CHE, any, any ] }; // ; : + key { [ Serbian_tshe, Serbian_TSHE, any, any ] }; // ' " + key { [ Cyrillic_zhe, Cyrillic_ZHE, any, any ] }; // \ | + + key { [ Cyrillic_zhe, Cyrillic_ZHE, any, any ] }; // z + key { [ Cyrillic_dzhe, Cyrillic_DZHE, any, any ] }; // x + key { [ Cyrillic_tse, Cyrillic_TSE, any, any ] }; // c + key { [ Cyrillic_ve, Cyrillic_VE, any, any ] }; // v + key { [ Cyrillic_be, Cyrillic_BE, any, any ] }; // b + key { [ Cyrillic_en, Cyrillic_EN, any, any ] }; // n + key { [ Cyrillic_em, Cyrillic_EM, any, any ] }; // m }; partial hidden alphanumeric_keys xkb_symbols "latalpha" { - key.type[Group1] = "FOUR_LEVEL_ALPHABETIC"; + key.type[Group1] = "FOUR_LEVEL_ALPHABETIC"; - key { [ scaron, Scaron, any,any ] }; // - key { [ dstroke, Dstroke, any,any ] }; // - - key { [ ccaron, Ccaron, any,any ] }; // - key { [ cacute, Cacute, any,any ] }; // - key { [ zcaron, Zcaron, any,any ] }; // + key { [ scaron, Scaron, any, any ] }; // [ { + key { [ dstroke, Dstroke, any, any ] }; // ] } + key { [ ccaron, Ccaron, any, any ] }; // ; : + key { [ cacute, Cacute, any, any ] }; // ' " + key { [ zcaron, Zcaron, any, any ] }; // \ | }; partial hidden alphanumeric_keys xkb_symbols "twoletter" { - // These are letters which are written in latin transcription with two-characters. - key { type[Group1] = "SEPARATE_CAPS_AND_SHIFT_ALPHABETIC", - [ U1C9, U1C8, any, U1C7 ] }; // q - key { type[Group1] = "SEPARATE_CAPS_AND_SHIFT_ALPHABETIC", - [ U1CC, U1CB, any, U1CA ] }; // w - key { type[Group1] = "SEPARATE_CAPS_AND_SHIFT_ALPHABETIC", - [ U1C6, U1C5, any, U1C4 ] }; // x + // Letters which are written in latin transcription with two characters. + key { type[Group1] = "SEPARATE_CAPS_AND_SHIFT_ALPHABETIC", + [ U1C9, U1C8, any, U1C7 ] }; // q + key { type[Group1] = "SEPARATE_CAPS_AND_SHIFT_ALPHABETIC", + [ U1CC, U1CB, any, U1CA ] }; // w + key { type[Group1] = "SEPARATE_CAPS_AND_SHIFT_ALPHABETIC", + [ U1C6, U1C5, any, U1C4 ] }; // x - // Also replace letter Y with Zcaron, since Y is of no use any longer - key { [ zcaron, Zcaron, any,any ] }; // + // Also replace letter Y with Zcaron, since Y is of no use any longer. + key { [ zcaron, Zcaron, any, any ] }; // z }; partial hidden alphanumeric_keys xkb_symbols "latlevel3" { - key { [ any,any, notsign, notsign ] }; // ` ~ - key { [ any,any, dead_tilde, asciitilde ] }; // 1 ! - key { [ any,any, dead_caron, caron ] }; // 2 @ - key { [ any,any, dead_circumflex, asciicircum ] }; // 3 # - key { [ any,any, dead_breve, breve ] }; // 4 $ - key { [ any,any, dead_abovering, degree ] }; // 5 % - key { [ any,any, dead_ogonek, ogonek ] }; // 6 ^ - key { [ any,any, dead_grave, grave ] }; // 7 & - key { [ any,any, dead_abovedot, abovedot ] }; // 8 * - key { [ any,any, dead_acute, apostrophe ] }; // 9 ( - key { [ any,any, dead_doubleacute, doubleacute ] }; // 0 ) - key { [ any,any, dead_diaeresis, diaeresis ] }; // - _ - key { [ any,any, dead_cedilla, cedilla ] }; // = + - - key { [ any,any, backslash, Greek_OMEGA ] }; // q - key { [ any,any, bar, Lstroke ] }; // w - key { [ any,any, EuroSign, EuroSign ] }; // e - key { [ any,any, paragraph, registered ] }; // r - key { [ any,any, tslash, Tslash ] }; // t // ALPHABETIC - key { [ any,any, leftarrow, yen ] }; // y - key { [ any,any, downarrow, uparrow ] }; // u - key { [ any,any, rightarrow, idotless ] }; // i - key { [ any,any, oslash, Ooblique ] }; // o // ALPHABETIC - key { [ any,any, thorn, THORN ] }; // p // ALPHABETIC - key { [ any,any, division, dead_abovering ] }; // [ - key { [ any,any, multiply, dead_macron ] }; // ] - - key { [ any,any, ae, AE ] }; // a // ALPHABETIC - key { [ any,any, doublelowquotemark, guillemotright ] }; // s - key { [ any,any, leftdoublequotemark, guillemotleft ] }; // d - key { [ any,any, bracketleft, ordfeminine ] }; // f - key { [ any,any, bracketright, ENG ] }; // g - key { [ any,any, hstroke, Hstroke ] }; // h // ALPHABETIC - key { [ any,any, NoSymbol, NoSymbol ] }; // j - key { [ any,any, lstroke, ampersand ] }; // k - key { [ any,any, lstroke, Lstroke ] }; // l - key { [ any,any, dead_acute, dead_doubleacute ] }; // ; - key { [ any,any, ssharp, dead_caron ] }; // ' - key { [ any,any, currency, dead_breve ] }; // \ - - key { [ any,any, leftsinglequotemark, guillemotright ] }; // z - key { [ any,any, rightsinglequotemark,guillemotleft ] }; // x - key { [ any,any, cent, copyright ] }; // c - key { [ any,any, at, grave ] }; // v - key { [ any,any, braceleft, apostrophe ] }; // b - key { [ any,any, braceright, braceright ] }; // n - key { [ any,any, asciicircum, masculine ] }; // m - key { [ any,any, less, multiply ] }; // , < - key { [ any,any, greater, division ] }; // . > - key { [ any,any, emdash, endash ] }; // / ? - + key { [ any, any, notsign, notsign ] }; // ` ~ + key { [ any, any, dead_tilde, asciitilde ] }; // 1 ! + key { [ any, any, dead_caron, caron ] }; // 2 @ + key { [ any, any, dead_circumflex, asciicircum ] }; // 3 # + key { [ any, any, dead_breve, breve ] }; // 4 $ + key { [ any, any, dead_abovering, degree ] }; // 5 % + key { [ any, any, dead_ogonek, ogonek ] }; // 6 ^ + key { [ any, any, dead_grave, grave ] }; // 7 & + key { [ any, any, dead_abovedot, abovedot ] }; // 8 * + key { [ any, any, dead_acute, apostrophe ] }; // 9 ( + key { [ any, any, dead_doubleacute, doubleacute ] }; // 0 ) + key { [ any, any, dead_diaeresis, diaeresis ] }; // - _ + key { [ any, any, dead_cedilla, cedilla ] }; // = + + + key { [ any, any, backslash, Greek_OMEGA ] }; // q + key { [ any, any, bar, Lstroke ] }; // w + key { [ any, any, EuroSign, EuroSign ] }; // e + key { [ any, any, paragraph, registered ] }; // r + key { [ any, any, tslash, Tslash ] }; // t // ALPHABETIC + key { [ any, any, leftarrow, yen ] }; // y + key { [ any, any, downarrow, uparrow ] }; // u + key { [ any, any, rightarrow, idotless ] }; // i + key { [ any, any, oslash, Ooblique ] }; // o // ALPHABETIC + key { [ any, any, thorn, THORN ] }; // p // ALPHABETIC + key { [ any, any, division, dead_abovering ] }; // [ + key { [ any, any, multiply, dead_macron ] }; // ] + + key { [ any, any, ae, AE ] }; // a // ALPHABETIC + key { [ any, any, doublelowquotemark, guillemotright ] }; // s + key { [ any, any, leftdoublequotemark, guillemotleft ] }; // d + key { [ any, any, bracketleft, ordfeminine ] }; // f + key { [ any, any, bracketright, ENG ] }; // g + key { [ any, any, hstroke, Hstroke ] }; // h // ALPHABETIC + key { [ any, any, NoSymbol, NoSymbol ] }; // j + key { [ any, any, lstroke, ampersand ] }; // k + key { [ any, any, lstroke, Lstroke ] }; // l + key { [ any, any, dead_acute, dead_doubleacute ] }; // ; + key { [ any, any, ssharp, dead_caron ] }; // ' + key { [ any, any, currency, dead_breve ] }; // \ + + key { [ any, any, leftsinglequotemark, guillemotright ] }; // z + key { [ any, any, rightsinglequotemark,guillemotleft ] }; // x + key { [ any, any, cent, copyright ] }; // c + key { [ any, any, at, grave ] }; // v + key { [ any, any, braceleft, apostrophe ] }; // b + key { [ any, any, braceright, braceright ] }; // n + key { [ any, any, asciicircum, masculine ] }; // m + key { [ any, any, less, multiply ] }; // , < + key { [ any, any, greater, division ] }; // . > + key { [ any, any, emdash, endash ] }; // / ? }; partial hidden alphanumeric_keys xkb_symbols "cyrlevel3" { - key { [ any,any, degree, notsign ] }; // ` ~ - key { [ any,any, dead_circumflex, NoSymbol ] }; // 3 # - key { [ any,any, dead_grave, NoSymbol ] }; // 7 & - key { [ any,any, dead_doublegrave, NoSymbol ] }; // 8 * - key { [ any,any, dead_acute, NoSymbol ] }; // 9 ( - key { [ any,any, dead_invertedbreve, NoSymbol ] }; // 0 ) - key { [ any,any, dead_macron, NoSymbol ] }; // - _ - - key { [ any,any, backslash, NoSymbol ] }; // q - key { [ any,any, bar, NoSymbol ] }; // w - key { [ any,any, EuroSign, sterling ] }; // e - key { [ any,any, paragraph, registered ] }; // r - key { [ any,any, ellipsis, NoSymbol ] }; // t // ALPHABETIC - key { [ any,any, leftarrow, yen ] }; // y - key { [ any,any, downarrow, uparrow ] }; // u - key { [ any,any, rightarrow, NoSymbol ] }; // i - key { [ any,any, section, NoSymbol ] }; // o // ALPHABETIC - key { [ any,any, division, NoSymbol ] }; // [ - key { [ any,any, multiply, NoSymbol ] }; // ] - - key { [ any,any, doublelowquotemark, guillemotright ] }; // s - key { [ any,any, leftdoublequotemark, guillemotleft ] }; // d - key { [ any,any, bracketleft, NoSymbol ] }; // f - key { [ any,any, bracketright, NoSymbol ] }; // g - key { [ any,any, currency, NoSymbol ] }; // \ - - key { [ any,any, leftsinglequotemark, NoSymbol ] }; // z - key { [ any,any, rightsinglequotemark,NoSymbol ] }; // x - key { [ any,any, cent, copyright ] }; // c - key { [ any,any, at, NoSymbol ] }; // v - key { [ any,any, braceleft, NoSymbol ] }; // b - key { [ any,any, braceright, NoSymbol ] }; // n - key { [ any,any, asciicircum, NoSymbol ] }; // m - key { [ any,any, less, NoSymbol ] }; // , < - key { [ any,any, greater, NoSymbol ] }; // . > - key { [ any,any, emdash, endash ] }; // / ? + key { [ any, any, degree, notsign ] }; // ` ~ + key { [ any, any, dead_circumflex, NoSymbol ] }; // 3 # + key { [ any, any, dead_grave, NoSymbol ] }; // 7 & + key { [ any, any, dead_doublegrave, NoSymbol ] }; // 8 * + key { [ any, any, dead_acute, NoSymbol ] }; // 9 ( + key { [ any, any, dead_invertedbreve, NoSymbol ] }; // 0 ) + key { [ any, any, dead_macron, NoSymbol ] }; // - _ + + key { [ any, any, backslash, NoSymbol ] }; // q + key { [ any, any, bar, NoSymbol ] }; // w + key { [ any, any, EuroSign, sterling ] }; // e + key { [ any, any, paragraph, registered ] }; // r + key { [ any, any, ellipsis, NoSymbol ] }; // t // ALPHABETIC + key { [ any, any, leftarrow, yen ] }; // y + key { [ any, any, downarrow, uparrow ] }; // u + key { [ any, any, rightarrow, NoSymbol ] }; // i + key { [ any, any, section, NoSymbol ] }; // o // ALPHABETIC + key { [ any, any, division, NoSymbol ] }; // [ + key { [ any, any, multiply, NoSymbol ] }; // ] + + key { [ any, any, doublelowquotemark, guillemotright ] }; // s + key { [ any, any, leftdoublequotemark, guillemotleft ] }; // d + key { [ any, any, bracketleft, NoSymbol ] }; // f + key { [ any, any, bracketright, NoSymbol ] }; // g + key { [ any, any, currency, NoSymbol ] }; // \ + + key { [ any, any, leftsinglequotemark, NoSymbol ] }; // z + key { [ any, any, rightsinglequotemark,NoSymbol ] }; // x + key { [ any, any, cent, copyright ] }; // c + key { [ any, any, at, NoSymbol ] }; // v + key { [ any, any, braceleft, NoSymbol ] }; // b + key { [ any, any, braceright, NoSymbol ] }; // n + key { [ any, any, asciicircum, NoSymbol ] }; // m + key { [ any, any, less, NoSymbol ] }; // , < + key { [ any, any, greater, NoSymbol ] }; // . > + key { [ any, any, emdash, endash ] }; // / ? }; partial alphanumeric_keys xkb_symbols "latinunicode" { - // This mapping supports the Unicode characters 0x1c4-0x1cc (dz, lj, and nj - // as single character). You get the title form with AltGr+Shift. + // This mapping supports the Unicode characters 0x1c4-0x1cc (dz, lj, and nj + // as single character). You get the title form with AltGr+Shift. - include "rs(latin)" + include "rs(latin)" + name[Group1]= "Serbian (Latin Unicode)"; - name[Group1]= "Serbian (Latin Unicode)"; - - include "rs(twoletter)" + include "rs(twoletter)" }; partial alphanumeric_keys xkb_symbols "latinyz" { - // For those who insist on using "english-position" Z and Y. - - include "rs(latin)" + // For those who insist on using "english-position" Z and Y. - name[Group1]= "Serbian (Latin qwerty)"; + include "rs(latin)" + name[Group1]= "Serbian (Latin qwerty)"; - key { [ y, Y, any,any ] }; // y - key { [ z, Z, any,any ] }; // z + key { [ y, Y, any, any ] }; // y + key { [ z, Z, any, any ] }; // z }; partial alphanumeric_keys xkb_symbols "latinunicodeyz" { - // Unicode, ZHE and Z swapped. - - include "rs(latinunicode)" + // Unicode, ZHE and Z swapped. - name[Group1]= "Serbian (Latin Unicode qwerty)"; + include "rs(latinunicode)" + name[Group1]= "Serbian (Latin Unicode qwerty)"; - key { [ zcaron, Zcaron, any,any ] }; // y - key { [ z, Z, any,any ] }; // z + key { [ zcaron, Zcaron, any, any ] }; // y + key { [ z, Z, any, any ] }; // z }; xkb_symbols "alternatequotes" { - // Another acceptable »pair of quotes« for Serbian + // Another acceptable »pair of quotes« for Serbian. - include "rs(basic)" + include "rs(basic)" + name[Group1]= "Serbian (Cyrillic with guillemets)"; - name[Group1]= "Serbian (Cyrillic with guillemets)"; - - key { [ any,any, guillemotright, NoSymbol ] }; // s - key { [ any,any, guillemotleft, NoSymbol ] }; // d + key { [ any, any, guillemotright, NoSymbol ] }; // s + key { [ any, any, guillemotleft, NoSymbol ] }; // d }; xkb_symbols "latinalternatequotes" { - // Another acceptable »pair of quotes« for Serbian - - include "rs(latin)" + // Another acceptable »pair of quotes« for Serbian. - name[Group1]= "Serbian (Latin with guillemets)"; + include "rs(latin)" + name[Group1]= "Serbian (Latin with guillemets)"; - key { [ any,any, guillemotright, NoSymbol ] }; // s - key { [ any,any, guillemotleft, NoSymbol ] }; // d + key { [ any, any, guillemotright, NoSymbol ] }; // s + key { [ any, any, guillemotleft, NoSymbol ] }; // d }; xkb_symbols "rue" { - // Layout for Pannonian Rusyn (spoken mainly in Serbia and - // Croatia by the Rusyn people), based on Serbian Cyrillic layout. - // Authors: - // Ljubomir J. Papuga (Любомир Я. Папуґа) - // Mihajlo Hornjak - - include "rs(basic)" + // Layout for Pannonian Rusyn (spoken mainly in Serbia and Croatia + // by the Rusyn people), based on Serbian Cyrillic layout. + // Authors: + // Ljubomir J. Papuga (Любомир Я. Папуґа) + // Mihajlo Hornjak - name[Group1]= "Pannonian Rusyn"; + include "rs(basic)" + name[Group1]= "Pannonian Rusyn"; - key { [ Cyrillic_softsign, Cyrillic_SOFTSIGN ] }; // ` + key { [ Cyrillic_softsign, Cyrillic_SOFTSIGN ] }; // ` - key { [ Cyrillic_ya, Cyrillic_YA ] }; // q - key { [ Ukrainian_ie, Ukrainian_IE ] }; // w - key { [ Cyrillic_shcha, Cyrillic_SHCHA ] }; // ] + key { [ Cyrillic_ya, Cyrillic_YA ] }; // q + key { [ Ukrainian_ie, Ukrainian_IE ] }; // w + key { [ Cyrillic_shcha, Cyrillic_SHCHA ] }; // ] - key { [ Ukrainian_ghe_with_upturn, Ukrainian_GHE_WITH_UPTURN ] }; // g - key { [ Cyrillic_shorti, Cyrillic_SHORTI ] }; // j - key { [ Cyrillic_ghe, Cyrillic_GHE ] }; // ' + key { [ Ukrainian_ghe_with_upturn, Ukrainian_GHE_WITH_UPTURN ] }; // g + key { [ Cyrillic_shorti, Cyrillic_SHORTI ] }; // j + key { [ Cyrillic_ghe, Cyrillic_GHE ] }; // ' - key { [ Cyrillic_yu, Cyrillic_YU ] }; // z - key { [ Ukrainian_yi, Ukrainian_YI ] }; // x + key { [ Cyrillic_yu, Cyrillic_YU ] }; // z + key { [ Ukrainian_yi, Ukrainian_YI ] }; // x }; // EXTRAS: xkb_symbols "combiningkeys" { - // Raw combining characters instead of dead keys, - // especially good for post-accenting texts. - - include "rs(basic)" - - name[Group1]= "Serbian (combining accents instead of dead keys)"; - - key { [ any,any, U0302, dead_circumflex ] }; // 3, U0302 = COMBINING CIRCUMFLEX ACCENT - key { [ any,any, U0300, NoSymbol ] }; // 7, U0300 = COMBINING GRAVE ACCENT - key { [ any,any, U030F, NoSymbol ] }; // 8, U030F = COMBINING DOUBLE GRAVE ACCENT - key { [ any,any, U0301, NoSymbol ] }; // 9, U0301 = COMBINING ACUTE ACCENT - key { [ any,any, U0311, NoSymbol ] }; // 0, U0311 = COMBINING INVERTED BREVE - key { [ any,any, U0304, NoSymbol ] }; // -, U0304 = COMBINING MACRON + // Raw combining characters instead of dead keys, + // especially good for post-accenting texts. + + include "rs(basic)" + name[Group1]= "Serbian (combining accents instead of dead keys)"; + + key { [ any, any, U0302, dead_circumflex ] }; // 3, U0302 = COMBINING CIRCUMFLEX ACCENT + key { [ any, any, U0300, NoSymbol ] }; // 7, U0300 = COMBINING GRAVE ACCENT + key { [ any, any, U030F, NoSymbol ] }; // 8, U030F = COMBINING DOUBLE GRAVE ACCENT + key { [ any, any, U0301, NoSymbol ] }; // 9, U0301 = COMBINING ACUTE ACCENT + key { [ any, any, U0311, NoSymbol ] }; // 0, U0311 = COMBINING INVERTED BREVE + key { [ any, any, U0304, NoSymbol ] }; // -, U0304 = COMBINING MACRON }; diff --git a/xorg-server/xkeyboard-config/symbols/ru b/xorg-server/xkeyboard-config/symbols/ru index 2b34a4d52..fd1cc0ec5 100644 --- a/xorg-server/xkeyboard-config/symbols/ru +++ b/xorg-server/xkeyboard-config/symbols/ru @@ -182,7 +182,7 @@ xkb_symbols "phonetic" { key { [ Cyrillic_a, Cyrillic_A ] }; key { [ Cyrillic_ve, Cyrillic_VE ] }; key { [ Cyrillic_tse, Cyrillic_TSE ] }; - key { [ Cyrillic_ha, Cyrillic_HA ] }; + key { [ Cyrillic_softsign, Cyrillic_SOFTSIGN ] }; key { [ Cyrillic_de, Cyrillic_DE ] }; key { [ Cyrillic_ie, Cyrillic_IE ] }; key { [ Cyrillic_zhe, Cyrillic_ZHE ] }; @@ -191,7 +191,7 @@ xkb_symbols "phonetic" { key { [ Cyrillic_er, Cyrillic_ER ] }; key { [ Cyrillic_en, Cyrillic_EN ] }; key { [ Cyrillic_be, Cyrillic_BE ] }; - key { [ Cyrillic_che, Cyrillic_CHE ] }; + key { [ Cyrillic_ha, Cyrillic_HA ] }; key { [ Cyrillic_ghe, Cyrillic_GHE ] }; key { [ Cyrillic_yeru, Cyrillic_YERU ] }; key { [ Cyrillic_em, Cyrillic_EM ] }; @@ -204,7 +204,7 @@ xkb_symbols "phonetic" { key { [ Cyrillic_pe, Cyrillic_PE ] }; key { [ Cyrillic_sha, Cyrillic_SHA ] }; - key { [ Cyrillic_softsign, Cyrillic_SOFTSIGN ] }; + key { [ Cyrillic_che, Cyrillic_CHE ] }; key { [ Cyrillic_shcha, Cyrillic_SHCHA ] }; key { [ Cyrillic_e, Cyrillic_E ] }; }; @@ -268,10 +268,10 @@ xkb_symbols "cv" { key.type[group1]="FOUR_LEVEL"; - key { [ Cyrillic_u, Cyrillic_U, U04F3, U04F2 ] }; - key { [ Cyrillic_ie, Cyrillic_IE, U04D7, U04D6 ] }; - key { [ Cyrillic_a, Cyrillic_A, U04D1, U04D0 ] }; - key { [ Cyrillic_es, Cyrillic_ES, U04AB, U04AA ] }; + key { [ Cyrillic_u, Cyrillic_U, 0x010004f3, 0x010004f2 ] }; + key { [ Cyrillic_ie, Cyrillic_IE, 0x010004d7, 0x010004d6 ] }; + key { [ Cyrillic_a, Cyrillic_A, 0x010004d1, 0x010004d0 ] }; + key { [ Cyrillic_es, Cyrillic_ES, 0x010004ab, 0x010004aa ] }; include "level3(ralt_switch)" }; -- cgit v1.2.3