From patchwork Fri Jul 12 16:33:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 11042517 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 7D9B9138B for ; Fri, 12 Jul 2019 16:34:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6D23B28BCF for ; Fri, 12 Jul 2019 16:34:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 617C328C35; Fri, 12 Jul 2019 16:34:39 +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 EAD4E28BCF for ; Fri, 12 Jul 2019 16:34:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5D4166E314; Fri, 12 Jul 2019 16:34:37 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by gabe.freedesktop.org (Postfix) with ESMTPS id 388766E314 for ; Fri, 12 Jul 2019 16:34:36 +0000 (UTC) Received: by mail-pf1-x442.google.com with SMTP id y15so4536475pfn.5 for ; Fri, 12 Jul 2019 09:34:36 -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:mime-version :content-transfer-encoding; bh=ZxxOs+WHCN8yYkzCsPdgx/BKilpEGbNbxFs4VxLjJ2g=; b=na8QoOz/Gdudx7zceSdrcc6FTG3LbkvFF9eMqA8aeH5evLx1TSurc8kcYxozgjaNSR CVsrz1qRU6mfv+aA/yl8tq4mZyflZYAof9DL6F61yCxDJ3fRLjfdLlA1/OAJfVjb9gFl BRd8vh+MGkx1Twf9MHMK5r8XidOBdLI3oRLRRlZ+HrQ4wPw5E4LvFaMG2dCtl5eM9P7+ 1FmzrSqJAwAEh4YKsG7FqTEFB3814bjfGCZ39Gjxa86W5aC9xbklky8XAVM+WXWV09Sr QxMsIWaXpLPYn2/5PRqUPQvrZ9H3TPR1II4djuNZGbTtul4QW1GEx7ezDi5OPUFKzNSh GhSQ== X-Gm-Message-State: APjAAAUlRHV1urFKT4nACsSU2IdfrJsw2rEP8u7WmcB/0oNYOKdKJQns c40MDHMVrQ3fD2KSQc6IT06KCA== X-Google-Smtp-Source: APXvYqzatfDOusSPBh1WqKakLZc0DpjwdDToWjQSECc6hYoF0HYaCY+/Mnn4NcckBdYDj4y7irbB9Q== X-Received: by 2002:a63:fa57:: with SMTP id g23mr11522684pgk.75.1562949275764; Fri, 12 Jul 2019 09:34:35 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:24fa:e766:52c9:e3b2]) by smtp.gmail.com with ESMTPSA id d15sm21571604pjc.8.2019.07.12.09.34.35 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 12 Jul 2019 09:34:35 -0700 (PDT) From: Douglas Anderson To: Thierry Reding , Sam Ravnborg Subject: [PATCH] drm/panel: simple: Doxygenize 'struct panel_desc'; rename a few functions Date: Fri, 12 Jul 2019 09:33:33 -0700 Message-Id: <20190712163333.231884-1-dianders@chromium.org> X-Mailer: git-send-email 2.22.0.510.g264f2c817a-goog MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZxxOs+WHCN8yYkzCsPdgx/BKilpEGbNbxFs4VxLjJ2g=; b=DB9nrgDcMI6Oxw7g0G5qgE+YfDLCtL5YMm1MsmimFl+ntc+vS7rbj6LPaNpSrC7Vpr z/s4BskP50NzM8fMIcx1kjb4elWF5laVPt8idXtYmoRiCF/NAF0ps6Yk077kQSY7KDXi O+DE5PpPU3o/dhoWtgz4BIeO0MBBNGCRYtzlc= 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: David Airlie , Douglas Anderson , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Boris Brezillon , Sean Paul Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP This attempts to address outstanding review feedback from commit b8a2948fa2b3 ("drm/panel: simple: Add ability to override typical timing"). Specifically: * It was requested that I document (in the structure definition) that the device tree override had no effect if 'struct drm_display_mode' was used in the panel description. I have provided full Doxygen comments for 'struct panel_desc' to accomplish that. * panel_simple_get_fixed_modes() was thought to be a confusing name, so it has been renamed to panel_simple_get_display_modes(). * panel_simple_parse_override_mode() was thought to be better named as panel_simple_parse_panel_timing_node(). Suggested-by: Sam Ravnborg Signed-off-by: Douglas Anderson --- NOTES: - I have not addressed the suggestion of doing 'bool has_override = panel->override_mode.type != 0;'. As per my reply on the mailing list I think the convention in this file is to rely on implicit conversions from int to bool. - Sam said that there was still something that he didn't understand with regards to the flags. Sam: if this is something that needs to be addressed, please yell. drivers/gpu/drm/panel/panel-simple.c | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index a50871c6836b..f3c0e203f40f 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -38,6 +38,22 @@ #include #include +/** + * @modes: Pointer to array of fixed modes appropriate for this panel. If + * only one mode then this can just be the address of this the mode. + * NOTE: cannot be used with "timings" and also if this is specified + * then you cannot override the mode in the device tree. + * @num_modes: Number of elements in modes array. + * @timings: Pointer to array of display timings. NOTE: cannot be used with + * "modes" and also these will be used to validate a device tree + * override if one is present. + * @num_timings: Number of elements in timings array. + * @bpc: Bits per color. + * @size: Structure containing the physical size of this panel. + * @delay: Structure containing various delay values for this panel. + * @bus_format: See MEDIA_BUS_FMT_... defines. + * @bus_flags: See DRM_BUS_FLAG_... defines. + */ struct panel_desc { const struct drm_display_mode *modes; unsigned int num_modes; @@ -135,7 +151,7 @@ static unsigned int panel_simple_get_timings_modes(struct panel_simple *panel) return num; } -static unsigned int panel_simple_get_fixed_modes(struct panel_simple *panel) +static unsigned int panel_simple_get_display_modes(struct panel_simple *panel) { struct drm_connector *connector = panel->base.connector; struct drm_device *drm = panel->base.drm; @@ -199,7 +215,7 @@ static int panel_simple_get_non_edid_modes(struct panel_simple *panel) */ WARN_ON(panel->desc->num_timings && panel->desc->num_modes); if (num == 0) - num = panel_simple_get_fixed_modes(panel); + num = panel_simple_get_display_modes(panel); connector->display_info.bpc = panel->desc->bpc; connector->display_info.width_mm = panel->desc->size.width; @@ -351,9 +367,9 @@ static const struct drm_panel_funcs panel_simple_funcs = { #define PANEL_SIMPLE_BOUNDS_CHECK(to_check, bounds, field) \ (to_check->field.typ >= bounds->field.min && \ to_check->field.typ <= bounds->field.max) -static void panel_simple_parse_override_mode(struct device *dev, - struct panel_simple *panel, - const struct display_timing *ot) +static void panel_simple_parse_panel_timing_node(struct device *dev, + struct panel_simple *panel, + const struct display_timing *ot) { const struct panel_desc *desc = panel->desc; struct videomode vm; @@ -446,7 +462,7 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc) } if (!of_get_display_timing(dev->of_node, "panel-timing", &dt)) - panel_simple_parse_override_mode(dev, panel, &dt); + panel_simple_parse_panel_timing_node(dev, panel, &dt); drm_panel_init(&panel->base); panel->base.dev = dev;