From patchwork Fri Feb 21 07:55:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 3694881 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E27DC9F1EE for ; Fri, 21 Feb 2014 07:55:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DFDB220145 for ; Fri, 21 Feb 2014 07:55:55 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 17D5A20142 for ; Fri, 21 Feb 2014 07:55:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C4E28FB424; Thu, 20 Feb 2014 23:55:46 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-bk0-f53.google.com (mail-bk0-f53.google.com [209.85.214.53]) by gabe.freedesktop.org (Postfix) with ESMTP id 989F1FB425 for ; Thu, 20 Feb 2014 23:55:37 -0800 (PST) Received: by mail-bk0-f53.google.com with SMTP id my13so934372bkb.26 for ; Thu, 20 Feb 2014 23:55:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=io/tLduDw3YTjSo/fwal2n+EMMEnSDVVHDY9OtmXOWY=; b=LmyAVht1S6PYdQcCfIXfX8d0JH+psXNzkYjNK8dBc17BUZZFVM5R67K284ExyTlHre oPOss/dC2ngfWvVc76ISf7EGvbT5q/tjNzbRgaeXgIAl07lzgNfM0MK1hIMAsBK99ESZ l08TD4SgwxEC8aM2K046viSdo9k8ZP+s4aUQtx/K3WV9rYA7HvZ4kQFaa0N3LB0R8/ep wjpt46AwlUOHvBqJ+ttFn70bgrHwhdAcFm8r+Jvj6J5s023B/GyniRuCb3dADPu09Qjn tcXDBxoEtlGhaBZtR2G8M6RxPhgyUdftGkFO8jzKhk/4q4JzCL4frXy3y2lfZrlwmTdv ENCw== X-Received: by 10.204.104.193 with SMTP id q1mr1559375bko.6.1392969333617; Thu, 20 Feb 2014 23:55:33 -0800 (PST) Received: from localhost (port-15573.pppoe.wtnet.de. [84.46.61.18]) by mx.google.com with ESMTPSA id bh9sm6013985bkb.16.2014.02.20.23.55.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Feb 2014 23:55:33 -0800 (PST) From: Thierry Reding To: dri-devel@lists.freedesktop.org Subject: [RFC 02/12] drm: Introduce DRIVER_LEGACY feature Date: Fri, 21 Feb 2014 08:55:18 +0100 Message-Id: <1392969328-23133-3-git-send-email-thierry.reding@gmail.com> X-Mailer: git-send-email 1.8.4.2 In-Reply-To: <1392969328-23133-1-git-send-email-thierry.reding@gmail.com> References: <1392969328-23133-1-git-send-email-thierry.reding@gmail.com> 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@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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 From: Thierry Reding Currently drivers that set the DRIVER_MODESET feature are considered to be non-legacy drivers. At the same time DRIVER_MODESET implies that the mode-setting IOCTLs are available. It is therefore not possible to distinguish between a non-legacy driver with full mode-setting support and a non-legacy driver without mode-setting functionality. To separate the meaning of "legacy" and "modeset", a new driver feature is introduced: DRIVER_LEGACY. The meaning of DRIVER_MODESET can then be changed to apply to the mode-setting functionality only, irrespective of whether it is legacy or not. Mark all legacy drivers appropriately. Signed-off-by: Thierry Reding --- drivers/gpu/drm/i810/i810_drv.c | 3 ++- drivers/gpu/drm/mga/mga_drv.c | 3 ++- drivers/gpu/drm/radeon/radeon_drv.c | 3 ++- drivers/gpu/drm/savage/savage_drv.c | 2 +- drivers/gpu/drm/sis/sis_drv.c | 2 +- drivers/gpu/drm/tdfx/tdfx_drv.c | 1 + drivers/gpu/drm/via/via_drv.c | 2 +- include/drm/drmP.h | 1 + 8 files changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i810/i810_drv.c b/drivers/gpu/drm/i810/i810_drv.c index 441ccf8f5bdc..fb21abfba414 100644 --- a/drivers/gpu/drm/i810/i810_drv.c +++ b/drivers/gpu/drm/i810/i810_drv.c @@ -58,7 +58,8 @@ static const struct file_operations i810_driver_fops = { static struct drm_driver driver = { .driver_features = DRIVER_USE_AGP | - DRIVER_HAVE_DMA, + DRIVER_HAVE_DMA | + DRIVER_LEGACY, .dev_priv_size = sizeof(drm_i810_buf_priv_t), .load = i810_driver_load, .lastclose = i810_driver_lastclose, diff --git a/drivers/gpu/drm/mga/mga_drv.c b/drivers/gpu/drm/mga/mga_drv.c index 6b1a87c8aac5..0bd929e38d99 100644 --- a/drivers/gpu/drm/mga/mga_drv.c +++ b/drivers/gpu/drm/mga/mga_drv.c @@ -59,7 +59,8 @@ static const struct file_operations mga_driver_fops = { static struct drm_driver driver = { .driver_features = DRIVER_USE_AGP | DRIVER_PCI_DMA | - DRIVER_HAVE_DMA | DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED, + DRIVER_HAVE_DMA | DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | + DRIVER_LEGACY, .dev_priv_size = sizeof(drm_mga_buf_priv_t), .load = mga_driver_load, .unload = mga_driver_unload, diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c index 84a1bbb75f91..5afa997bab00 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.c +++ b/drivers/gpu/drm/radeon/radeon_drv.c @@ -292,7 +292,8 @@ static const struct file_operations radeon_driver_old_fops = { static struct drm_driver driver_old = { .driver_features = DRIVER_USE_AGP | DRIVER_PCI_DMA | DRIVER_SG | - DRIVER_HAVE_IRQ | DRIVER_HAVE_DMA | DRIVER_IRQ_SHARED, + DRIVER_HAVE_IRQ | DRIVER_HAVE_DMA | DRIVER_IRQ_SHARED | + DRIVER_LEGACY, .dev_priv_size = sizeof(drm_radeon_buf_priv_t), .load = radeon_driver_load, .firstopen = radeon_driver_firstopen, diff --git a/drivers/gpu/drm/savage/savage_drv.c b/drivers/gpu/drm/savage/savage_drv.c index 3c030216e888..bedb800eb7d0 100644 --- a/drivers/gpu/drm/savage/savage_drv.c +++ b/drivers/gpu/drm/savage/savage_drv.c @@ -50,7 +50,7 @@ static const struct file_operations savage_driver_fops = { static struct drm_driver driver = { .driver_features = - DRIVER_USE_AGP | DRIVER_HAVE_DMA | DRIVER_PCI_DMA, + DRIVER_USE_AGP | DRIVER_HAVE_DMA | DRIVER_PCI_DMA | DRIVER_LEGACY, .dev_priv_size = sizeof(drm_savage_buf_priv_t), .load = savage_driver_load, .firstopen = savage_driver_firstopen, diff --git a/drivers/gpu/drm/sis/sis_drv.c b/drivers/gpu/drm/sis/sis_drv.c index 756f787b7143..402f10b58d57 100644 --- a/drivers/gpu/drm/sis/sis_drv.c +++ b/drivers/gpu/drm/sis/sis_drv.c @@ -102,7 +102,7 @@ static void sis_driver_postclose(struct drm_device *dev, struct drm_file *file) } static struct drm_driver driver = { - .driver_features = DRIVER_USE_AGP, + .driver_features = DRIVER_USE_AGP | DRIVER_LEGACY, .load = sis_driver_load, .unload = sis_driver_unload, .open = sis_driver_open, diff --git a/drivers/gpu/drm/tdfx/tdfx_drv.c b/drivers/gpu/drm/tdfx/tdfx_drv.c index 3492ca5c46d3..fc61c476ff49 100644 --- a/drivers/gpu/drm/tdfx/tdfx_drv.c +++ b/drivers/gpu/drm/tdfx/tdfx_drv.c @@ -55,6 +55,7 @@ static const struct file_operations tdfx_driver_fops = { }; static struct drm_driver driver = { + .features = DRIVER_LEGACY, .fops = &tdfx_driver_fops, .name = DRIVER_NAME, .desc = DRIVER_DESC, diff --git a/drivers/gpu/drm/via/via_drv.c b/drivers/gpu/drm/via/via_drv.c index 50abc2adfaee..c16ca40b8e07 100644 --- a/drivers/gpu/drm/via/via_drv.c +++ b/drivers/gpu/drm/via/via_drv.c @@ -73,7 +73,7 @@ static const struct file_operations via_driver_fops = { static struct drm_driver driver = { .driver_features = DRIVER_USE_AGP | DRIVER_HAVE_IRQ | - DRIVER_IRQ_SHARED, + DRIVER_IRQ_SHARED | DRIVER_LEGACY, .load = via_driver_load, .unload = via_driver_unload, .open = via_driver_open, diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 92604c435ecc..3aafb2d2471a 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -147,6 +147,7 @@ int drm_err(const char *func, const char *format, ...); #define DRIVER_MODESET 0x2000 #define DRIVER_PRIME 0x4000 #define DRIVER_RENDER 0x8000 +#define DRIVER_LEGACY 0x10000 #define DRIVER_BUS_PCI 0x1 #define DRIVER_BUS_PLATFORM 0x2