From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Dmitry V. Levin" Subject: Re: [PATCH v4 5/5] drm: Add decoding of DRM and KMS ioctls Date: Wed, 9 Sep 2015 01:50:40 +0300 Message-ID: <20150908225040.GA32328@altlinux.org> References: <1440420170-13337-1-git-send-email-patrik.jakobsson@linux.intel.com> <1440420170-13337-6-git-send-email-patrik.jakobsson@linux.intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1704411548==" Return-path: Received: from pegasus3.altlinux.org (pegasus3.altlinux.org [194.107.17.103]) by gabe.freedesktop.org (Postfix) with ESMTP id 47D6C6EA21 for ; Tue, 8 Sep 2015 15:50:44 -0700 (PDT) In-Reply-To: <1440420170-13337-6-git-send-email-patrik.jakobsson@linux.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Patrik Jakobsson Cc: intel-gfx@lists.freedesktop.org, strace-devel@lists.sourceforge.net List-Id: intel-gfx@lists.freedesktop.org --===============1704411548== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3MwIy2ne0vdjdPXF" Content-Disposition: inline --3MwIy2ne0vdjdPXF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 24, 2015 at 02:42:50PM +0200, Patrik Jakobsson wrote: > First batch of drm / kms ioctls. Several comments in addition to issues similar to 4/5 patch. > +static int drm_mode_rm_fb(struct tcb *tcp, const unsigned int code, long= arg) > +{ > + unsigned int handle; > + > + > + if (entering(tcp)) { > + if (umove(tcp, arg, &handle)) > + return RVAL_DECODED; > + > + tprintf(", %u", handle); > + } > + > + return RVAL_DECODED | 1; > +} Use printnum_int instead: tprints(", "); printnum_int(tcp, arg, "%u"); return RVAL_DECODED | 1; > +static int drm_mode_create_dumb(struct tcb *tcp, const unsigned int code= , long arg) > +{ > + struct drm_mode_create_dumb dumb; > + > + if (umove(tcp, arg, &dumb)) > + return RVAL_DECODED; > + > + if (entering(tcp)) { > + tprintf(", {width=3D%u, height=3D%u, bpp=3D%u, flags=3D0x%x", > + dumb.width, dumb.height, dumb.bpp, dumb.flags); > + } else if (exiting(tcp)) { > + tprintf(", handle=3D%u, pitch=3D%u, size=3D%Lu}", dumb.handle, > + dumb.pitch, dumb.size); > + } > + > + return RVAL_DECODED | 1; > +} This generates a warning (which turns into an error with --enable-gcc-Werror) on x86_64 when using kernel drm headers: drm.c: In function 'drm_mode_create_dumb': drm.c:521:11: error: format '%Lu' expects argument of type 'long long unsig= ned int', but argument 4 has type 'uint64_t {aka long unsigned int}' [-Werr= or=3Dformat=3D] > @@ -112,6 +577,84 @@ int drm_ioctl(struct tcb *tcp, const unsigned int co= de, long arg) > if (drm_is_priv(tcp->u_arg[1])) { > if (verbose(tcp) && drm_is_driver(tcp, "i915")) > ret =3D drm_i915_ioctl(tcp, code, arg); > + } else { > + switch (code) { > + case DRM_IOCTL_VERSION: > + ret =3D drm_version(tcp, code, arg); > + break; Looks like the return code can be forwarded without further delays. --=20 ldv --3MwIy2ne0vdjdPXF Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlXvZkAACgkQfKvmrJ41Nh4xaACaAltdkzlBTFPxJ6RG+w5TaRBv j+8AoK8tUy3qFYL1A0SlsGRnAACCVXmh =LVol -----END PGP SIGNATURE----- --3MwIy2ne0vdjdPXF-- --===============1704411548== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KSW50ZWwtZ2Z4 IG1haWxpbmcgbGlzdApJbnRlbC1nZnhAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHA6Ly9saXN0 cy5mcmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9pbnRlbC1nZngK --===============1704411548==--