From patchwork Tue Apr 23 23:20:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 10913843 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 CBB4814DB for ; Tue, 23 Apr 2019 23:21:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BB17F285D6 for ; Tue, 23 Apr 2019 23:21:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AF65128970; Tue, 23 Apr 2019 23:21:36 +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 4B490285D6 for ; Tue, 23 Apr 2019 23:21:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 23C32897C5; Tue, 23 Apr 2019 23:21:34 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0C59A89786 for ; Tue, 23 Apr 2019 23:21:27 +0000 (UTC) Received: by mail-pf1-x444.google.com with SMTP id i17so8250403pfo.6 for ; Tue, 23 Apr 2019 16:21:27 -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=uz24bMZkViIyZeft57rxEgaLGT+lil7nI2PxrW42mfI=; b=Iv0pvEOu/S2g39v7qAst4nYFmp+zSbbVEkRQOTbgGu2aafudIXgDGNEEH+xBe1WpAj yWr3ZV18ikXXaRl4Vrvj/uMe2uQnxSIAFtovpl6D0PKmgAtVXu9NC5ysdmQ/YbP1gkjI PgCRK3omPP5rA55cOJ7rOW7+HFAOE/ASpaEc9gq5fvDmAGtgZl8CtlTsJBpNsuL+YE2K 5zahWHMFFh05113Vg3fjTofNDpA0FuQKxt4QLWynphDXoZTXDqK7Sua+1rzzPdaGfKH7 sdd/C3kJ01msSzNoTWJexnkcoQRW3Q8mF034698Qi/I19HWFdULTw3OmxiBuDpe4n+4J Ou/g== X-Gm-Message-State: APjAAAWKWvhtjtIuUTK+94olhnYUJAxKZZC7scq1LDXAdEJr95s8ln/C EmoIgbrprGGk2cr2tD0kswK4MQ== X-Google-Smtp-Source: APXvYqzaQtp/hoCTDB1oJS8t8WWJg3hNjFooU0vTdyY+fPoz4HEer+IeO5PcJE0YZVOjw5Sj4j0vrA== X-Received: by 2002:a62:6807:: with SMTP id d7mr29014610pfc.75.1556061684829; Tue, 23 Apr 2019 16:21:24 -0700 (PDT) Received: from localhost.localdomain ([2601:1c2:680:1319:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id c28sm6984235pgm.42.2019.04.23.16.21.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 23 Apr 2019 16:21:24 -0700 (PDT) From: John Stultz To: lkml Subject: [PATCH 17/25] drm: kirin: Move config max_width and max_height to driver data Date: Tue, 23 Apr 2019 16:20:48 -0700 Message-Id: <1556061656-1733-18-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1556061656-1733-1-git-send-email-john.stultz@linaro.org> References: <1556061656-1733-1-git-send-email-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=uz24bMZkViIyZeft57rxEgaLGT+lil7nI2PxrW42mfI=; b=fTy8g/79O0qRKYvKP2RA0bslJG7zvilBCVnEtjN2gYOP06t2CbJd8WhLxUF6wP+avC OA4zDKjq6w/qLqnBAyMmLXGoolHASn1fHzgNoFF4jjFWNN+ixU5A8hHC2X8jljvHZbvK c9vZWThmvpr5SHcmFje/wJEGzWf2M2AnoqigE4QKOwbIMcYPLIBSE7ZsA05BjnhHGGqE Y2rZMgViwnDm+lYCCrABRCAlhPjbcmc13D2EIV16Tct6u54mQi3yCdguIAmtGTO9832/ ut767RhEY0yZcBpSaI9KiekMCnaank+ZjmFwGEk/c56yqj0FHkyudqNvF+G3gMGjhde6 rdrw== 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 , Chen Feng , dri-devel , Xinliang Liu , Xinwei Kong , Rongrong Zou 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: Xinliang Liu Cc: Rongrong Zou Cc: Xinwei Kong Cc: Chen Feng Cc: David Airlie Cc: Daniel Vetter Cc: dri-devel 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 b6b1da6..8f15269 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 4b210ea..70fee30 100644 --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c @@ -41,17 +41,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; @@ -60,7 +49,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 59fc888..af27acc 100644 --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.h +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.h @@ -41,6 +41,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;