Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp192321pxt; Wed, 4 Aug 2021 08:49:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwi0LYxy9O5W+NOMjR69hfOT1iHUxB2i4oATCFAHDkf8MCK0pDNoXkO/6+SPzv7lkRHRM0b X-Received: by 2002:a05:6402:22ac:: with SMTP id cx12mr484546edb.254.1628092197417; Wed, 04 Aug 2021 08:49:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628092197; cv=none; d=google.com; s=arc-20160816; b=kgGODA92hrT6bYSJ4VQ0H91KFqrEJcYVNk1W0c63zHihJs+49kVNDxyzDZUpOypGGZ Bwk13yISfP9tF8HETdYTx1VyBIP6h1PoBMn2yLHreZZQkP0RTTvBsnuq8evDIQ3o2Bq3 LLd5USy0XgfjCQf+BoL6hEE+9RSviLjKAEYgyS+PPfa8vjwUpdXxlCr6JaKYCWlGhBBf l9unMh9+jZ7RvqwSz09HleZLAchPVrkr05nOM8qNwj70vYpitipVIdZ0zp2yvE9kUETd vfuG4I1tK3UUwWj6ZrJwvT773Vth9kyg9d1hA1X4ptSygv7ypUXpMhz7cXf4yR0DHNpV YG+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=J49YuwjHy2NOI3/UOq5v3ZkPSTtuAE8eHm0+63f8mt0=; b=y2xWubHsBdvlGMDXE4lR2PZfgQuFo6X3u2Uq10EJpXR3DGDrtK2RGKkdnoEHrnqQhz hCl5AU4YMCI1Dr1ojZzdWgjKlVfqNNRiLDV9fbz+UrlfUAKBeHb/+RnoV9n1fXne+G0r QJeK2tng7OXuwxQqZugDjgHSU2IayQAkcPS5fNEP/N1rIVBtbq6Uc5W2OwW6xgxjxDXv K699LLFL7gfaoJJCYtl5AefFLa0WtHifmGVPU0Bs8j3S36AKRI2z+1xi6brR+jn65x7y i/L0SpdQo1ofxy2QO5gvS0if8YkMxr+tl0eMpFdM10wxISUrH3eECCoHVFpzvvEbw5fE OHmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=KKCQHWgX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x14si2551172ejj.435.2021.08.04.08.49.34; Wed, 04 Aug 2021 08:49:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=KKCQHWgX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239314AbhHDPrG (ORCPT + 99 others); Wed, 4 Aug 2021 11:47:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239114AbhHDPrF (ORCPT ); Wed, 4 Aug 2021 11:47:05 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 393D1C0613D5 for ; Wed, 4 Aug 2021 08:46:51 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id h14so2754067wrx.10 for ; Wed, 04 Aug 2021 08:46:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=J49YuwjHy2NOI3/UOq5v3ZkPSTtuAE8eHm0+63f8mt0=; b=KKCQHWgX85/6DkpOCs44CvbaGognlL5uAllvJp6ktA0cfVBb2a0VLnwQKQFEPMJSGt IjipCXmpd3p/rMnJU3NKfgXJYiI9so2/XFXEJe0cMMXp5zNxiUTtF1sDuts9Tiehmw9Y QvzEEfotIqIv3605wLYfTmRJgR2g55rCpxkxc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :content-transfer-encoding:in-reply-to; bh=J49YuwjHy2NOI3/UOq5v3ZkPSTtuAE8eHm0+63f8mt0=; b=IuWs9KJJ8G43nEjtnx0d6GED7EmhhB2CkK7YmYIr04NCM2soVF67D3lwgEVxliOZi1 rn2mqDhViB5WTsuBjsD7vZ1R8GQf4MUlIkZ1HEgSqD7gkRhnWQuVKOoBpR+7KXpLzQ2g tR3kyTWeUz4Jlaq3oq4spIh9wz+svArvPbMjVBQHH/3WBHY/uTOBK/lw7HjORNcBx5vO obkHA4ZEf1qh6AuvqLzKnnIGbKHFk1+kHQF+/WYAWolXgZ38XYo97cZpj4MB0QaqAZp8 G3dMC2mzLKEP85za/cMQ0hMTSjpZEAE2z3jDtZLEnQxDb5/sqmgG4oWEwTGbTsn70QNo VZ2A== X-Gm-Message-State: AOAM531N/nDfXIKPUtlDzXzIC5WiPLNUbfWTmdvL09F5dftBK6TMdst7 7XGnorFts+s/adohK5wBISRHjA== X-Received: by 2002:a5d:59ab:: with SMTP id p11mr30422wrr.238.1628092009803; Wed, 04 Aug 2021 08:46:49 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id p15sm2638112wmi.29.2021.08.04.08.46.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Aug 2021 08:46:48 -0700 (PDT) Date: Wed, 4 Aug 2021 17:46:40 +0200 From: Daniel Vetter To: Alex Deucher Cc: Michel =?iso-8859-1?Q?D=E4nzer?= , Christian =?iso-8859-1?Q?K=F6nig?= , Zhenneng Li , Alex Deucher , "Pan, Xinhui" , David Airlie , amd-gfx list , Maling list - DRI developers , LKML , Daniel Vetter Subject: Re: [PATCH] drm/radeon: Update pitch for page flip Message-ID: Mail-Followup-To: Alex Deucher , Michel =?iso-8859-1?Q?D=E4nzer?= , Christian =?iso-8859-1?Q?K=F6nig?= , Zhenneng Li , Alex Deucher , "Pan, Xinhui" , David Airlie , amd-gfx list , Maling list - DRI developers , LKML References: <20210802074310.1526526-1-lizhenneng@kylinos.cn> <6a34fcc3-0aa3-85ff-21c4-86b9b5a48fd5@daenzer.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Operating-System: Linux phenom 5.10.0-7-amd64 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 03, 2021 at 10:49:39AM -0400, Alex Deucher wrote: > On Tue, Aug 3, 2021 at 4:34 AM Michel D?nzer wrote: > > > > On 2021-08-02 4:51 p.m., Alex Deucher wrote: > > > On Mon, Aug 2, 2021 at 4:31 AM Daniel Vetter wrote: > > >> > > >> On Mon, Aug 02, 2021 at 10:12:47AM +0200, Christian K?nig wrote: > > >>> Am 02.08.21 um 09:43 schrieb Zhenneng Li: > > >>>> When primary bo is updated, crtc's pitch may > > >>>> have not been updated, this will lead to show > > >>>> disorder content when user changes display mode, > > >>>> we update crtc's pitch in page flip to avoid > > >>>> this bug. > > >>>> This refers to amdgpu's pageflip. > > >>> > > >>> Alex is the expert to ask about that code, but I'm not sure if that is > > >>> really correct for the old hardware. > > >>> > > >>> As far as I know the crtc's pitch should not change during a page flip, but > > >>> only during a full mode set. > > >>> > > >>> So could you elaborate a bit more how you trigger this? > > >> > > >> legacy page_flip ioctl only verifies that the fb->format stays the same. > > >> It doesn't check anything else (afair never has), this is all up to > > >> drivers to verify. > > >> > > >> Personally I'd say add a check to reject this, since testing this and > > >> making sure it really works everywhere is probably a bit much on this old > > >> hw. > > > > > > If just the pitch changed, that probably wouldn't be much of a > > > problem, but if the pitch is changing, that probably implies other > > > stuff has changed as well and we'll just be chasing changes. I agree > > > it would be best to just reject anything other than updating the > > > scanout address. > > > > FWIW, that means page flipping cannot be used in some cases which work fine by changing the pitch, which can result in tearing: https://gitlab.freedesktop.org/xorg/xserver/-/issues/839 (which says the i915 driver handles this as well). > > > > Ok. In that case, @Zhenneng can you update all of the pitch in all of > the page_flip functions in radeon rather than just the evergreen one? atomic drivers handle this fairly ok-ish, since we have a proper atomic_check there. For legacy kms I just wouldn't bother, too many corners to validate. But also if you're bored, just do it :-) -Daniel > > Thanks, > > Alex > > > > > > -- > > Earthling Michel D?nzer | https://redhat.com > > Libre software enthusiast | Mesa and X developer -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch