From patchwork Thu Aug 8 13:41:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 2841176 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 50D1BBF546 for ; Thu, 8 Aug 2013 13:59:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 377CE204AD for ; Thu, 8 Aug 2013 13:59:24 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 150DF204CF for ; Thu, 8 Aug 2013 13:59:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D94DEE708E for ; Thu, 8 Aug 2013 06:59:22 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ee0-f49.google.com (mail-ee0-f49.google.com [74.125.83.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 7199FE6798 for ; Thu, 8 Aug 2013 06:41:45 -0700 (PDT) Received: by mail-ee0-f49.google.com with SMTP id d41so1506685eek.36 for ; Thu, 08 Aug 2013 06:41:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+Cl16cVZPoU1qcPWu2ZcB3hhbHwMjh08RfBragR4tqw=; b=hilIB4jixHg2HG53TqTsm5q5UsbCeBDCLrAKI7sgdbs6pg4sV5MQPuc2iSCgJqYZM3 7n1eZ2qSKlTA13GqSnUiBKLVilUsZozy06v3bbSgfXhD3iuysyVWLVESC05fHY3FmyK6 smsBtjzg1jDfw+cZDDNDqtMlUp6RrvSUkYZ80= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=+Cl16cVZPoU1qcPWu2ZcB3hhbHwMjh08RfBragR4tqw=; b=Ml+q3xKYW9OVdytbcIufvs7zaivd6vqX+g/gLfeVwd6TPTAU/J1HnDfeqQ3l/tUGOU 9f4X2QGoOWkixlHTV+UNJAPgIaUo1t8vxNeQAMJ9+B+RvmRUWZtEmj+KYE9pnnhEH4lN cUXRTPet81ADY638Tff8Xk2bmhzx/mWymnPXGP/dm2QHdGJpfrPBJ/TvQaJwNwSz86+3 tHsJI/jpkEAXJ/OVvckcuuJ0A763S5D7rzS/qsUHV2/g6ZYuTv177zSIK5eIebkyssDt MiFqN62VkAYTrCxr72g3m//0buQLWR9t8nzbQlQ8VaQoxLcjngXtBXzxnPorJ1e6eqdi M2mA== X-Gm-Message-State: ALoCoQmEvzzAqYM7xzGDuX0xi8D2psrvLzTlVW25zuLxyFURt5B5vmUbDBTiQ0ott0VBU/ExO5NF X-Received: by 10.14.212.6 with SMTP id x6mr8261650eeo.67.1375969304497; Thu, 08 Aug 2013 06:41:44 -0700 (PDT) Received: from phenom.ffwll.local (178-83-130-250.dynamic.hispeed.ch. [178.83.130.250]) by mx.google.com with ESMTPSA id bn13sm19282226eeb.11.2013.08.08.06.41.43 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 08 Aug 2013 06:41:43 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH 08/25] drm: disallow legacy sg ioctls for modesetting drivers Date: Thu, 8 Aug 2013 15:41:18 +0200 Message-Id: <1375969295-18929-9-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1375969295-18929-1-git-send-email-daniel.vetter@ffwll.ch> References: <1375969295-18929-1-git-send-email-daniel.vetter@ffwll.ch> Cc: Daniel Vetter X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 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-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Only the radeon/r128/ati ums drivers use this. Furthermore the cleanup was already only done for UMS drivers. Also a quick check of the ATI ddx git history shows that only the UMS code ever used this facility. So we can safely disallow these pair of ioctls for modesetting drivers. Signed-off-by: Daniel Vetter --- drivers/gpu/drm/drm_scatter.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/drm_scatter.c b/drivers/gpu/drm/drm_scatter.c index dd8a648..1c78406 100644 --- a/drivers/gpu/drm/drm_scatter.c +++ b/drivers/gpu/drm/drm_scatter.c @@ -87,6 +87,9 @@ int drm_sg_alloc(struct drm_device *dev, void *data, DRM_DEBUG("\n"); + if (drm_core_check_feature(dev, DRIVER_MODESET)) + return -EINVAL; + if (!drm_core_check_feature(dev, DRIVER_SG)) return -EINVAL; @@ -197,6 +200,9 @@ int drm_sg_free(struct drm_device *dev, void *data, struct drm_scatter_gather *request = data; struct drm_sg_mem *entry; + if (drm_core_check_feature(dev, DRIVER_MODESET)) + return -EINVAL; + if (!drm_core_check_feature(dev, DRIVER_SG)) return -EINVAL;