From patchwork Thu Sep 6 05:19:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haneen Mohammed X-Patchwork-Id: 10590121 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 23C7B13BB for ; Thu, 6 Sep 2018 09:10:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 042972A2F1 for ; Thu, 6 Sep 2018 09:10:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ECD852A2FE; Thu, 6 Sep 2018 09:10:18 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 AA04D2A2F1 for ; Thu, 6 Sep 2018 09:10:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E28006E625; Thu, 6 Sep 2018 09:10:04 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qt0-x244.google.com (mail-qt0-x244.google.com [IPv6:2607:f8b0:400d:c0d::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 06A7D6E5C8 for ; Thu, 6 Sep 2018 05:19:15 +0000 (UTC) Received: by mail-qt0-x244.google.com with SMTP id x7-v6so10928677qtk.5 for ; Wed, 05 Sep 2018 22:19:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ZY/Rxwzguv9lTcrr39nP7fK7UisY/Zox3Oks/6KTtMo=; b=DotmWJah2Yt42DMCnMqfpUT3t8LyvDIYTByASXZIs/jDDsKAxtPU8vFaP7Eq6C3Ybe mPTM4dPT0ab1ZDqbLKyu0toLtg7qqLXKz7QHJFS1IEnHkEBLPDRFsfyTcHSH8jXnjrl/ f7l+PRnK1/28ZXYowM9NdYCxPU4eP7UAG08uJYYgpWESJfWwuIBHSn1zd03X4yhhmi3l /Sp6JF995A90qYL3LKjtA53t5XeMQviciDgvJhu3JE+qHrdocU6udph+pA8BaaLy8edI 3OhIxIo2/vRw4Wo02YxKd0GvSrqAnBaFiMX9YXVQPd4vOH9u4AcNZ7D9JFufSArTj8is 5+Kg== X-Gm-Message-State: APzg51DC4/7sMGckQMItAWlCRkqGRMqSvmBvKJRkYwUXSw2RXLD5DbJk tyO3YaXyB5caYvMXo13OBqV96t3o X-Google-Smtp-Source: ANB0VdY1Y16rhG/FFJUOmEyRjeIOqCLua02G+YEwJYvJou3BG3ut9oaI2ckb7TDfbOKDe/oZEhnsXQ== X-Received: by 2002:ac8:fe7:: with SMTP id f36-v6mr752278qtk.63.1536211153987; Wed, 05 Sep 2018 22:19:13 -0700 (PDT) Received: from haneenDRM (dyn-160-39-42-212.dyn.columbia.edu. [160.39.42.212]) by smtp.gmail.com with ESMTPSA id w63-v6sm2038899qkc.52.2018.09.05.22.19.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Sep 2018 22:19:13 -0700 (PDT) Date: Thu, 6 Sep 2018 08:19:11 +0300 From: Haneen Mohammed To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 3/3] drm/vkms: Enable/Disable cursor support with module option Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Mailman-Approved-At: Thu, 06 Sep 2018 09:10:03 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: hamohammed.sa@gmail.com, seanpaul@chromium.org, rodrigosiqueiramelo@gmail.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Cursor support is not complete yet. Add module option 'enable_cursor' to enable/disable cursor support which is used for testing currently. Signed-off-by: Haneen Mohammed --- drivers/gpu/drm/vkms/vkms_drv.c | 4 ++++ drivers/gpu/drm/vkms/vkms_drv.h | 2 ++ drivers/gpu/drm/vkms/vkms_output.c | 13 ++++++++----- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/vkms/vkms_drv.c b/drivers/gpu/drm/vkms/vkms_drv.c index bd9d4b2389bd..2d49ad31ad0b 100644 --- a/drivers/gpu/drm/vkms/vkms_drv.c +++ b/drivers/gpu/drm/vkms/vkms_drv.c @@ -21,6 +21,10 @@ static struct vkms_device *vkms_device; +bool enable_cursor; +module_param_named(enable_cursor, enable_cursor, bool, 0444); +MODULE_PARM_DESC(enable_cursor, "Enable/Disable cursor support"); + static const struct file_operations vkms_driver_fops = { .owner = THIS_MODULE, .open = drm_open, diff --git a/drivers/gpu/drm/vkms/vkms_drv.h b/drivers/gpu/drm/vkms/vkms_drv.h index c9723c069ebf..1c93990693e3 100644 --- a/drivers/gpu/drm/vkms/vkms_drv.h +++ b/drivers/gpu/drm/vkms/vkms_drv.h @@ -16,6 +16,8 @@ #define XRES_MAX 8192 #define YRES_MAX 8192 +extern bool enable_cursor; + static const u32 vkms_formats[] = { DRM_FORMAT_XRGB8888, }; diff --git a/drivers/gpu/drm/vkms/vkms_output.c b/drivers/gpu/drm/vkms/vkms_output.c index 19f9ffcbf9eb..271a0eb9042c 100644 --- a/drivers/gpu/drm/vkms/vkms_output.c +++ b/drivers/gpu/drm/vkms/vkms_output.c @@ -56,10 +56,12 @@ int vkms_output_init(struct vkms_device *vkmsdev) if (IS_ERR(primary)) return PTR_ERR(primary); - cursor = vkms_plane_init(vkmsdev, DRM_PLANE_TYPE_CURSOR); - if (IS_ERR(cursor)) { - ret = PTR_ERR(cursor); - goto err_cursor; + if (enable_cursor) { + cursor = vkms_plane_init(vkmsdev, DRM_PLANE_TYPE_CURSOR); + if (IS_ERR(cursor)) { + ret = PTR_ERR(cursor); + goto err_cursor; + } } ret = vkms_crtc_init(dev, crtc, primary, cursor); @@ -112,7 +114,8 @@ int vkms_output_init(struct vkms_device *vkmsdev) drm_crtc_cleanup(crtc); err_crtc: - drm_plane_cleanup(cursor); + if (enable_cursor) + drm_plane_cleanup(cursor); err_cursor: drm_plane_cleanup(primary);