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: 11102319 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 338C11399 for ; Mon, 19 Aug 2019 23:04:00 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1D4B022CEC for ; Mon, 19 Aug 2019 23:04:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1D4B022CEC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A29DA6E485; Mon, 19 Aug 2019 23:03:55 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by gabe.freedesktop.org (Postfix) with ESMTPS id 575C16E47F for ; Mon, 19 Aug 2019 23:03:52 +0000 (UTC) Received: by mail-pl1-x642.google.com with SMTP id 4so1684343pld.10 for ; Mon, 19 Aug 2019 16:03:52 -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=pasDqukoiYcSf22vVHmDhWNQxAqGGHKv3xKncmQla0E=; b=ZoC0szaGBbiQHDV6+bs3mHJKwcKP0oQ835F6xLiM2oYYy2MTdCIHnXkc2EHRS8/o3j SIIkB8SEmivTtKZqa3rcrvGIwui9EK69ntXAAURGZ1vISSz2rfCsbtY34CuK/l4QquFP JwwdaM8WmkPdTpgMR5dYbyZpGYSSO+hwkZSp/bO5AZ0Urw3zkjCXLyS4WkReBfaRDK/N DCHU9a68Og4PBEr9OiqZRjf4XXmtGuf2s3MOpfEPN3ijpZeLCOQZlkCEkBQPESz6drbZ vIFLYBVQXUfhBOrTfM0UpDbx6y4QkMhch4+3W+1W90YW/Q85kENxpNeK48L/9qE1XfiL UAuw== X-Gm-Message-State: APjAAAUE3+QqCxkgdc/9bELJ7vDDb8U57RNSq15HJGNI8ioT6giGvy9u +7X01bCFd7BlYJuD59ytycHBouxcymc= X-Google-Smtp-Source: APXvYqxmNKHRR9HjEo8ageeD5qMzRLwGanqDZgORsFklVz8zOiAWKY3P3qK1pJR7eCNHFKezoWuVTg== 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 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> 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=pasDqukoiYcSf22vVHmDhWNQxAqGGHKv3xKncmQla0E=; b=MaIepbInPrEkRgUnMBZxjlCw5OmylHzsQ0+yPqVTi9f3WOcTkgdKCOoNExu6/g5ads pwEJAhHKG3TAEsR9Dvi//KxBFG5p8Fk6+2VKznr1QllWCmyAphraoXUFE8ZocbZK2GfD fV7SqiAUaLg7Xl7APe5JcIEG6H+KYJLZYvUg1KIW8gYqxsdrO5JkWEitvJE5sCgprJtx ArMfpqBfeE9sQQHpRdCht6GYqczqGDNlX7M3niyiAXRZYg//ClWPJ7edADMX+ZkBxnNX vR/MBzNFRqj5mM0M6puKoHpfPXbiHk80T77hpv81PisrE5iccXEB4ophP/9d7THQ3KhM AweA== 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 , Xinliang Liu , Rongrong Zou , Sam Ravnborg MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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(-) 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;