Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4973439ybl; Mon, 9 Dec 2019 21:06:58 -0800 (PST) X-Google-Smtp-Source: APXvYqwMn7aakKz9r2GHcJeglmrgucrPPVv7KGOO+vK7wUxkNcLHeiAWurCIdAVRdtJxwoKvMmzm X-Received: by 2002:aca:c715:: with SMTP id x21mr2452210oif.146.1575954417969; Mon, 09 Dec 2019 21:06:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575954417; cv=none; d=google.com; s=arc-20160816; b=wf5PK8bGvQ3916pHWPn992qFRBZ/ZcAT8EhLTuXQrcRha3HUDValc+PbJbZHC27M3n 55XQUXmrIZKx3JIRfYQzjqn+ghMYd61d8bYJus2A8qta0DWBQ2nFetw//JeutKyhnoj3 KcpQbNO4NcCarWLY0f5buNTkg24g7iT/ZbvaCMo3UkmC1TEmvWNsQoyfm9tTSll8Y7A1 pjAC5elDv8Z4Zb28y672FDaBbBfmt+8ITCFKuH/UKY0rweNQTLPB0iqDqOcIfoJHGW8a wkiitZov3OtENZD6WRXJ00sVHm8045BuY8G55DboMJpU+H67pfa2XM5Q0tYWTpl0A7F6 SXlQ== 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:date:subject:cc:to:from :dkim-signature; bh=AdxFy+I7i2jJN+rN5zx7RX8ff9ZkwUeUYe2wFRnYZxg=; b=xTkxK3sat0SzlMRNGPpOjaRVlnFcQ587d0aCPlDtevpb27c24M0oBPj3eFPZENK/LG CZjAbEPtU9sf3R/Ph8GFKn2bM7A/CFKrbcQYOlo1gVYFP1JUngF6lUogVvgHxKWdHSfB 0drOFpLrA4rJ+1wXFyTDm2wUysXUuIkeKFEtvWwpN184Lcwv5FnR2Xfl6dUYbSrqKbuD jog45S5NbZJfklkvs2sq/2iycjuAX9Q8nMswQRyx5BYQ8xrvrZWiyLbp3xgc0ohSCx7J SEOH+GUTKeH8eEYriHNQO6eBmcwJu/vY/lQXBawkzEKvm8/Xj7V6v2ENiYFCZzGX9ygz 9Yvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=ltyfZqaj; 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=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l16si1359559otq.73.2019.12.09.21.06.38; Mon, 09 Dec 2019 21:06:57 -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=@mediatek.com header.s=dk header.b=ltyfZqaj; 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=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727063AbfLJFFl (ORCPT + 99 others); Tue, 10 Dec 2019 00:05:41 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:1202 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726822AbfLJFFg (ORCPT ); Tue, 10 Dec 2019 00:05:36 -0500 X-UUID: 405eab06d9fa439c9c393a143611d3dc-20191210 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=AdxFy+I7i2jJN+rN5zx7RX8ff9ZkwUeUYe2wFRnYZxg=; b=ltyfZqajvcF/5KVrFhmpV1GQAmj7Im9w9LIDXZa1p3uJF4xMwCz8j4k7u4bGNfpEZS9E/1zwdUk8DALeXKlVAJQLXXtIdGabqiIh/bdh2ytrFTHOirjU9yyW5wZhEmtl+5CWyhPSQFe+pUnYJJVf2FbJQtcDppypHgvn+wR+G1c=; X-UUID: 405eab06d9fa439c9c393a143611d3dc-20191210 Received: from mtkcas08.mediatek.inc [(172.21.101.126)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 148240179; Tue, 10 Dec 2019 13:05:30 +0800 Received: from mtkcas09.mediatek.inc (172.21.101.178) by mtkmbs08n2.mediatek.inc (172.21.101.56) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 10 Dec 2019 13:04:33 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas09.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Tue, 10 Dec 2019 13:05:22 +0800 From: Bibby Hsieh To: David Airlie , Matthias Brugger , Daniel Vetter , , CC: Philipp Zabel , YT Shen , Thierry Reding , CK Hu , , , , , , Bibby Hsieh , Yongqiang Niu Subject: [PATCH v5 7/7] drm/mediatek: apply CMDQ control flow Date: Tue, 10 Dec 2019 13:05:26 +0800 Message-ID: <20191210050526.4437-8-bibby.hsieh@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20191210050526.4437-1-bibby.hsieh@mediatek.com> References: <20191210050526.4437-1-bibby.hsieh@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: AEEBE7D522D0684789C27698D7E9A0893C29132C1A89D92F4F2366B10B5230492000:8 X-MTK: N Content-Transfer-Encoding: base64 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org VW5saWtlIG90aGVyIFNvQ3MsIE1UODE4MyBkb2VzIG5vdCBoYXZlICJzaGFkb3ciDQpyZWdpc3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