From patchwork Thu Aug 8 13:41:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 2841195 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 DA0AABF546 for ; Thu, 8 Aug 2013 14:04:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2C5DB20530 for ; Thu, 8 Aug 2013 14:04:17 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id EE69E2053C for ; Thu, 8 Aug 2013 14:04:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A63ADE736F for ; Thu, 8 Aug 2013 07:04:15 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ee0-f44.google.com (mail-ee0-f44.google.com [74.125.83.44]) by gabe.freedesktop.org (Postfix) with ESMTP id 9993DE67B1 for ; Thu, 8 Aug 2013 06:41:48 -0700 (PDT) Received: by mail-ee0-f44.google.com with SMTP id b47so1542340eek.3 for ; Thu, 08 Aug 2013 06:41:48 -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=LShrcQVRZo1oqQc1KvTG7275oniiKp9/+MRT3dZE7ow=; b=OX49OzQFccvWs5cVqI0ytSQkUvwNTcBJktiub/jvu2aUy7MEY367SwqT9tMhwY/PjJ fuY6bK6Vr3/vjkq8MKVWw8AUXCfGbnaM9cOr1wABkouMwJiIur6+IjwOKEt4lRcUvueU Ir8fhowjDAalQMNPyOkLYop4/yqAws5XEBOuY= 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=LShrcQVRZo1oqQc1KvTG7275oniiKp9/+MRT3dZE7ow=; b=CiAqdzwNhor1pWGftVRvhyW09sFd8+jR31qNa8u0WiTvRIRTHON9Pl5q12rIchidP0 nVRMpwVIR1tZoUoQRWlTQ90psIvl6FG98YHTSXiMNjTu87JRMwxwdimPBYeoBAov4gSc dlpMiNIF/7ISnUyASF5vGXy+mrx1Rmc+IBPHn+NdOpVe+ICYR+XAAjhVEAgjBLxnd6sD jqvaMa7x2YBioliAiNGpACID0nf+h5M14r62Tblr+tMzIjBIpTESmMdroU+cimij5u+C azcd7WvqM1SKyOutzhhVBurFjaavSfbdMrHz4wxRRhaj2uTTP1lHxTsqhtpDW5lklIM1 A0Yg== X-Gm-Message-State: ALoCoQlQfOix4I9SmOPx91fyd+XvdrLOgmP39NVacvvFSQoTpg5bLRVVriz2LEy3/wXgN9qdO3OI X-Received: by 10.15.68.200 with SMTP id w48mr2203958eex.144.1375969307889; Thu, 08 Aug 2013 06:41:47 -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.46 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 08 Aug 2013 06:41:47 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH 10/25] drm: disallow legacy dma ioctls for modesetting drivers Date: Thu, 8 Aug 2013 15:41:20 +0200 Message-Id: <1375969295-18929-11-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 Now only legacy ums drivers have the DRIVER_HAVE_DMA driver feature flag set, so strictly speaking the modesetting check is redundant. But adding it has the upside that it makes it very clear that the dma support is legacy stuff. Signed-off-by: Daniel Vetter --- drivers/gpu/drm/drm_bufs.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/gpu/drm/drm_bufs.c b/drivers/gpu/drm/drm_bufs.c index bef4abf..cccc25f 100644 --- a/drivers/gpu/drm/drm_bufs.c +++ b/drivers/gpu/drm/drm_bufs.c @@ -1305,6 +1305,9 @@ int drm_addbufs(struct drm_device *dev, void *data, struct drm_buf_desc *request = data; int ret; + if (drm_core_check_feature(dev, DRIVER_MODESET)) + return -EINVAL; + if (!drm_core_check_feature(dev, DRIVER_HAVE_DMA)) return -EINVAL; @@ -1348,6 +1351,9 @@ int drm_infobufs(struct drm_device *dev, void *data, int i; int count; + if (drm_core_check_feature(dev, DRIVER_MODESET)) + return -EINVAL; + if (!drm_core_check_feature(dev, DRIVER_HAVE_DMA)) return -EINVAL; @@ -1427,6 +1433,9 @@ int drm_markbufs(struct drm_device *dev, void *data, int order; struct drm_buf_entry *entry; + if (drm_core_check_feature(dev, DRIVER_MODESET)) + return -EINVAL; + if (!drm_core_check_feature(dev, DRIVER_HAVE_DMA)) return -EINVAL; @@ -1472,6 +1481,9 @@ int drm_freebufs(struct drm_device *dev, void *data, int idx; struct drm_buf *buf; + if (drm_core_check_feature(dev, DRIVER_MODESET)) + return -EINVAL; + if (!drm_core_check_feature(dev, DRIVER_HAVE_DMA)) return -EINVAL; @@ -1524,6 +1536,9 @@ int drm_mapbufs(struct drm_device *dev, void *data, struct drm_buf_map *request = data; int i; + if (drm_core_check_feature(dev, DRIVER_MODESET)) + return -EINVAL; + if (!drm_core_check_feature(dev, DRIVER_HAVE_DMA)) return -EINVAL;