From patchwork Mon Jul 16 09:23:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 10526305 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8208560348 for ; Mon, 16 Jul 2018 09:23:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 73B92289BC for ; Mon, 16 Jul 2018 09:23:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 684C5289CB; Mon, 16 Jul 2018 09:23:53 +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 01385289BC for ; Mon, 16 Jul 2018 09:23:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B95E96E421; Mon, 16 Jul 2018 09:23:51 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf0-x243.google.com (mail-lf0-x243.google.com [IPv6:2a00:1450:4010:c07::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 325B36E421 for ; Mon, 16 Jul 2018 09:23:50 +0000 (UTC) Received: by mail-lf0-x243.google.com with SMTP id u202-v6so31689912lff.9 for ; Mon, 16 Jul 2018 02:23:50 -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; bh=yo90auERIivdMHrEB4rOQviqRW+C7immLk48F3OsHp0=; b=dUkOvxHGWdTlRNhaYpEaQVpJXi3qGe66oEBBmpHsp967rdSDRShFWT9JOT7xjYrUoJ ojsMZmDNdOrwclaSz1rfv9y0t0lvXNYo28WtMEaJXB0Ln7LYiG3kHpYR8MzeG1mtrVpq eeY7FaVBz2v0F0WLcUHaq7atwVoUvseB3WJeJ6QsfmssDSESxd8bIZHgD8wgJEFrxE7O lA2xSDJyUZm16vBzIbo0i5tavv3o9YFn8Ob62espyztKalO2hYfvq5XOL1G3hPWUzygf eAbOok60Ijk1chP45e3O1+gUWV8e7vjfmRuVXWeh72OMybwf6nSZKY1/p31vmAlm6jn4 DgPw== X-Gm-Message-State: AOUpUlHpXL2qLkt8CXORgHHuoVhn6wWvmNOaObPzWyPljDxKFMID0IU8 rRyDGTNRzZUru5UClRT12ID1Vg== X-Google-Smtp-Source: AAOMgpdMTJ8F39dBDza60CeBpKlRQWEI7vjt394xheTF6ufP2VhZMvCX7Y0ZNB2pfikDADjo3EYKBg== X-Received: by 2002:a19:e4c1:: with SMTP id x62-v6mr10861728lfi.76.1531733028564; Mon, 16 Jul 2018 02:23:48 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id j7-v6sm4735577ljg.48.2018.07.16.02.23.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Jul 2018 02:23:47 -0700 (PDT) From: Linus Walleij To: Thierry Reding , dri-devel@lists.freedesktop.org Subject: [PATCH] drm/panel: simple: Support simple VGA panels Date: Mon, 16 Jul 2018 11:23:39 +0200 Message-Id: <20180716092339.9736-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.17.0 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: devicetree@vger.kernel.org, Lorenzo Pieralisi , Liviu Dudau , Sudeep Holla , Robin Murphy MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The need to support some straight-forward VGA panels that are not adhering to any standard like DPI arise in the ARM RTSM VE Real-Time Systems Model Virtual Executive. This emulator (which is not QEMU) does not model any bridge or panel other than displaying whatever the user defines that they have. Currently a fake "DPI panel" is used for this with the old FBDEV driver, but this is wrong as it is not conforming to any MIPI DPI standards. However the resolution chosen there is standard VGA, and we can cover this with the simple panel by simply adding the most common VGA resolutions as a kind of "simple panel". In difference from other cases where "simple panel" might be hiding something more complex (such as a panel driver or bridge) this case is actually applicable, since we are running inside a simulation with no real hardware on the output. Cc: devicetree@vger.kernel.org Cc: Sudeep Holla Cc: Lorenzo Pieralisi Cc: Liviu Dudau Cc: Robin Murphy Signed-off-by: Linus Walleij --- .../display/panel/video-graphics-array.txt | 21 ++++++ drivers/gpu/drm/panel/panel-simple.c | 66 +++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/panel/video-graphics-array.txt diff --git a/Documentation/devicetree/bindings/display/panel/video-graphics-array.txt b/Documentation/devicetree/bindings/display/panel/video-graphics-array.txt new file mode 100644 index 000000000000..193d24ebe052 --- /dev/null +++ b/Documentation/devicetree/bindings/display/panel/video-graphics-array.txt @@ -0,0 +1,21 @@ +Video Graphics Array + +This binding is for simple panels using the standardized VGA resolutions +defined by de facto standards beginning with the IBM PS/2 in 1987. + +Required properties: +- compatible: should be "video-graphics-array" + +This binding is compatible with the simple-panel binding, which is specified +in simple-panel.txt in this directory. + +Example: + +panel { + compatible = "video-graphics-array"; + port { + vga_panel_in: endpoint { + remote-endpoint = <&foo>; + }; + }; +}; diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index cbf1ab404ee7..db4db5a3f75e 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -2069,6 +2069,69 @@ static const struct panel_desc winstar_wf35ltiacd = { .bus_format = MEDIA_BUS_FMT_RGB888_1X24, }; +static const struct drm_display_mode video_graphics_array_modes[] = { + { + /* + * This is the most standardized "vanilla" VGA mode there is: + * 640x480 @ 60 Hz + */ + .clock = 27175, + .hdisplay = 640, + .hsync_start = 640 + 16, + .hsync_end = 640 + 16 + 96, + .htotal = 640 + 16 + 96 + 48, + .vdisplay = 480, + .vsync_start = 480 + 10, + .vsync_end = 480 + 10 + 2, + .vtotal = 480 + 10 + 2 + 33, + .vrefresh = 60, + .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC, + }, + { + /* SVGA 800x600 @60 Hz */ + .clock = 40000, + .hdisplay = 800, + .hsync_start = 800 + 40, + .hsync_end = 800 + 40 + 128, + .htotal = 800 + 40 + 128 + 88, + .vdisplay = 600, + .vsync_start = 600 + 1, + .vsync_end = 600 + 1 + 4, + .vtotal = 600 + 1 + 4 + 23, + .vrefresh = 60, + .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC, + }, + { + /* XGA 1024x768 @60 Hz */ + .clock = 65000, + .hdisplay = 1024, + .hsync_start = 1024 + 24, + .hsync_end = 1024 + 24 + 136, + .htotal = 1024 + 24 + 136 + 160, + .vdisplay = 768, + .vsync_start = 768 + 3, + .vsync_end = 768 + 3 + 6, + .vtotal = 768 + 3 + 6 + 29, + .vrefresh = 60, + .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC, + }, +}; + +static const struct panel_desc video_graphics_array = { + .modes = video_graphics_array_modes, + .num_modes = ARRAY_SIZE(video_graphics_array_modes), + .bpc = 8, + /* + * Some typical 4:3 aspect ratio VGA monitor surely has these dimensions + * of 40x30 mm. + */ + .size = { + .width = 400, + .height = 300, + }, + .bus_format = MEDIA_BUS_FMT_RGB888_1X24, +}; + static const struct of_device_id platform_of_match[] = { { .compatible = "ampire,am-480272h3tmqw-t01h", @@ -2286,6 +2349,9 @@ static const struct of_device_id platform_of_match[] = { }, { .compatible = "winstar,wf35ltiacd", .data = &winstar_wf35ltiacd, + }, { + .compatible = "video-graphics-array", + .data = &video_graphics_array, }, { /* sentinel */ }