From patchwork Tue Sep 13 21:20:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Kristian_H=C3=B8gsberg?= X-Patchwork-Id: 9329973 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 54ABA607FD for ; Tue, 13 Sep 2016 21:21:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 473DD296E8 for ; Tue, 13 Sep 2016 21:21:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3AF1A2979F; Tue, 13 Sep 2016 21:21:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D0115296E8 for ; Tue, 13 Sep 2016 21:21:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 15F2089E01; Tue, 13 Sep 2016 21:20:51 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pa0-x244.google.com (mail-pa0-x244.google.com [IPv6:2607:f8b0:400e:c03::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id E11AB6E3EA for ; Tue, 13 Sep 2016 21:20:48 +0000 (UTC) Received: by mail-pa0-x244.google.com with SMTP id h5so82939pao.0 for ; Tue, 13 Sep 2016 14:20:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=CWa6WXpIaW7sSheJFrTCUXC2Tx680VhMhCtZKuj7aBc=; b=Rd+eKXeYcaH2jcDu4r5NjEHHnS3jLRFuJp/2aaKM4YKnevyRtAp3R1Srv7fwhjhcoo HGDDj6O2N9vFcqnVADJozS7LNfev4DB9WJcsidneXsv7f4KzJ+bmarOqk4qsb+qgPz8y PFwlu0CFGErc9WpyNrnjzSjDAVArxZjEWgu/lZNn2WP6V4/Spwkeo6Wjgrtc/hs4ffzu FNxTUNw1eVThvHIecnZI8Q+zLmy0hEtL3joiK9Ci55/3UO1Wb3ndlBTWtMV3Otz2hUa0 tWUg1yJOm7pRjza/9I5FyTNQC7WwS+r+I3SlFWlDV1DXWWPt6h4JVarRPtqpsqcIgcBx SYrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=CWa6WXpIaW7sSheJFrTCUXC2Tx680VhMhCtZKuj7aBc=; b=SwxQpcWk+MI9tx+tloEJVPI91DnEewK2WJmRjr4rsoEKkrA1Kz4nzixEPMDFuw5AMK kEDEK+hE04GW/8zaaKWeDifc7Bl/eEhycgZ+8DlpU0x7l9sQeNb99rIQNTOwSoVagv/R XqH5liwUx3pAhuAR3YSAcgikC70nRrj3tkfGRhUubRS2jMbfX7yTSbaYFItLFAmYQz5k zXir678TmxgXAboRqkcUZtqvZkCgN9FgF/Z2owgNdh9Dzmhz/atRqGssy55KPROqgPc0 7uiE8X4wy3sOinKYWkk6qXbHcIkfu9dCyZUKkTpO9jNIMdmHd52RGlgaiRkjR2lV2zsZ X/qA== X-Gm-Message-State: AE9vXwPsIuxzm3/f+RCxbHWgJAd565Hd/zLWf+Chb2jDTbexGWO1zYLS8ghbLTugdLY7HA== X-Received: by 10.66.7.8 with SMTP id f8mr4934751paa.91.1473801647953; Tue, 13 Sep 2016 14:20:47 -0700 (PDT) Received: from hawkmoon.pdx.corp.google.com ([100.118.88.18]) by smtp.gmail.com with ESMTPSA id cp11sm461737pac.28.2016.09.13.14.20.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 13 Sep 2016 14:20:47 -0700 (PDT) From: "Kristian H. Kristensen" X-Google-Original-From: "Kristian H. Kristensen" To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm: Only use compat ioctl for addfb2 on X86/IA64 Date: Tue, 13 Sep 2016 14:20:45 -0700 Message-Id: <1473801645-116011-1-git-send-email-hoegsberg@chromium.org> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 Cc: "Kristian H. Kristensen" X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Similar to struct drm_update_draw, struct drm_mode_fb_cmd2 has an unaligned 64 bit field (modifier). This get packed differently between 32 bit and 64 bit modes on architectures that can handle unaligned 64 bit access (X86 and IA64). Other architectures pack the structs the same and don't need the compat wrapper. Use the same condition for drm_mode_fb_cmd2 as we use for drm_update_draw. Signed-off-by: Kristian H. Kristensen Reviewed-by: Rob Clark --- drivers/gpu/drm/drm_ioc32.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/drm_ioc32.c b/drivers/gpu/drm/drm_ioc32.c index 57676f8..a628975 100644 --- a/drivers/gpu/drm/drm_ioc32.c +++ b/drivers/gpu/drm/drm_ioc32.c @@ -1015,6 +1015,7 @@ static int compat_drm_wait_vblank(struct file *file, unsigned int cmd, return 0; } +#if defined(CONFIG_X86) || defined(CONFIG_IA64) typedef struct drm_mode_fb_cmd232 { u32 fb_id; u32 width; @@ -1071,6 +1072,7 @@ static int compat_drm_mode_addfb2(struct file *file, unsigned int cmd, return 0; } +#endif static drm_ioctl_compat_t *drm_compat_ioctls[] = { [DRM_IOCTL_NR(DRM_IOCTL_VERSION32)] = compat_drm_version, @@ -1104,7 +1106,9 @@ static drm_ioctl_compat_t *drm_compat_ioctls[] = { [DRM_IOCTL_NR(DRM_IOCTL_UPDATE_DRAW32)] = compat_drm_update_draw, #endif [DRM_IOCTL_NR(DRM_IOCTL_WAIT_VBLANK32)] = compat_drm_wait_vblank, +#if defined(CONFIG_X86) || defined(CONFIG_IA64) [DRM_IOCTL_NR(DRM_IOCTL_MODE_ADDFB232)] = compat_drm_mode_addfb2, +#endif }; /**