Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp661367imu; Wed, 9 Jan 2019 04:23:24 -0800 (PST) X-Google-Smtp-Source: ALg8bN4sF48lBXDw1rrhz3A+895+OfuvhZRnSzD/QgQx2LW5pmMTNdtphepNmK3MGqVWZOS9BPbw X-Received: by 2002:a17:902:9a04:: with SMTP id v4mr5954132plp.34.1547036604827; Wed, 09 Jan 2019 04:23:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547036604; cv=none; d=google.com; s=arc-20160816; b=ptHT4TYNrW92BhRmcgb/v2cp72nGLcFmiR2ryug2VAUDN1T+jUDtMJ9xVesc49YxOa a/vZJb7UBoQW0/sMPKRqDa7kU3m2/22mRR8igxClzzjq8DjJGb6vG+1tbhaqp4Bb7WFH 8D4s0R7IhME2t0RfSiGSbgg/MnXxICcyc9BHCxBJ9tRcMnvht/8c4uuunzMTTYttf4fn jcfb2BNXlSU43R3cFGWxD9uGmHxtHk6+knqbzEkNvd0vLw9tQ7H8t2Q91hnM1ybfBX7M MKMxNsmXjfVzvgswYUn8ypz8MU5E+7Jv1VH1M2HmyTMoCRgQ0hEiQ0dZUdXfjBk1uhLm SExg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=jA/7V1lT9YOWUGpiJZpBG6Hm/CBCSQ3gPSBLFt55SqY=; b=X4lrXO5A4maBTSZ6gQnNWleCqJTy4opLriFd7Nz3kn0zctirZYVH8ctskZG6HpTkTj R7cbXvQqrnQUPZXZ3xCEup9AX4U7Hfee1JTymwhY80jLPm+V2ZPJSDEv3ZfIm7m6+ctq sD8RaQ28CLRmcCRP8w9wc+dguMulhVh/9idervHtWRjE+2NzD0adUpLxX5rHeFyWUQ1E zkwF62RWcx1Gxt9TRoJ1tVuXXNMCgryTITikKsn5SblHC2eHNuXuZ5ETifuihKuU3fkZ soqvuDFa61mbrZj+b/qFolBFKfkTXbaYw+QQOnRtSVWiPjbmM/VOpGs49pThOY0k1xkP Xi3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=h2gWqV+I; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cf16si1775477plb.227.2019.01.09.04.23.09; Wed, 09 Jan 2019 04:23:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=h2gWqV+I; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730223AbfAIMAU (ORCPT + 99 others); Wed, 9 Jan 2019 07:00:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:35802 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729603AbfAIMAU (ORCPT ); Wed, 9 Jan 2019 07:00:20 -0500 Received: from bbrezillon (91-160-177-164.subs.proxad.net [91.160.177.164]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 259CE206B6; Wed, 9 Jan 2019 12:00:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547035219; bh=TwI3gTLhbBNd1cYXCGa3vZ8P336E2Tv4RllKn2O0a5A=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=h2gWqV+Ilp+6yZbP7H4pV+YOZWQNGM0OaA5DRrcRyOB8ax8QxplhOo5uo9kX+pYQx kQ85VIt3cmJNGeXwsji2tNiOsWh6hP30mJdYUcZFW411LwzirW7xXD0D9wa41r1/6D +bugV8XiOFX/FbOhH/RvQnP1PxTQxSOv1bGRqaT8= Date: Wed, 9 Jan 2019 13:00:08 +0100 From: Boris Brezillon To: Peter Rosin Cc: "linux-kernel@vger.kernel.org" , Alexandre Belloni , David Airlie , Nicolas Ferre , "dri-devel@lists.freedesktop.org" , Boris Brezillon , "linux-arm-kernel@lists.infradead.org" Subject: Re: [PATCH] drm/atmel-hlcdc: prevent divide by zero Message-ID: <20190109125833.0af5dc52@bbrezillon> In-Reply-To: <9b73f5fa-e5c2-ea55-8d96-be6de8a1f34a@axentia.se> References: <20190108123129.20031-1-peda@axentia.se> <20190109101224.GT21184@phenom.ffwll.local> <9b73f5fa-e5c2-ea55-8d96-be6de8a1f34a@axentia.se> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 9 Jan 2019 11:37:19 +0000 Peter Rosin wrote: > On 2019-01-09 11:12, Daniel Vetter wrote: > > On Tue, Jan 08, 2019 at 12:31:36PM +0000, Peter Rosin wrote: > >> While trying to temporarily hide a plane, one thing that was attempted > >> was to call (from libdrm) > >> > >> drmModeSetPlane(fd, plane_id, crtc_id, fb_id, 0, > >> 0, 0, 0, 0, 0, 0, 0, 0); > >> > >> This call causes a pair of "Division by zero in kernel." messages. Kill > >> those messages, but preserve the current behaviour that also happen to > >> make the plane disappear with the above call. > >> > >> Signed-off-by: Peter Rosin > >> --- > >> drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 14 ++++++++++---- > >> 1 file changed, 10 insertions(+), 4 deletions(-) > >> > >> Side note, when comparing with drm_atomic_helper_check_plane_state(), I get > >> the feeling that the src rect should be clipped together with the crtc rect > >> if/when clipping is needed. That function calls drm_rect_clip_scaled(), and > >> the equivalent does not seem to happen here. Should clipping be performed > >> on the src rect? > > > > Any reasons atmel can't switch over to that helper? Would compute a nice > > ->visible state variable for you ... > > -Daniel > > I have not researched that, and as stated above, I was not sure if that was the > correct approach to begin with. Boris, any insights? You can look at vc4_plane.c if you want an example of how this helper can be used to get clipped dimensions of the plane. > Does this code predate the > helper or something? Yes, and I must admit I'm not actively maintaining the driver, so there are probably a few other things we could simplify by using generic helpers. > > Maybe there's some register bit that hides a plane explicitly, matching the > ->visible state variable? I haven't looked at that either... I don't think so, but you can simply disable the plane when ->visible is false.