Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1451698ybl; Thu, 5 Dec 2019 01:28:44 -0800 (PST) X-Google-Smtp-Source: APXvYqwLX6cIcaMi0xL4A2Eq3gFrjpn+u6Mz+OjoHcmewgxmgts2EEhgAsLnf0FfiC7hwWKnrf/Q X-Received: by 2002:aca:cc87:: with SMTP id c129mr6187894oig.13.1575538124774; Thu, 05 Dec 2019 01:28:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575538124; cv=none; d=google.com; s=arc-20160816; b=P9JsjhdHjb0gvpWgWWzddVN7UDO+MPI/jt9TJQLQQv2jEICkqNthZJ7Xf0na5V+Y+9 yHaJa0M4LYwbBXFBLbBb+mO+93L8MC/RQYBl5ncRyecgKZ3wvjN9FMBUqT3YTEowScWU uGoYRhoFZJVftuAhdRhPHs/Mv6oTpXSvdi9EOE7XZZyzhWfXw+OUcqlGWm2RzXZNEfQu SjhdoVIFMx7Cuh1nM66aReLby5C5af2lsSLhemwH5735Df9Uma5o1ufSfYH7YPpwJqA4 gAzoDVxejL+4Or4hPWG83emo28RQzEWUUWFV33QEZR2Z/k36uT4K1JVSyYTbMobMK9Qs jVlA== 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=uM1ke7og2J6EZV2kT8QK5FY4tjoIYTgjFwSyXoj2uGo=; b=heRI568DuUbseYyGcATt4m2C9GGChMScgxS+Ffr+zqgS2TEgMP4bSeWtgOImdJIXY0 CM0KHNrFOTRN2+irejeBAJu7klQjqlF62KfzrRzFQ/vtQZiyudWje606h35x587vRhG0 MF51f+cfjQt0AWiZLgUSTS8eeq1TzbJHff+xdqy3qjRRFTfrM4a8MJgqgtPWEos/I+q7 hk3/xLipaLFJk8BnZ7x8XWCTYqmlFnknbaswCWnNKbEE401hNEH5dYpbDEDRyGXgbcF9 l3RaZeWJLtTQb0eTshJmM9k9oq32s3L7oo7TaKHVJyzS2gPpIcE6rC481NVFmpWFmC8T FZQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=Qo6VPVEo; 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 s82si4491665oif.96.2019.12.05.01.28.32; Thu, 05 Dec 2019 01:28:44 -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=Qo6VPVEo; 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 S1729163AbfLEJ2B (ORCPT + 99 others); Thu, 5 Dec 2019 04:28:01 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:64707 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728735AbfLEJ14 (ORCPT ); Thu, 5 Dec 2019 04:27:56 -0500 X-UUID: 4397a3792bb24f289cc44234b3e2602b-20191205 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=uM1ke7og2J6EZV2kT8QK5FY4tjoIYTgjFwSyXoj2uGo=; b=Qo6VPVEoRw1h3RBGC6Nn1jCHRNzGuklITxKfH4XTP33koBDQnt17gM6FgBPdoMH8+Hk9CCYhkZGtC7wwzF6yiqwzIiyzaQdwndErC4UJCoBXZK0NMsBk6iHXPkDM+DrIkSG4KkWIpZFDTL0+5TxLLZE6GDEhec/fAX+M/Sm85FA=; X-UUID: 4397a3792bb24f289cc44234b3e2602b-20191205 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 896328631; Thu, 05 Dec 2019 17:27:52 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs05n2.mediatek.inc (172.21.101.140) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 5 Dec 2019 17:27:35 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Thu, 5 Dec 2019 17:26:53 +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 v4 7/7] drm/mediatek: apply CMDQ control flow Date: Thu, 5 Dec 2019 17:27:49 +0800 Message-ID: <20191205092749.4021-8-bibby.hsieh@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20191205092749.4021-1-bibby.hsieh@mediatek.com> References: <20191205092749.4021-1-bibby.hsieh@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain 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 VW5saWtlIG90aGVyIFNvQ3MsIE1UODE4MyBkb2VzIG5vdCBoYXZlICJzaGFkb3ciDQpyZWdpc3Rl cnMgZm9yIHBlcmZvcm1haW5nIGFuIGF0b21pYyB2aWRlbyBtb2RlDQpzZXQgb3Ig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