This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project gfxprim.git.
The branch, master has been updated via 29623bb8c09cbd6659a28bbe84f2a6cdf154c434 (commit) via eebc231f0d4ea12607c8c9bd6d906ff069114b55 (commit) via 89919678929f52f1507282364073cd4b24475d8c (commit) via 6e66ab22c6b2ee3f420920e62256fbbe76b3046f (commit) via bcc354f183de93310f42b9f5e32380bddb207128 (commit) via 799dac0a953bcba3bd8d7fc171597011320094a1 (commit) from c5d73272e61f6d7a05a971d02480660c388bfdd2 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- http://repo.or.cz/w/gfxprim.git/commit/29623bb8c09cbd6659a28bbe84f2a6cdf154c...
commit 29623bb8c09cbd6659a28bbe84f2a6cdf154c434 Author: Cyril Hrubis metan@ucw.cz Date: Mon Apr 22 23:41:35 2013 +0200
tests: core: Unify test names.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/tests/core/Makefile b/tests/core/Makefile index 757416b..8aa4196 100644 --- a/tests/core/Makefile +++ b/tests/core/Makefile @@ -4,9 +4,9 @@ include $(TOPDIR)/pre.mk
CSOURCES=Context.c Pixel.c
-GENSOURCES+=WritePixel_testsuite.gen.c GetPutPixel.gen.c +GENSOURCES+=WritePixel.gen.c GetPutPixel.gen.c
-APPS=WritePixel_testsuite.gen Pixel Context GetPutPixel.gen +APPS=WritePixel.gen Pixel Context GetPutPixel.gen
include ../tests.mk
diff --git a/tests/core/WritePixel_testsuite.gen.c.t b/tests/core/WritePixel.gen.c.t similarity index 100% rename from tests/core/WritePixel_testsuite.gen.c.t rename to tests/core/WritePixel.gen.c.t diff --git a/tests/core/test_list.txt b/tests/core/test_list.txt index c4f6bb7..89cbedd 100644 --- a/tests/core/test_list.txt +++ b/tests/core/test_list.txt @@ -1,5 +1,5 @@ # Core testsuite -WritePixel_testsuite.gen +WritePixel.gen Context Pixel GetPutPixel.gen
http://repo.or.cz/w/gfxprim.git/commit/eebc231f0d4ea12607c8c9bd6d906ff069114...
commit eebc231f0d4ea12607c8c9bd6d906ff069114b55 Author: Cyril Hrubis metan@ucw.cz Date: Mon Apr 22 23:40:06 2013 +0200
tests: WritePixel add malloc allocated buffers.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/tests/core/WritePixel_testsuite.gen.c.t b/tests/core/WritePixel_testsuite.gen.c.t index 859154d..c1aff24 100644 --- a/tests/core/WritePixel_testsuite.gen.c.t +++ b/tests/core/WritePixel_testsuite.gen.c.t @@ -16,7 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, * * Boston, MA 02110-1301 USA * * * - * Copyright (C) 2009-2012 Cyril Hrubis metan@ucw.cz * + * Copyright (C) 2009-2013 Cyril Hrubis metan@ucw.cz * * * *****************************************************************************/
@@ -25,6 +25,8 @@ %% block body
#include <stdio.h> +#include <string.h> +#include <stdlib.h>
#include <core/GP_WritePixel.h>
@@ -53,20 +55,15 @@ static void dump_buffer(const char *name, char *buf, unsigned int buf_len) * Compares two statically defined buffers */ #define COMPARE_BUFFERS(id, buf1, buf2) do { - unsigned int buf1_len = sizeof(buf1)/sizeof(*buf1); - unsigned int buf2_len = sizeof(buf2)/sizeof(*buf2); + unsigned int buf_len = sizeof(buf2)/sizeof(*buf2); unsigned int i; - if (buf1_len != buf2_len) { - tst_msg("Invalid buffers"); - return TST_FAILED; - } - for (i = 0; i < buf1_len; i++) + for (i = 0; i < buf_len; i++) if(buf1[i] != buf2[i]) { printf("%sn", id); - dump_buffer("wrote", buf1, buf1_len); - dump_buffer("gen", buf2, buf2_len); + dump_buffer("wrote", buf1, buf_len); + dump_buffer("gen", buf2, buf_len); tst_msg("Buffers are different"); return TST_FAILED; } @@ -80,7 +77,6 @@ static void dump_buffer(const char *name, char *buf, unsigned int buf_len) %% for aligment in [0, 4] %% if (pixelsize != 16 and pixelsize != 32) or aligment == 0 static int WritePixel{{ "_%i_%i_%i_%i"|format(pixelsize, offset, len, aligment) }}(void) -//, {{ ""offset=%i, len=%i, aligment=%i,""|format(offset, len, aligment) }}) { char write_buf[{{ 25 * pixelsize//8 }}] = {}; char gen_buf[{{ 25 * pixelsize//8 }}] = {}; @@ -98,6 +94,32 @@ static int WritePixel{{ "_%i_%i_%i_%i"|format(pixelsize, offset, len, aligment)
COMPARE_BUFFERS({{""p=%i o=%i l=%i a=%i""|format(pixelsize, offset, len, aligment)}}, write_buf, gen_buf); } + +static int WritePixel{{ "_%i_%i_%i_%i_alloc"|format(pixelsize, offset, len, aligment) }}(void) +{ + char gen_buf[{{ 25 * pixelsize//8 }}] = {}; + char *write_buf = malloc({{ 25 * pixelsize//8 }}); + + /* + * Fill the compare buffer + */ +%% for i in range(0, len) +%% for j in range(0, pixelsize//8) + gen_buf[{{aligment + offset * pixelsize//8 + i * pixelsize//8 + j}}] = 0xff; +%% endfor +%% endfor + + if (gen_buf == NULL) { + tst_msg("Malloc failed :("); + return TST_UNTESTED; + } + + memset(write_buf, 0, {{ 25 * pixelsize//8 }}); + + GP_WritePixels_{{ pixelsize }}BPP(write_buf + {{aligment + offset * pixelsize//8}}, {{ len }}, 0xffffffff>>{{32 - pixelsize}}); + + COMPARE_BUFFERS({{""p=%i o=%i l=%i a=%i""|format(pixelsize, offset, len, aligment)}}, write_buf, gen_buf); +} %% endif %% endfor %% endfor @@ -112,8 +134,10 @@ const struct tst_suite tst_suite = { %% for len in range(0, 6) %% for aligment in [0, 4] %% if (pixelsize != 16 and pixelsize != 32) or aligment == 0 - {.name = "WritePixel {{ pixelsize }} {{ offset }} {{ len }} {{ aligment }}", + {.name = "WritePixel {{ pixelsize }} {{ offset }} {{ len }} {{ aligment }} stack", .tst_fn = WritePixel{{ "_%i_%i_%i_%i"|format(pixelsize, offset, len, aligment) }}}, + {.name = "WritePixel {{ pixelsize }} {{ offset }} {{ len }} {{ aligment }} alloc", + .tst_fn = WritePixel{{ "_%i_%i_%i_%i_alloc"|format(pixelsize, offset, len, aligment) }}}, %% endif %% endfor %% endfor
http://repo.or.cz/w/gfxprim.git/commit/89919678929f52f1507282364073cd4b24475...
commit 89919678929f52f1507282364073cd4b24475d8c Author: Cyril Hrubis metan@ucw.cz Date: Mon Apr 22 23:31:44 2013 +0200
core: WritePixel: Fix 24BPP write pixels.
The problem is that the offset to 4 bytes was counted from address cast to the intptr_t which is signed type. So for big enough address it yields negative number that is unexpected value and breaks the rest of the code.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/libs/core/GP_WritePixel.c b/libs/core/GP_WritePixel.c index e80d1e8..27b300b 100644 --- a/libs/core/GP_WritePixel.c +++ b/libs/core/GP_WritePixel.c @@ -19,7 +19,7 @@ * Copyright (C) 2009-2010 Jiri "BlueBear" Dluhos * * jiri.bluebear.dluhos@gmail.com * * * - * Copyright (C) 2009-2012 Cyril Hrubis metan@ucw.cz * + * Copyright (C) 2009-2013 Cyril Hrubis metan@ucw.cz * * * *****************************************************************************/
@@ -379,7 +379,7 @@ void GP_WritePixels_24BPP(void *start, size_t count, unsigned int value) return;
/* How much bytes we are offset against the 32-bit boundary. */ - int shift = ((intptr_t) bytep) % 4; + int shift = ((uintptr_t) bytep) % 4;
/* * Pixels remaining to draw (one less than pixelcount because
http://repo.or.cz/w/gfxprim.git/commit/6e66ab22c6b2ee3f420920e62256fbbe76b30...
commit 6e66ab22c6b2ee3f420920e62256fbbe76b3046f Author: Cyril Hrubis metan@ucw.cz Date: Mon Apr 22 22:52:40 2013 +0200
spiv: Map arrow keys to offset by default.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/demos/spiv/spiv.c b/demos/spiv/spiv.c index fcb7ed5..e08de82 100644 --- a/demos/spiv/spiv.c +++ b/demos/spiv/spiv.c @@ -673,15 +673,11 @@ static const char *keys_help[] = { "Enter", "Q - quit spiv", "", - "PgDown - move ten image forward", - "PgUp - move ten image backward", + "PgDown - move 10 images forward", + "PgUp - move 10 images backward", "", - "Right", - "Up", "Space - move to the next image", "", - "Left", - "Down", "BckSpc - move to the prev image", "", "1 - resize spiv window to the image size", @@ -993,32 +989,37 @@ int main(int argc, char *argv[]) params.show_progress_once = 1; show_image(¶ms, image_list_move(list, -10)); break; - next: case GP_KEY_RIGHT: - if (shift_flag) { + if (shift_flag) + set_zoom_offset(¶ms, 1, 0); + else set_zoom_offset(¶ms, 10, 0); - break; - } + + break; + case GP_KEY_LEFT: + if (shift_flag) + set_zoom_offset(¶ms, -1, 0); + else + set_zoom_offset(¶ms, -10, 0); + break; case GP_KEY_UP: - if (shift_flag) { + if (shift_flag) + set_zoom_offset(¶ms, 0, -1); + else set_zoom_offset(¶ms, 0, -10); - break; - } + break; + case GP_KEY_DOWN: + if (shift_flag) + set_zoom_offset(¶ms, 0, 1); + else + set_zoom_offset(¶ms, 0, 10); + break; + next: case GP_KEY_SPACE: params.show_progress_once = 1; show_image(¶ms, image_list_move(list, 1)); break; prev: - case GP_KEY_LEFT: - if (shift_flag) { - set_zoom_offset(¶ms, -10, 0); - break; - } - case GP_KEY_DOWN: - if (shift_flag) { - set_zoom_offset(¶ms, 0, 10); - break; - } case GP_KEY_BACKSPACE: params.show_progress_once = 1; show_image(¶ms, image_list_move(list, -1));
http://repo.or.cz/w/gfxprim.git/commit/bcc354f183de93310f42b9f5e32380bddb207...
commit bcc354f183de93310f42b9f5e32380bddb207128 Author: Cyril Hrubis metan@ucw.cz Date: Mon Apr 22 22:20:05 2013 +0200
tests: Add good old runtest.sh to run isolated tests.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/tests/filters/runtest.sh b/tests/core/runtest.sh similarity index 74% copy from tests/filters/runtest.sh copy to tests/core/runtest.sh index 6b11a77..b3039a3 100755 --- a/tests/filters/runtest.sh +++ b/tests/core/runtest.sh @@ -9,5 +9,7 @@ # export LIBC_FATAL_STDERR_=1
-LD_PRELOAD=`pwd`/../framework/libtst_preload.so LD_LIBRARY_PATH=../../build/ ./FilterMirrorH "$@" -LD_PRELOAD=`pwd`/../framework/libtst_preload.so LD_LIBRARY_PATH=../../build/ ./APICoverage.gen "$@" +TEST="$1" +shift + +LD_PRELOAD=`pwd`/../framework/libtst_preload.so LD_LIBRARY_PATH=../../build/ "./$TEST" "$@" diff --git a/tests/filters/runtest.sh b/tests/filters/runtest.sh index 6b11a77..b3039a3 100755 --- a/tests/filters/runtest.sh +++ b/tests/filters/runtest.sh @@ -9,5 +9,7 @@ # export LIBC_FATAL_STDERR_=1
-LD_PRELOAD=`pwd`/../framework/libtst_preload.so LD_LIBRARY_PATH=../../build/ ./FilterMirrorH "$@" -LD_PRELOAD=`pwd`/../framework/libtst_preload.so LD_LIBRARY_PATH=../../build/ ./APICoverage.gen "$@" +TEST="$1" +shift + +LD_PRELOAD=`pwd`/../framework/libtst_preload.so LD_LIBRARY_PATH=../../build/ "./$TEST" "$@" diff --git a/tests/filters/runtest.sh b/tests/gfx/runtest.sh similarity index 74% copy from tests/filters/runtest.sh copy to tests/gfx/runtest.sh index 6b11a77..b3039a3 100755 --- a/tests/filters/runtest.sh +++ b/tests/gfx/runtest.sh @@ -9,5 +9,7 @@ # export LIBC_FATAL_STDERR_=1
-LD_PRELOAD=`pwd`/../framework/libtst_preload.so LD_LIBRARY_PATH=../../build/ ./FilterMirrorH "$@" -LD_PRELOAD=`pwd`/../framework/libtst_preload.so LD_LIBRARY_PATH=../../build/ ./APICoverage.gen "$@" +TEST="$1" +shift + +LD_PRELOAD=`pwd`/../framework/libtst_preload.so LD_LIBRARY_PATH=../../build/ "./$TEST" "$@" diff --git a/tests/filters/runtest.sh b/tests/loaders/runtest.sh similarity index 74% copy from tests/filters/runtest.sh copy to tests/loaders/runtest.sh index 6b11a77..b3039a3 100755 --- a/tests/filters/runtest.sh +++ b/tests/loaders/runtest.sh @@ -9,5 +9,7 @@ # export LIBC_FATAL_STDERR_=1
-LD_PRELOAD=`pwd`/../framework/libtst_preload.so LD_LIBRARY_PATH=../../build/ ./FilterMirrorH "$@" -LD_PRELOAD=`pwd`/../framework/libtst_preload.so LD_LIBRARY_PATH=../../build/ ./APICoverage.gen "$@" +TEST="$1" +shift + +LD_PRELOAD=`pwd`/../framework/libtst_preload.so LD_LIBRARY_PATH=../../build/ "./$TEST" "$@"
http://repo.or.cz/w/gfxprim.git/commit/799dac0a953bcba3bd8d7fc17159701132009...
commit 799dac0a953bcba3bd8d7fc171597011320094a1 Author: Cyril Hrubis metan@ucw.cz Date: Mon Apr 22 22:15:40 2013 +0200
tests: core: WritePixel Testsuite
The 16 and 32 bpp WritePixel rutines expects the buffer pointer to be aligned. There is no point in testing them with non zero aligment and moreover they fail on arch that doesn't support unaligned access.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/tests/core/WritePixel_testsuite.gen.c.t b/tests/core/WritePixel_testsuite.gen.c.t index 0807e0f..859154d 100644 --- a/tests/core/WritePixel_testsuite.gen.c.t +++ b/tests/core/WritePixel_testsuite.gen.c.t @@ -77,7 +77,8 @@ static void dump_buffer(const char *name, char *buf, unsigned int buf_len) %% for pixelsize in [8, 16, 24, 32] %% for offset in range(0, 4) %% for len in range(0, 6) -%% for aligment in [0, 1] +%% for aligment in [0, 4] +%% if (pixelsize != 16 and pixelsize != 32) or aligment == 0 static int WritePixel{{ "_%i_%i_%i_%i"|format(pixelsize, offset, len, aligment) }}(void) //, {{ ""offset=%i, len=%i, aligment=%i,""|format(offset, len, aligment) }}) { @@ -97,6 +98,7 @@ static int WritePixel{{ "_%i_%i_%i_%i"|format(pixelsize, offset, len, aligment)
COMPARE_BUFFERS({{""p=%i o=%i l=%i a=%i""|format(pixelsize, offset, len, aligment)}}, write_buf, gen_buf); } +%% endif %% endfor %% endfor %% endfor @@ -108,9 +110,11 @@ const struct tst_suite tst_suite = { %% for pixelsize in [8, 16, 24, 32] %% for offset in range(0, 4) %% for len in range(0, 6) -%% for aligment in [0, 1] +%% for aligment in [0, 4] +%% if (pixelsize != 16 and pixelsize != 32) or aligment == 0 {.name = "WritePixel {{ pixelsize }} {{ offset }} {{ len }} {{ aligment }}", .tst_fn = WritePixel{{ "_%i_%i_%i_%i"|format(pixelsize, offset, len, aligment) }}}, +%% endif %% endfor %% endfor %% endfor
-----------------------------------------------------------------------
Summary of changes: demos/spiv/spiv.c | 47 ++++++++-------- libs/core/GP_WritePixel.c | 4 +- tests/core/Makefile | 4 +- ...ePixel_testsuite.gen.c.t => WritePixel.gen.c.t} | 56 +++++++++++++++----- tests/{framework => core}/runtest.sh | 5 ++- tests/core/test_list.txt | 2 +- tests/filters/runtest.sh | 6 ++- tests/{framework => gfx}/runtest.sh | 5 ++- tests/{framework => loaders}/runtest.sh | 5 ++- 9 files changed, 87 insertions(+), 47 deletions(-) rename tests/core/{WritePixel_testsuite.gen.c.t => WritePixel.gen.c.t} (72%) copy tests/{framework => core}/runtest.sh (74%) copy tests/{framework => gfx}/runtest.sh (74%) copy tests/{framework => loaders}/runtest.sh (74%)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos@gmail.com if you want to unsubscribe, or site admin admin@repo.or.cz if you receive no reply.