From patchwork Mon Feb 24 21:14:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lemire X-Patchwork-Id: 3711891 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 5B4B7BF13A for ; Mon, 24 Feb 2014 21:14:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 90D722017E for ; Mon, 24 Feb 2014 21:14:50 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id BA6A120160 for ; Mon, 24 Feb 2014 21:14:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 55CA9FAC26; Mon, 24 Feb 2014 13:14:43 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mtxmxout3.matrox.com (mtxmxout3.matrox.com [138.11.2.93]) by gabe.freedesktop.org (Postfix) with ESMTP id 9564FFAC20 for ; Mon, 24 Feb 2014 13:14:41 -0800 (PST) Received: from venus.matrox.com (unknown [192.168.1.36]) by mtxmxout3.matrox.com (Postfix) with ESMTP id F3CEF70B64 for ; Mon, 24 Feb 2014 16:14:40 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=matrox.com; s=dkim; t=1393276481; bh=FIJstqfoiooOEsJ1t1f/wb2AIIHsAX2ydxDXhYbUu9U=; h=From:Subject:To:Cc:Date; b=Ev+yvVzDD0dxmqas8v6S3Vet+1Q0v58lDI0l1UbvZ9WGBUEA6SZYNDA3Eih+dw7jG 1JS2Cfn8x24+E/VTTvnBiD02SfHUKOMdped2b5fIRENXXsF7qZ5c0HFzpcsSKofMRG edtpH9o5MrYxOWnoKPtDkhF7vmO6cvNhoYvb/ItU= Received: (from ssmsp@localhost) by venus.matrox.com (8.14.6/8.13.2) id s1OLEeLo013708 for dri-devel@lists.freedesktop.org; Mon, 24 Feb 2014 16:14:40 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by venus.matrox.com (Postfix) with ESMTP id DB3505F765 for ; Mon, 24 Feb 2014 16:14:40 -0500 (EST) X-Virus-MTX-Scanned: by Matrox Virus scanner at venus.matrox.com Received: from venus.matrox.com ([127.0.0.1]) by localhost (venus.matrox.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id OF5bKEQgZEOq for ; Mon, 24 Feb 2014 16:14:40 -0500 (EST) Received: from venus-in.matrox.com (localhost.localdomain [127.0.0.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by venus.matrox.com (Postfix) with ESMTPS id CA3495F757 for ; Mon, 24 Feb 2014 16:14:40 -0500 (EST) Received: from matrox.com (dyn-152-76.matrox.com [192.168.152.76]) by venus-in.matrox.com (Postfix) with ESMTP id C7BC361BB8; Mon, 24 Feb 2014 16:14:40 -0500 (EST) Message-Id: <48f006a143feb34fdbaeb489a9c9eaf163d017d6.1393253082.git.jlemire@matrox.com> From: Julia Lemire Subject: [PATCH 1/2] drm/mgag200: Added the hwcursor parameter to turn hardware cursor on/off. To: dri-devel@lists.freedesktop.org Date: Mon, 24 Feb 2014 16:14:40 -0500 (EST) Cc: Mathieu Larouche 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=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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 The hwcursor parameter is a boolean variable. When set to true, the hardware cursor is enabled. When set to false, it is disabled. Signed-off-by: Julia Lemire --- drivers/gpu/drm/mgag200/mgag200_cursor.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/gpu/drm/mgag200/mgag200_cursor.c b/drivers/gpu/drm/mgag200/mgag200_cursor.c index 9f9780b..c9a94a6 100644 --- a/drivers/gpu/drm/mgag200/mgag200_cursor.c +++ b/drivers/gpu/drm/mgag200/mgag200_cursor.c @@ -10,9 +10,17 @@ #include #include "mgag200_drv.h" +#include + +static bool hwcursor = true; static bool warn_transparent = true; static bool warn_palette = true; +static bool warn_user_input = true; + +module_param(hwcursor, bool, 0644); +MODULE_PARM_DESC(hwcursor, "When true, the hardware cursor is enabled. When false, it is disabled."); + /* Hide the cursor off screen. We can't disable the cursor hardware because it @@ -90,6 +98,16 @@ int mga_crtc_cursor_set(struct drm_crtc *crtc, goto out1; } + if (!hwcursor) { + if (warn_user_input) { + dev_info(&dev->pdev->dev, "User disabled hardware cursor.\n"); + warn_user_input = false; + } + mga_hide_cursor(mdev); + ret = -EINVAL; + goto out1; + } + /* Move cursor buffers into VRAM if they aren't already */ if (!pixels_1->pin_count) { ret = mgag200_bo_pin(pixels_1, TTM_PL_FLAG_VRAM,