From patchwork Tue Jul 19 18:58:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Kleiner X-Patchwork-Id: 9238153 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6EE0B600CB for ; Tue, 19 Jul 2016 19:00:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 57D0C26A4D for ; Tue, 19 Jul 2016 19:00:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4CB1926D19; Tue, 19 Jul 2016 19:00:55 +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=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB37926E81 for ; Tue, 19 Jul 2016 19:00:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 04DA36E37E; Tue, 19 Jul 2016 19:00:52 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 406656E024 for ; Tue, 19 Jul 2016 18:59:40 +0000 (UTC) Received: by mail-wm0-x241.google.com with SMTP id o80so3820897wme.0 for ; Tue, 19 Jul 2016 11:59:40 -0700 (PDT) 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=DfIJ2JKjs3M5tZ+rbkfZvXJy1SPjssrce8Qpc6lbEno=; b=LWzPmpXAGHDFHfHINjlob5wBUiI8gD3UKTxrBD5GqtBWvQEjHCuQTqZJiUO4R7yMvf Yt26eVjG4MBAbdwGH+QCN8UrcCyhqP8j7BrKg+zwkGzO6YUm+YxwWz92l45RwAQGwPhU D29FOvM++sj9v99Rr27YRJGEpOJ4kQSmkRPFW7OvzMbQ1e0VwQZ+97D8EWqUr5U+xZv2 5bKjaOGTmcNwjv/HpEAF1CnTCmiP+TpjCjbBeaUR7mw0U5KEpqkMSaZRaJUekll9M8lz 314/wqs7SCfTWMkkUp0q4lBEqsAbtiVm+xOTdwUWfagNxV6BQafvw9s7UiKFFadI/a7i P1cA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=DfIJ2JKjs3M5tZ+rbkfZvXJy1SPjssrce8Qpc6lbEno=; b=j5J3exVd1EYNHTUc9eEuq1e0+lSHk9nAJCmQf3/CIuRPMbC9SBebqh4BXX/+lV6a/k tSwGLNAm/sAf7yPp/1Nno+QxKACPgorhMAEFoaJxNlagkb5XcTZaLdLp3PxV0CIQzaqv N2WynuUEOILGTldwux0xSXw/XwrLMjPmzbR8JzFrCWrKE+0HsZNb+82+ELLPqVgOOb1f C0Un1MYO30VV83k0+G/zKRvEPBLXvxfmJ/pXm/mFr6EWtAnWrcsLfw4y7eUzSPXja/3w qc+CBLusaazifCoBpf0XA7XiSJMxw1WvDdQ4MvHTJlvH7UmNa67QLVvPu58RdqMONKLF /ppg== X-Gm-Message-State: ALyK8tK5/5Hb0Aws8ns8L9J+L8i/ANfl9DRkrygpNyOslGqNG7nLTeTVOSrhpoWWEjyIBQ== X-Received: by 10.28.210.5 with SMTP id j5mr6523781wmg.67.1468954776745; Tue, 19 Jul 2016 11:59:36 -0700 (PDT) Received: from twisty.fritz.box (x4d02e19a.dyn.telefonica.de. [77.2.225.154]) by smtp.gmail.com with ESMTPSA id i8sm7755380wmg.21.2016.07.19.11.59.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Jul 2016 11:59:36 -0700 (PDT) From: Mario Kleiner To: dri-devel@lists.freedesktop.org Subject: [PATCH 3/5] drm/vc4: Reject doublescan modes. Date: Tue, 19 Jul 2016 20:58:59 +0200 Message-Id: <1468954741-30993-4-git-send-email-mario.kleiner.de@gmail.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1468954741-30993-1-git-send-email-mario.kleiner.de@gmail.com> References: <1468954741-30993-1-git-send-email-mario.kleiner.de@gmail.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP We can't handle doublescan modes at the moment, so if userspace tries to set one, reject the mode set. Signed-off-by: Mario Kleiner Cc: Eric Anholt --- drivers/gpu/drm/vc4/vc4_crtc.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c index a479d3d..2bfa247 100644 --- a/drivers/gpu/drm/vc4/vc4_crtc.c +++ b/drivers/gpu/drm/vc4/vc4_crtc.c @@ -536,6 +536,13 @@ static bool vc4_crtc_mode_fixup(struct drm_crtc *crtc, const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) { + /* Do not allow doublescan modes from user space */ + if (adjusted_mode->flags & DRM_MODE_FLAG_DBLSCAN) { + DRM_DEBUG_KMS("[CRTC:%d] Doublescan mode rejected.\n", + crtc->base.id); + return false; + } + /* * Interlaced video modes got CRTC_INTERLACE_HALVE_V applied when * coming from user space. We don't want this, as it screws up