From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Menzel Subject: Re: [PATCH] test/testdisplay:add cursor test Date: Sat, 22 Oct 2011 15:25:56 +0200 Message-ID: <1319289956.3496.43.camel@mattotaupa> References: <1319335385-29991-1-git-send-email-hai.lan@intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1156948888==" Return-path: Received: from mail.gw90.de (mail.gw90.de [188.40.100.199]) by gabe.freedesktop.org (Postfix) with ESMTP id 2D33C9E746 for ; Sat, 22 Oct 2011 06:25:59 -0700 (PDT) Received: from f053040124.adsl.alicedsl.de ([78.53.40.124] helo=[192.168.178.21]) by mail.gw90.de with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1RHbaT-0005jg-Ve for intel-gfx@lists.freedesktop.org; Sat, 22 Oct 2011 13:26:10 +0000 In-Reply-To: <1319335385-29991-1-git-send-email-hai.lan@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org --===============1156948888== Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-YdrcAlXJoMX+dZ1nRDsX" --=-YdrcAlXJoMX+dZ1nRDsX Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Dear Hai, Am Samstag, den 22.10.2011, 22:03 -0400 schrieb Hai Lan: what does this test do? For the unknowledgeable user what is supposed to happen, that means, when is the test successful and when not? > Signed-off-by: Hai Lan > --- > tests/testdisplay.c | 32 +++++++++++++++++++++++++------- > 1 files changed, 25 insertions(+), 7 deletions(-) >=20 > diff --git a/tests/testdisplay.c b/tests/testdisplay.c > index 01f31dc..174d5c7 100644 > --- a/tests/testdisplay.c > +++ b/tests/testdisplay.c > @@ -75,7 +75,7 @@ struct udev_monitor *uevent_monitor; > drmModeRes *resources; > int fd, modes; > int dump_info =3D 0, test_all_modes =3D0, test_preferred_mode =3D 0, for= ce_mode =3D 0, > - test_plane, enable_tiling; > + test_plane, enable_tiling, test_cursor; > int sleep_between_modes =3D 5; > uint32_t depth =3D 24; > =20 > @@ -823,7 +823,7 @@ set_mode(struct connector *c) > cairo_surface_t *surface; > cairo_status_t status; > cairo_t *cr; > - uint32_t handle; > + uint32_t handle,cursor_handle; Missing space? > if (test_all_modes) > c->mode =3D c->connector->modes[j]; > @@ -872,7 +872,6 @@ set_mode(struct connector *c) > handle, &fb_id); > cairo_surface_destroy(surface); > gem_close(fd, handle); > - > if (ret) { > fprintf(stderr, "failed to add fb (%dx%d): %s\n", > width, height, strerror(errno)); > @@ -888,6 +887,21 @@ set_mode(struct connector *c) > continue; > } > =20 > + if (test_cursor) { > + cursor_handle =3D gem_create(fd,64*64*4); > + char * cursor_buff =3D gem_mmap(fd, cursor_handle, 64*64*4, PROT_READ= | PROT_WRITE); > + for(int i=3D0;i<64*64*4;i++) > + *(cursor_buff+i)=3D0xff; > + > + drmModeSetCursor(fd,c->crtc,cursor_handle,64,64); > + for(int i=3D0;i<10;i++) { > + drmModeMoveCursor(fd,c->crtc,i*100, 0); > + sleep(1); > + } > + drmModeSetCursor(fd,c->crtc,0,64,64); > + gem_close(fd, cursor_handle); > + } > + > if (test_plane) > enable_plane(c); > =20 > @@ -931,7 +945,7 @@ static int update_display(void) > dump_planes(); > } > =20 > - if (test_preferred_mode || test_all_modes || force_mode) { > + if (test_preferred_mode || test_all_modes || force_mode || test_cursor)= { > /* Find any connected displays */ > for (c =3D 0; c < resources->count_connectors; c++) { > connectors[c].id =3D resources->connectors[c]; > @@ -944,11 +958,11 @@ static int update_display(void) > =20 > extern char *optarg; > extern int optind, opterr, optopt; > -static char optstr[] =3D "hiaf:s:d:pmt"; > +static char optstr[] =3D "hiaf:s:d:pmtc"; > =20 > static void usage(char *name) > { > - fprintf(stderr, "usage: %s [-hiafs]\n", name); > + fprintf(stderr, "usage: %s [-hiaf:s:d:pmtc]\n", name); > fprintf(stderr, "\t-i\tdump info\n"); > fprintf(stderr, "\t-a\ttest all modes\n"); > fprintf(stderr, "\t-s\t\tsleep between each mode test\n"); > @@ -959,6 +973,7 @@ static void usage(char *name) > fprintf(stderr, "\t-f\t,,,,,\n"); > fprintf(stderr, "\t\t,,,\n"); > fprintf(stderr, "\t\ttest force mode\n"); > + fprintf(stderr, "\t-c\ttest cursor\n"); > fprintf(stderr, "\tDefault is to test all modes.\n"); > exit(0); > } > @@ -1048,6 +1063,9 @@ int main(int argc, char **argv) > case 't': > enable_tiling =3D 1; > break; > + case 'c': > + test_cursor =3D 1; > + break; > default: > fprintf(stderr, "unknown option %c\n", c); > /* fall through */ > @@ -1057,7 +1075,7 @@ int main(int argc, char **argv) > } > } > if (!test_all_modes && !force_mode && !dump_info && > - !test_preferred_mode) > + !test_preferred_mode && !test_cursor) > test_all_modes =3D 1; > =20 > for (i =3D 0; i < ARRAY_SIZE(modules); i++) { Thanks, Paul --=-YdrcAlXJoMX+dZ1nRDsX Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEABECAAYFAk6ixGQACgkQPX1aK2wOHVifrwCfUazuYntp+tYB6WGJzHNhMfC/ q7MAnitXdJMvgsR/IB5i0D0MVMfVimc1 =FMb2 -----END PGP SIGNATURE----- --=-YdrcAlXJoMX+dZ1nRDsX-- --===============1156948888== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx --===============1156948888==--