From patchwork Thu Aug 1 03:44:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 11070135 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 560F313AC for ; Thu, 1 Aug 2019 03:45:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 47CC9283C3 for ; Thu, 1 Aug 2019 03:45:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3BE87283C8; Thu, 1 Aug 2019 03:45:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D0F22283C3 for ; Thu, 1 Aug 2019 03:45:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8B9B46E352; Thu, 1 Aug 2019 03:45:15 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by gabe.freedesktop.org (Postfix) with ESMTPS id 615386E354 for ; Thu, 1 Aug 2019 03:45:14 +0000 (UTC) Received: by mail-pf1-x443.google.com with SMTP id r7so33154155pfl.3 for ; Wed, 31 Jul 2019 20:45:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=dQGpl/nhmhJMZKv4Vo2Ohuy0f7yCwYFz4OhCfH7eIeY=; b=W6l1Ill2x0GX8qjMrz8UemJBsnBQVaj/xfGN6NRPcuwFIm4O8sNDgjvCPqgaz7QTyT Yti4DoA/xE+MhpQUFuSALQgu+eCQCY6cFa3ct44yGCcsnA3qpFf9yUCd2BnmRKUUFPUH nxUAvo57bccMjduo1YrhS5e+OkpfKV2xQcy5WJO2s+kTCbdxstTGx2CkwtODpP6GSYvB CNrCp5qmqdHe/77Z7zAdY8PeeXFWgOt975qfi//0R8/+MOqRTXYMaVw4rDxJmvECudCm TVL80Jk3tPqpfNjvwlmKrE8ACSEz9+DXSuWfx3HvLJrJHZ1r95Db7OhrpiTXfgM2q9yH MC4g== X-Gm-Message-State: APjAAAW/sJ4CMZD1CRbW/Qqvppheb2WqgvihAfKdAdTR+DF4hp4yxINg Hg5KejOZjKLj+tOn+ph2O6dG6w== X-Google-Smtp-Source: APXvYqyE9OksfN4t4uiO+wXMjLvxL1N0wCPPp8i87h6D2b8CP8sDMRKmHanTkkY//Kt3QIQTtMyLOw== X-Received: by 2002:aa7:93bb:: with SMTP id x27mr52443201pff.10.1564631113669; Wed, 31 Jul 2019 20:45:13 -0700 (PDT) Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id h70sm64775674pgc.36.2019.07.31.20.45.12 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 31 Jul 2019 20:45:12 -0700 (PDT) From: John Stultz To: lkml Subject: [PATCH v3 18/26] drm: kirin: Move config max_width and max_height to driver data Date: Thu, 1 Aug 2019 03:44:31 +0000 Message-Id: <20190801034439.98227-19-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190801034439.98227-1-john.stultz@linaro.org> References: <20190801034439.98227-1-john.stultz@linaro.org> X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=dQGpl/nhmhJMZKv4Vo2Ohuy0f7yCwYFz4OhCfH7eIeY=; b=Ml5jZwzgL9rml4OFZjIub8zA/hmbDsOyOb5pgnwxP8CMB7+tMg38nXgrLV9QItM0En qKnXPeARSc4hO5vYz3U72ZS+AbG/jki8te5+3Pa36+Hi5RXUTdXBYD+4DT3Lht1i1d9I IgweV9STmp3PcjCZXgsTo+4sQj/B5CBB6+Ke8iqJqTokeJMdeN633a0emO7H0aLkXTGr Rs1GxKc91yTpK7K8rqrAOot9Lc9/qJal+/7iafr7L03c2VHcbKHxv5l8+Q+byqBX7JXK S1l68eVlYRWBEQAMu3OLAuLVld+I8FgFipQTXxzEL7CloNqZ0dbQ9uTV3RX1C/NH6qq2 CLBg== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Xu YiPing , David Airlie , dri-devel , Rongrong Zou , Sam Ravnborg MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Xu YiPing As part of refactoring the kirin driver to better support different hardware revisions, this patch moves the max_width and max_height values used in kirin_drm_mode_config_inita to hardware specific driver data. This will make it easier to add support for new devices via a new kirin_drm_data structure. Cc: Rongrong Zou Cc: David Airlie Cc: Daniel Vetter Cc: dri-devel Cc: Sam Ravnborg Reviewed-by: Sam Ravnborg Signed-off-by: Xu YiPing [jstultz: reworded commit message] Signed-off-by: John Stultz --- drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 2 ++ drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 17 +++++------------ drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.h | 2 ++ 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c index fc0f4c04d1c9..68efd508d86b 100644 --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c @@ -1054,6 +1054,8 @@ struct kirin_drm_data ade_driver_data = { .prim_plane = ADE_CH1, .channel_formats = channel_formats, .channel_formats_cnt = ARRAY_SIZE(channel_formats), + .config_max_width = 2048, + .config_max_height = 2048, .crtc_helper_funcs = &ade_crtc_helper_funcs, .crtc_funcs = &ade_crtc_funcs, .plane_helper_funcs = &ade_plane_helper_funcs, diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c index bf1e601fb367..7956d698d368 100644 --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c @@ -39,17 +39,6 @@ static int kirin_drm_kms_cleanup(struct drm_device *dev) return 0; } -static void kirin_drm_mode_config_init(struct drm_device *dev) -{ - dev->mode_config.min_width = 0; - dev->mode_config.min_height = 0; - - dev->mode_config.max_width = 2048; - dev->mode_config.max_height = 2048; - - dev->mode_config.funcs = driver_data->mode_config_funcs; -} - static int kirin_drm_kms_init(struct drm_device *dev) { int ret; @@ -58,7 +47,11 @@ static int kirin_drm_kms_init(struct drm_device *dev) /* dev->mode_config initialization */ drm_mode_config_init(dev); - kirin_drm_mode_config_init(dev); + dev->mode_config.min_width = 0; + dev->mode_config.min_height = 0; + dev->mode_config.max_width = driver_data->config_max_width; + dev->mode_config.max_height = driver_data->config_max_width; + dev->mode_config.funcs = driver_data->mode_config_funcs; /* display controller init */ ret = driver_data->init(to_platform_device(dev->dev)); diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.h b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.h index 2b660df60293..43be65f82a03 100644 --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.h +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.h @@ -37,6 +37,8 @@ struct kirin_plane { struct kirin_drm_data { const u32 *channel_formats; u32 channel_formats_cnt; + int config_max_width; + int config_max_height; u32 num_planes; u32 prim_plane;