From patchwork Mon Aug 19 23:03:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 171748 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp3596230ily; Mon, 19 Aug 2019 16:03:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqwzMpU3kjgFfs7bwwRpx4ygu9SR9HauDFAHzxKB4JfcPcNTYidfDbuWIQIsSZkrg+tptFQY X-Received: by 2002:aa7:84d7:: with SMTP id x23mr4580849pfn.53.1566255837511; Mon, 19 Aug 2019 16:03:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566255837; cv=none; d=google.com; s=arc-20160816; b=exHT49nFK22aFwg5KtsUJ6r7PC+bQ1CSIBt/mU5mR6DYMH9rfYPfe/nnyhUWeuZRqk PmZ5QL9ieFfsJfSo/yZ20fd6xWIsgi4P3MkWQeaxRVuMTGgW50QIz4HWtgEzfJ5XnEM8 omsdKQCWHkeGzTkWoI4LUNjebTUFldq+3VGI5QGNJkAG/0nj6Im4b5GpoF/J1R78CNAq BMWPM31aeMVZqcCnL5MaPmUtRlCZAexuddE/j8wDnSoQww6g2FiEtH3rCvuujW7OWoJA GVYmzT7v/OVdBmkd5RUV87OFr8yfeas5xs7WGoLCMvwGMZdIlRx9F6e0auR5GH0goXza +AOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=pasDqukoiYcSf22vVHmDhWNQxAqGGHKv3xKncmQla0E=; b=xgYlflLeupUDMGb4B3k2pgCLVRf5/X8gydHnVotwN9cya2tirYAucwpTXDQOlXoTLE RFgHDAURtfJ9KxCGn+TYlS6krrkmhYinmCJUPSR+/trutYTHxcOCmLZVLCxle1IclJYQ flf/NxyVsnLmcJzTfbpeRuj4xUVstsXXyxiKXTusx4Q6J3ha4GR5Ltv1r13aBaEUgVhS d0PVhtAEcLqKJuhSoyAe99W1GNC4etSHKq6CgT9AyB7ig450kjznQiw6ZpZhAJnLe3N3 xvpZ5bSDAjMoeHwkGZkIzvKnTspRKFJqxEsvu0WBt8J6XfmT8ITxEai43p3j7ippe1VO femQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MaIepbIn; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c11si11397240pfd.165.2019.08.19.16.03.57; Mon, 19 Aug 2019 16:03:57 -0700 (PDT) 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=@linaro.org header.s=google header.b=MaIepbIn; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728926AbfHSXD4 (ORCPT + 28 others); Mon, 19 Aug 2019 19:03:56 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:37977 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728882AbfHSXDw (ORCPT ); Mon, 19 Aug 2019 19:03:52 -0400 Received: by mail-pl1-f193.google.com with SMTP id m12so1691200plt.5 for ; Mon, 19 Aug 2019 16:03:52 -0700 (PDT) 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=pasDqukoiYcSf22vVHmDhWNQxAqGGHKv3xKncmQla0E=; b=MaIepbInPrEkRgUnMBZxjlCw5OmylHzsQ0+yPqVTi9f3WOcTkgdKCOoNExu6/g5ads pwEJAhHKG3TAEsR9Dvi//KxBFG5p8Fk6+2VKznr1QllWCmyAphraoXUFE8ZocbZK2GfD fV7SqiAUaLg7Xl7APe5JcIEG6H+KYJLZYvUg1KIW8gYqxsdrO5JkWEitvJE5sCgprJtx ArMfpqBfeE9sQQHpRdCht6GYqczqGDNlX7M3niyiAXRZYg//ClWPJ7edADMX+ZkBxnNX vR/MBzNFRqj5mM0M6puKoHpfPXbiHk80T77hpv81PisrE5iccXEB4ophP/9d7THQ3KhM AweA== 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=pasDqukoiYcSf22vVHmDhWNQxAqGGHKv3xKncmQla0E=; b=rkR7MNiESlrvBD+ObIVQ7hLAZmQlyKiDx1CSL1NkRkcmRHlIsudgdOaeSxpj+9EE/+ Pfrf7u4D7NRhPT0O0Nd/L/Lu2G6Ty+JERtWMiZB/HI/6j0x2X7Eh6ilbpBC28+R1lrXx unYt7jrN9xnHISeIgGeM1Mmb23DETJ107jjUOpHOpBbsl8vjalH+4Yl2CEGxKLSIaJ2+ FYD9wsdReEzsKnF2rn3fytTWK2k04oFhPhcDlhgzMJgI5+iRTwYZMRa1I/ii0VbArhG4 DQIzuCql+MdBYaOS78XAM7Eu1bB4AJlJ9y02WvLKCgIWUJY2lkWEWUc9JEBNCkEBh1Co Wphw== X-Gm-Message-State: APjAAAWTcCFLLxyRRaprmf3jd3JgUHhukqUr+Th9OougYA5H9wjXX7E3 mXEJEVf+hYJ3VBW73pefghi5SRiYUq4= X-Received: by 2002:a17:902:12d:: with SMTP id 42mr23814196plb.187.1566255831340; Mon, 19 Aug 2019 16:03:51 -0700 (PDT) Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id j15sm17256509pfr.146.2019.08.19.16.03.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Aug 2019 16:03:50 -0700 (PDT) From: John Stultz To: lkml Cc: Xu YiPing , Rongrong Zou , Xinliang Liu , David Airlie , Daniel Vetter , dri-devel , Sam Ravnborg , John Stultz Subject: [PATCH v4 17/25] drm: kirin: Move config max_width and max_height to driver data Date: Mon, 19 Aug 2019 23:03:13 +0000 Message-Id: <20190819230321.56480-18-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190819230321.56480-1-john.stultz@linaro.org> References: <20190819230321.56480-1-john.stultz@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: Xinliang Liu Cc: David Airlie Cc: Daniel Vetter Cc: dri-devel Cc: Sam Ravnborg Acked-by: Xinliang Liu 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(-) -- 2.17.1 diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c index 8b1f3580cbd6..2e29a228f3f4 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 25191824b64e..2ab32c2e3f95 100644 --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c @@ -40,17 +40,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; @@ -59,7 +48,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;