Received: by 10.223.176.5 with SMTP id f5csp2368549wra; Sun, 28 Jan 2018 19:03:24 -0800 (PST) X-Google-Smtp-Source: AH8x224WYPhjPABRb/rCWUZXNy40piiXtnNGwrOIy463sxhXayHvsxDqpjmekD4ASqnBSXAKwb52 X-Received: by 10.101.91.66 with SMTP id y2mr21152403pgr.11.1517195004416; Sun, 28 Jan 2018 19:03:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517195004; cv=none; d=google.com; s=arc-20160816; b=jmM2OWpZt28zicIs2ET/ur5/RkZX/FKBwht79XXgpJ7GzExkMoGoLgyR/xknyEsK2c 03nv9mbZqZ42LAsWGnelAUE7jZsSTvl2sTX21Oh2Q/0q66ETwIt8ZsDBaZSow/V2CWZ3 OcMjiwVWBZ0rSJUI3ZxPNHvXhOf/iEmgrOn8xzXto/czGgpDY62EBOSCu8A5IIuhnS6D hTabqWxcwWto4WCG40X8FMTs0HGTs7FPOqg6YTK+1cYRSG6+NOAH0sBeuhUXbta6qTdM 5msDbg1anux9ebAPm9wVD77uTkNjdU7SFx8QSnvcNpHFEVKMUhaJErhc0nUzzWmYHvG8 mPxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:arc-authentication-results; bh=n5t2rBVC67D3RWCPLBZY5fzo1EOaxaBKev6mm6Awk10=; b=VRrnKH1BSmwowbknUpLaHeP8yx3OVCFvG5REOzfmf78eJqDMOdlS9X2riH67MVidrn KdS70Xw8FYW1+vMTfTd/QVBGR1myGhm39g33jU2q9N4D2sGCmAdosd3mA/MO5APPYp1K BjLIzf/6/2B6ckSizcBAmfYbl2iBIZnJN9JYEMe4qwxB8c/mdHodq4miiakMbI5ltmgm gZ85tn4h77xHLvE152VuLtiwzCBPMGim4YLTUdmb9TIVr5HH2FaBbTc3WmvxeH6gGpce JxpjWTwN7EnMAE0Rk9pIotRhGWx7bGxTupd5LVUKIDOl1cjxYvQE8rQhmNh9L7/8/MZk e6Pw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o6-v6si8189685plk.288.2018.01.28.19.03.09; Sun, 28 Jan 2018 19:03: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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932623AbeA2CXR (ORCPT + 99 others); Sun, 28 Jan 2018 21:23:17 -0500 Received: from mail-wm0-f41.google.com ([74.125.82.41]:39168 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753684AbeA2CXQ (ORCPT ); Sun, 28 Jan 2018 21:23:16 -0500 Received: by mail-wm0-f41.google.com with SMTP id b21so30814759wme.4 for ; Sun, 28 Jan 2018 18:23:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=n5t2rBVC67D3RWCPLBZY5fzo1EOaxaBKev6mm6Awk10=; b=XfD9mSPV2mGdG/UK5jHniAe6clksRV7toobrGCarVz8k5ocu3/ED6v+qJ22Ff0YMeQ KtHsYYFTQvWMCL8470quP5lri2RiwmY8w4JcH6oXyfzEV0P2wvEDGXeM+y+ySAmTb+Br G36fotPp0F02MaeSCPWUTyvXja6mnVfoM8VFhDw/S/hTHjr56QGGot1hXINL/nKFmelO PZ2WtsjmS8K40KG60mv8LrHq3WF3H8oB/AypJIG8wI5VKgwxlgkDWdeAXflD9QM4aNe0 ooMCBpi+HyNdKB/1+cWkvEeerDPzqivhpcSOtm5/plyp5jZBJdZSrSozij/Gu4XiLjlD XnHg== X-Gm-Message-State: AKwxytdvDAwrz+yvA8tdLeVr/kedzpL4CA0XlVwoxXOjuydbso9xforB P25xz1MRI97D+ApO2VdayWVnMI6F X-Received: by 10.80.204.133 with SMTP id q5mr14449545edi.112.1517192595304; Sun, 28 Jan 2018 18:23:15 -0800 (PST) Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com. [74.125.82.53]) by smtp.gmail.com with ESMTPSA id b27sm6390221edc.28.2018.01.28.18.23.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Jan 2018 18:23:14 -0800 (PST) Received: by mail-wm0-f53.google.com with SMTP id g1so11218996wmg.2 for ; Sun, 28 Jan 2018 18:23:14 -0800 (PST) X-Received: by 10.28.9.18 with SMTP id 18mr16072801wmj.37.1517192594458; Sun, 28 Jan 2018 18:23:14 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.160.88 with HTTP; Sun, 28 Jan 2018 18:22:54 -0800 (PST) In-Reply-To: References: From: Chen-Yu Tsai Date: Mon, 29 Jan 2018 10:22:54 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 16/19] drm/sun4i: backend: Assign the pipes automatically To: Maxime Ripard Cc: Daniel Vetter , Jani Nikula , Sean Paul , dri-devel , linux-kernel , linux-arm-kernel , thomas@vitsch.nl Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 22, 2018 at 6:35 PM, Maxime Ripard wrote: > Since we now have a way to enforce the zpos, check for the number of alpha > planes, the only missing part is to assign our pipe automatically instead > of hardcoding it. > > The algorithm is quite simple, but requires two iterations over the list of > planes. > > In the first one (which is the same one that we've had to check for alpha, > the frontend usage, and so on), we order the planes by their zpos. > > We can then do a second iteration over that array by ascending zpos > starting with the pipe 0. When and if we encounter our alpha plane, we put > it and all the other subsequent planes in the second pipe. > > And since we have runtime checks and pipe assignments now, we can just > remove the static declaration of the planes we used to have. It would be slightly better if you could split this out into a separate patch. It's not immediately obvious to others that the changes to sun4i_layer.c are self-contained, while the change to sun4i_layer.h is part of the new pipeline tracking thing. Plus I think the way you structured everything means it won't break if you split it out. Reviewed-by: Chen-Yu Tsai