From patchwork Thu Dec 27 11:38:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Sharma X-Patchwork-Id: 1914791 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 8362140061 for ; Fri, 28 Dec 2012 10:33:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 701EEE5DFD for ; Fri, 28 Dec 2012 02:33:05 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 473B2E5C1E for ; Thu, 27 Dec 2012 03:18:34 -0800 (PST) Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MFO00AA5SQ3QPM0@mailout1.samsung.com> for dri-devel@lists.freedesktop.org; Thu, 27 Dec 2012 20:18:06 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [203.254.230.43]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 14.12.01231.E6E2CD05; Thu, 27 Dec 2012 20:18:06 +0900 (KST) X-AuditID: cbfee61a-b7fa66d0000004cf-92-50dc2e6e8ba7 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 73.12.01231.D6E2CD05; Thu, 27 Dec 2012 20:18:06 +0900 (KST) Received: from chrome-ubuntu.sisodomain.com ([107.108.73.106]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MFO001M3SNASQ10@mmp1.samsung.com> for dri-devel@lists.freedesktop.org; Thu, 27 Dec 2012 20:18:05 +0900 (KST) From: Rahul Sharma To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/4] drm/exynos: add display-mode-check operation to exynos_mixer_ops struct Date: Thu, 27 Dec 2012 06:38:45 -0500 Message-id: <1356608328-5847-2-git-send-email-rahul.sharma@samsung.com> X-Mailer: git-send-email 1.8.0 In-reply-to: <1356608328-5847-1-git-send-email-rahul.sharma@samsung.com> References: <1356608328-5847-1-git-send-email-rahul.sharma@samsung.com> DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrLLMWRmVeSWpSXmKPExsVy+t8zbd08vTsBBg/bBCyufH3P5sDocb/7 OFMAYxSXTUpqTmZZapG+XQJXxqTe1YwFswUq3j+3bWC8zdvFyMkhIWAiceLEZUYIW0ziwr31 bF2MXBxCAssYJW6seswEU7Tg/TNGiMQiRok519+wQjgbmSSOv13FBlLFJqArMfvgM7BRIgLK En8nrgLrYBZoY5To27+ZHSQhLBAnsbW7A6yBRUBV4vasbmYQm1fAXaJ/wglWiHVyEh/2PAKr 5xTwkDjffw+sXgio5uW2Y4wQvQIS3yYfYuli5ACql5XYdIAZZJeEwGU2iTs7T0H9IylxcMUN lgmMwgsYGVYxiqYWJBcUJ6XnGuoVJ+YWl+al6yXn525ihISh1A7GlQ0WhxgFOBiVeHgVrW8H CLEmlhVX5h5ilOBgVhLh/St7J0CINyWxsiq1KD++qDQntfgQow/QJROZpUST84ExklcSb2hs YGxoaGloZmppaoBDWEmct9kjJUBIID2xJDU7NbUgtQhmHBMHp1QDo1nL3eCepwkLLgkf1+Sz upeUsMxyQ1sTQ2TunvJbXbOmrBSKvffk7SeroqXP2r4VCJtd7QldGndgwZrmf4nrRLgmzbZd Hm/rIfbJTdDUtLzunTtrcKiO5MHT1h6R5W3njXTP6lY9cf7COvHxunfN65x1Hu8KWdV/Rf9C 6B9Fnbvr4wX+Ni3vUmIpzkg01GIuKk4EALj6wElwAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuphkeLIzCtJLcpLzFFi42I5/e+xgG6e3p0Ag7sX2SyufH3P5sDocb/7 OFMAY1QDo01GamJKapFCal5yfkpmXrqtkndwvHO8qZmBoa6hpYW5kkJeYm6qrZKLT4CuW2YO 0FglhbLEnFKgUEBicbGSvh2mCaEhbroWMI0Rur4hQXA9RgZoIGEdY8ak3tWMBbMFKt4/t21g vM3bxcjJISFgIrHg/TNGCFtM4sK99WxdjFwcQgKLGCXmXH/DCuFsZJI4/nYVG0gVm4CuxOyD EB0iAsoSfyeuYgQpYhZoY5To27+ZHSQhLBAnsbW7A6yBRUBV4vasbmYQm1fAXaJ/wglWiHVy Eh/2PAKr5xTwkDjffw+sXgio5uW2Y4wTGHkXMDKsYhRNLUguKE5KzzXUK07MLS7NS9dLzs/d xAgO8mdSOxhXNlgcYhTgYFTi4VW0vh0gxJpYVlyZe4hRgoNZSYT3r+ydACHelMTKqtSi/Pii 0pzU4kOMPkBXTWSWEk3OB0ZgXkm8obGJmZGlkZmxibmxMQ5hJXHeZo+UACGB9MSS1OzU1ILU IphxTBycUg2M6i8um3rdCg9e+Oh8or7n2km7jVwmcvQ+PfO0Se/sO/Ub55fszjvDHlLj+bYz mKNTbO3js3qn9r2NfpV4TeGzy77903VXXck3NG6tdEk0uTFfbcXH3Q7NM24o9+xZcJXZ0rGa 99GH69f2K3FpKNc09zdFxN+4vCxy3k/J7L8ZJ37O6FIT2Vz4UImlOCPRUIu5qDgRAJt4Ua2f AgAA X-CFilter-Loop: Reflected X-Mailman-Approved-At: Fri, 28 Dec 2012 02:29:37 -0800 Cc: kgene.kim@samsung.com, seanpaul@google.com, sw0312.kim@samsung.com, joshi@samsung.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org This patch adds the display mode check operation to exynos_mixer_ops in drm-common-hdmi. In Exynos SoCs, mixer IP can put certain restrictions on the proposed display modes. These restriction needs to be considered during mode negotiation, which happens immediately after edid parsing. Both, mixer check-mode and hdmi check-timing callbacks are called one after another and ANDed result is returned back. Signed-off-by: Rahul Sharma --- drivers/gpu/drm/exynos/exynos_drm_hdmi.c | 12 ++++++++++++ drivers/gpu/drm/exynos/exynos_drm_hdmi.h | 3 +++ 2 files changed, 15 insertions(+) diff --git a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c index 55793c4..3a8eea6 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c @@ -125,9 +125,21 @@ static int drm_hdmi_get_edid(struct device *dev, static int drm_hdmi_check_timing(struct device *dev, void *timing) { struct drm_hdmi_context *ctx = to_context(dev); + int ret = 0; DRM_DEBUG_KMS("%s\n", __FILE__); + /* + * Both, mixer and hdmi should be able to handle the requested mode. + * If any of the two fails, return mode as BAD. + */ + + if (mixer_ops && mixer_ops->check_mode) + ret = mixer_ops->check_mode(ctx->mixer_ctx->ctx, timing); + + if (ret) + return ret; + if (hdmi_ops && hdmi_ops->check_timing) return hdmi_ops->check_timing(ctx->hdmi_ctx->ctx, timing); diff --git a/drivers/gpu/drm/exynos/exynos_drm_hdmi.h b/drivers/gpu/drm/exynos/exynos_drm_hdmi.h index 784a7e9..ae4b6ae 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_hdmi.h +++ b/drivers/gpu/drm/exynos/exynos_drm_hdmi.h @@ -58,6 +58,9 @@ struct exynos_mixer_ops { void (*win_mode_set)(void *ctx, struct exynos_drm_overlay *overlay); void (*win_commit)(void *ctx, int zpos); void (*win_disable)(void *ctx, int zpos); + + /* display */ + int (*check_mode)(void *ctx, void *mode); }; void exynos_hdmi_drv_attach(struct exynos_drm_hdmi_context *ctx);