Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1453460ybl; Thu, 5 Dec 2019 01:30:50 -0800 (PST) X-Google-Smtp-Source: APXvYqy5lXQJ5WSB+bmwqipvh74cx7a9tkKa/yGweShKdQiSi6IubNLUX/4DZz5dYneYiZSyuMGT X-Received: by 2002:a05:6830:154c:: with SMTP id l12mr5788135otp.275.1575538249935; Thu, 05 Dec 2019 01:30:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575538249; cv=none; d=google.com; s=arc-20160816; b=ED1ZfRrDt37l8s3eh8yJdH/UaiqW/Tx2bujKUbPN/PgvcSVST2X4cgAoXx3jiEKQ4D eX0EdsgzOTuoEFlD8plSkX2mbLIPxYE/NlPGBxvOhMy5KQz8UyDU/mlTgfb9ro/bab6S nIGwwVYs0m4j9vuKhApFyK9k049161xL8KiY3887xmAqhqk1BBs3wJkmuoK8kVxVa6K5 xhJ8zDsrynybr167GutQMxbFlAqqv1xwcd8OIcDYiI2DaVmgGp0aOYWSEDLI7ABsijzN prWRK3eFpVOEdCj+exGB/RRZOx2ND5RoSGh32wAxXhOmqKkaHys/7TrMEeCj15VuPkgG zhhQ== 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=pWAY9BehArm8hcdSgeZDP1ufdV8TQe6dLUAWG7WwDEE=; b=YEEz/f2V06mBYtVcMevgJ107mLBUuyxZ9dMv0qIXSaeHhB88RN5KfEuqChk33gFmUl 1WzRPDHiIAJ22/IvQ1rIRqkZPqFxHiE8LG8ZbImPOXHo4T7GCW6vKJMtio1MkpJ1xdIk GT5DENevCy+fKZVrH6H43IMmJbFr8OCHJdyIUryhixbD34MHjB0rlxc26l7FpTXLGNgD oLXcJmr7vuzHei0ulN/ntyu+0dmg+8I24tUStmwpaDFsm4JAlxP7821RlpoFPiI0F0Oi CPtrwiKkC26UNyb5B1KaoXfuu2VlAE56h2nGNLC6gTG92D9ywR06u56bhslIBSCG2SF7 IxXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="LWtaZJ/l"; 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 d2si4756855oth.267.2019.12.05.01.30.36; Thu, 05 Dec 2019 01:30:49 -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="LWtaZJ/l"; 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 S1729096AbfLEJ14 (ORCPT + 99 others); Thu, 5 Dec 2019 04:27:56 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:33876 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726384AbfLEJ1z (ORCPT ); Thu, 5 Dec 2019 04:27:55 -0500 X-UUID: f068fc1d85f24b5e995109728b42c75a-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=pWAY9BehArm8hcdSgeZDP1ufdV8TQe6dLUAWG7WwDEE=; b=LWtaZJ/l6sYRyw0nmVtXWJW5rxM85HC134kPJz+5vGRRlK0GgFntw8fuszQxGD4LrETPax7k91QCpn9n1E9ifEQUOKyyS0KlJ4aGapZlY6K5l2Kba79w78QS0FsSc52rOJ4E+lcepSAfN10jYNrtt/hljRaJlJhVLQGGeXZ7+JU=; X-UUID: f068fc1d85f24b5e995109728b42c75a-20191205 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 1412021089; Thu, 05 Dec 2019 17:27:51 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs08n1.mediatek.inc (172.21.101.55) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 5 Dec 2019 17:27:44 +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:52 +0800 From: Bibby Hsieh To: David Airlie , Matthias Brugger , Daniel Vetter , , CC: Philipp Zabel , YT Shen , Thierry Reding , CK Hu , , , , , , Bibby Hsieh Subject: [PATCH v4 1/7] drm/mediatek: use DRM core's atomic commit helper Date: Thu, 5 Dec 2019 17:27:43 +0800 Message-ID: <20191205092749.4021-2-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 VGhlIERSTSBjb3JlIGF0b21pYyBoZWxwZXIgbm93IHN1cHBvcnRzIGFzeW5jaHJvbm91cyBjb21t aXRzIG5hdGl2ZWx5Lg0KVGhlIGN1c3RvbSBkcm0gaW1wbGVtZW50YXRpb24gaXNuJ3QgbmVlZGVk IGFueW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