From patchwork Thu Nov 23 19:04:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= X-Patchwork-Id: 10073225 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 C9A0F60375 for ; Thu, 23 Nov 2017 19:06:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BC04D29F08 for ; Thu, 23 Nov 2017 19:06:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AF71229F15; Thu, 23 Nov 2017 19:06:12 +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.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 670E729F08 for ; Thu, 23 Nov 2017 19:06:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ZyME8+eONp3annY/d0iO52+0t+qfWJLw98BE40m76R8=; b=aDVg0qa0RidxEf JYx+8JF4F7XR4uKiE67B9MqUIwGi92bFud3+Exgd9CHG9apXLerelkkfZnDDBvtmtEBiMmBH90woY r41vG2H4aZPHFB8xXgMxPw8WyJkGtwE8fN8elvtz9GYlzOiW1W54c3kyfo73jczDfwPcywqvl1PlV fV1VfTXTBnY6MDiiFUBCY7ZURDjHYmfLURwHTpUTqtccIftIAWNSFoKe1f7bmIWnK3dar8HAptMHb tbqpWJ2RAHJ3dEYGP8VdGSJ306f65sQvy/mrF60RU/z3ZA9Sow1uVgdoKjtK5NqWH+qSepsK1hfzN Q4sHDpetFSFjNefMJF0A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eHwp3-0000am-Kd; Thu, 23 Nov 2017 19:06:05 +0000 Received: from mga09.intel.com ([134.134.136.24]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eHwoz-0000Xi-TS for linux-amlogic@lists.infradead.org; Thu, 23 Nov 2017 19:06:03 +0000 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Nov 2017 11:05:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,443,1505804400"; d="scan'208";a="6263650" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by fmsmga001.fm.intel.com with SMTP; 23 Nov 2017 11:05:37 -0800 Received: by stinkbox (sSMTP sendmail emulation); Thu, 23 Nov 2017 21:05:36 +0200 From: Ville Syrjala To: dri-devel@lists.freedesktop.org Subject: [PATCH 08/15] drm/meson: Use drm_mode_get_hv_timing() to populate plane clip rectangle Date: Thu, 23 Nov 2017 21:04:55 +0200 Message-Id: <20171123190502.28449-9-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171123190502.28449-1-ville.syrjala@linux.intel.com> References: <20171123190502.28449-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171123_110602_028182_A6D469FC X-CRM114-Status: GOOD ( 10.53 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-amlogic@lists.infradead.org, intel-gfx@lists.freedesktop.org, Laurent Pinchart , Neil Armstrong Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ville Syrjälä Use drm_mode_get_hv_timing() to fill out the plane clip rectangle. No functional changes as the code already uses crtc_state->mode to populate the clip, which is also what drm_mode_get_hv_timing() uses. Once everyone agrees on this we can move the clip handling into drm_atomic_helper_check_plane_state(). Cc: Laurent Pinchart Cc: Neil Armstrong Cc: linux-amlogic@lists.infradead.org Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/meson/meson_plane.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/meson/meson_plane.c b/drivers/gpu/drm/meson/meson_plane.c index d0a6ac8390f3..3801bee1f9e6 100644 --- a/drivers/gpu/drm/meson/meson_plane.c +++ b/drivers/gpu/drm/meson/meson_plane.c @@ -58,8 +58,9 @@ static int meson_plane_atomic_check(struct drm_plane *plane, if (IS_ERR(crtc_state)) return PTR_ERR(crtc_state); - clip.x2 = crtc_state->mode.hdisplay; - clip.y2 = crtc_state->mode.vdisplay; + if (crtc_state->enable) + drm_mode_get_hv_timing(&crtc_state->mode, + &clip.x2, &clip.y2); return drm_atomic_helper_check_plane_state(state, crtc_state, &clip, DRM_PLANE_HELPER_NO_SCALING,