Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp622121imu; Wed, 9 Jan 2019 03:40:48 -0800 (PST) X-Google-Smtp-Source: ALg8bN7a0svQWxuyUyzRoEY3MDDKdbbAKTYexXul+vtLzTCDuPaCacpPrAIxd0ZO1dBzXczw1HA8 X-Received: by 2002:a63:d104:: with SMTP id k4mr4988411pgg.227.1547034048660; Wed, 09 Jan 2019 03:40:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547034048; cv=none; d=google.com; s=arc-20160816; b=hqdvnmtB7q3ehlsTt4CbyUExY1lAU2w18T7Z0nmuu8j1vtkBfbeoCoPHqUSo4xlSbD e/MCv2HMFPCA+4vJVHhJHOEcOJVTx7hbEbqUja58w6Xex9IQFjiShox59A60Iqxd3Gd1 29YupXzH528a1j2/MNcFlEjHHC4OKB5oZgzYSJRTKgACUq8weY8xiuxceQuRW9jUaH8v tqt+/qti0scoMjscteQwbbz8O1yPRRJH8+ecoUfzc7lSJrLOCn3X9YgMHI9YjJzoIiV5 Gv9AfLyX4iS/i36L6sJOBcRYqSLuP0ZAwDMx0BrqtKQfBkmIE8ixB0Sl0yI7C5f6ZsxI ySyQ== 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=XlRmyNF6iE/JEyYGXdQM91wc9aZ94u5sNOEA69AvR28=; b=fGW10z+EWYuWsvPx3YoOtDYeIzIpjwmy9q5PQ5QpZ6a8r3yPTUEhXBR+dripP15Tvc ZzRDQ6mJ0RqK07RnoO8Bbb7xzGXBdw0dWtR516TCLlOO27AcT9GQgalBG0Ff4iLdBALs AGCf5UzsN/gkXBzdeyXU9CMhquN0K1f161WRbgfndDjoqPZ+CyvuQoLZhmzCcctXKv+Q yw5LZufvPY71h3yPfW8g0VWm560HwQFCDBH3OqamNqy4Un/8BJ/c8TnDG7Dt7rH9pcq7 wrqMxYk0kUSl+ZnBGKXkar/wQWxB/sk2h5FSHnSgCnPke2qxSu5e+I7kvIYY2JzoaQjc 8Ckg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KVjKborK; 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 j6si11795869pfc.57.2019.01.09.03.40.32; Wed, 09 Jan 2019 03:40:48 -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=KVjKborK; 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 S1730886AbfAILhf (ORCPT + 99 others); Wed, 9 Jan 2019 06:37:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:54264 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730873AbfAILhf (ORCPT ); Wed, 9 Jan 2019 06:37:35 -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 93C9120652; Wed, 9 Jan 2019 11:37:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547033854; bh=FF2vd1Obk2LeuFU+5+bxuooqtBDJR4hsSNBOpm7rfoY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=KVjKborKe/gIozUUHRef5iPMjxgX58tnVh3S0ysqkrsVZ75juHeFYuG8fYsWFK/uI 7EjqXaXHAgoyiqwJq9JoTDxbE3UfmAGxS6BchIPSxOwMC9zbJ3lbCqRbzs10t6mTp6 bgChlnIcn9CYqDsWvHpsWs2iBOtrlZG8i0UqPj1A= Date: Wed, 9 Jan 2019 12:37:24 +0100 From: Boris Brezillon To: Daniel Vetter Cc: Peter Rosin , Alexandre Belloni , David Airlie , "linux-kernel@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , Nicolas Ferre , Boris Brezillon , "linux-arm-kernel@lists.infradead.org" Subject: Re: [PATCH] drm/atmel-hlcdc: prevent divide by zero Message-ID: <20190109123449.65742b99@bbrezillon> In-Reply-To: <20190109101224.GT21184@phenom.ffwll.local> References: <20190108123129.20031-1-peda@axentia.se> <20190109101224.GT21184@phenom.ffwll.local> 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:12:24 +0100 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 ... We should definitely use drm_atomic_helper_check_plane_state().