From patchwork Fri Apr 22 01:36:24 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ole Henrik Jahren X-Patchwork-Id: 727581 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3MGEDcs027201 for ; Fri, 22 Apr 2011 16:14:33 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 39A419F0FE for ; Fri, 22 Apr 2011 09:14:11 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from hylle01.itea.ntnu.no (hylle01.itea.ntnu.no [129.241.56.100]) by gabe.freedesktop.org (Postfix) with ESMTP id A38579E78A for ; Thu, 21 Apr 2011 18:34:45 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by hylle01.itea.ntnu.no (Postfix) with ESMTP id EFF5131E05E; Fri, 22 Apr 2011 03:34:42 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at hylle01.itea.ntnu.no Received: from kontakt.itea.ntnu.no (kontakt.itea.ntnu.no [129.241.18.25]) by hylle01.itea.ntnu.no (Postfix) with ESMTP id CDB3131E01C; Fri, 22 Apr 2011 03:34:40 +0200 (CEST) Received: from siv.localdomain (unknown [82.194.219.209]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: olehenja) by kontakt.itea.ntnu.no (Postfix) with ESMTPSA id B10D84A095E; Fri, 22 Apr 2011 03:34:40 +0200 (CEST) Received: by siv.localdomain (Postfix, from userid 1000) id 9768B600039; Fri, 22 Apr 2011 03:36:24 +0200 (CEST) Date: Fri, 22 Apr 2011 03:36:24 +0200 From: Ole Henrik Jahren To: Daniel Vetter Subject: [PATCH] drm/i915: Fix typo in DRM_I915_OVERLAY_PUT_IMAGE ioctl define Message-ID: <20110422013624.GA25852@siv.localdomain> References: <20110412041018.GC17720@siv.localdomain> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-PGP-Key: http://folk.ntnu.no/olehenja/files/pubkey.asc User-Agent: Mutt/1.5.21 (2010-09-15) X-Mailman-Approved-At: Fri, 22 Apr 2011 09:14:02 -0700 Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 22 Apr 2011 16:14:33 +0000 (UTC) Calling ioctl with DRM_IOCTL_I915_OVERLAY_PUT_IMAGE is broken if the macro is used directly, because the define contains a typo. When using libdrm you do not hit the bug, since libdrm handles the ioctl encoding internally. The typo also leads to the .cmd and .cmd_drv fields of the drm_ioctl structure for DRM_I915_OVERLAY_PUT_IMAGE having inconsistent content. Signed-off-by: Ole Henrik Jahren Cc: Chris Wilson Acked-by: Daniel Vetter --- Included a bit more explanation about the problem. The impact of the inconsistency between .cmd and .cmd_drv does not seem to have any impact, since the only thing .cmd_drv seems to be used for is calculating the size of the copy_from_user() buffer. It incidentally result in the same size both with and without this patch (at least on 64bit). include/drm/i915_drm.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h index 0039f1f..ca7b8af 100644 --- a/include/drm/i915_drm.h +++ b/include/drm/i915_drm.h @@ -237,7 +237,7 @@ typedef struct _drm_i915_sarea { #define DRM_IOCTL_I915_GEM_GET_APERTURE DRM_IOR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_APERTURE, struct drm_i915_gem_get_aperture) #define DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GET_PIPE_FROM_CRTC_ID, struct drm_i915_get_pipe_from_crtc_id) #define DRM_IOCTL_I915_GEM_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MADVISE, struct drm_i915_gem_madvise) -#define DRM_IOCTL_I915_OVERLAY_PUT_IMAGE DRM_IOW(DRM_COMMAND_BASE + DRM_IOCTL_I915_OVERLAY_ATTRS, struct drm_intel_overlay_put_image) +#define DRM_IOCTL_I915_OVERLAY_PUT_IMAGE DRM_IOW(DRM_COMMAND_BASE + DRM_I915_OVERLAY_PUT_IMAGE, struct drm_intel_overlay_put_image) #define DRM_IOCTL_I915_OVERLAY_ATTRS DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_OVERLAY_ATTRS, struct drm_intel_overlay_attrs) /* Allow drivers to submit batchbuffers directly to hardware, relying