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: 141974 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2188448ljj; Mon, 16 Jul 2018 02:23:52 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeaL5b1PBmMagERo98oRdv7EfSELCDCpXxttL9kbaZ11jYYBVqDm4Fy+dpPL08uxbM2v3or X-Received: by 2002:aa7:824d:: with SMTP id e13-v6mr17180336pfn.97.1531733032311; Mon, 16 Jul 2018 02:23:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531733032; cv=none; d=google.com; s=arc-20160816; b=CLRM0TIAhD8PKphfPg4eOLTPgFfejuB7jVCQqexP102FWbDKu6/spVixqBfhSWut93 AHqSVeUhXofN4XC7xVtXjxHckeoZCKf1FzMUKwcpXrsX1r9C8ROIeojZTBIbHFiDqj1z mNM0/fVA9HqPKO4j50ld1sdPSAR7k4xO2p194mIGEpE6GnBnpmLEp/vn9IIeX4Fs20sJ YCGY2UqlAITmDKITC++utfGLZBLJZ1f72IcB5v9drNw0e3f12HzFf3GQy2/7MTTOI6i2 cGICcz7vpr2GJ+auyE2E4LVRqzytFebRj9rtFbNbAaRBXlb9bIo01sz3QCEEGyf8FGH1 1VFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=gQ0pM0rOm74Ut7o+5Piju1LsFVXlw1XJItEaMSzxraE=; b=mVA3a/yMLmgYLgefgugyZ1qAoQDF3bXGuD+TPX5zk4T6TezRc4mWuOl1OwtbTEj0vD YjBGpoSfWrhHwkTxR5fqZExnR5oczKFMJrffHbvRdL094mRnggeNSNccXFxajdxwnWgI pv/u95xClxp13qizl+2FZ0k+AuapWWBch8L4biZPaJg3XOcSxaJo5QwZV1GP1SDow8LU vCJ+MmIxj66RMUV7obDxIow2cXRNyo75GElUewZ48MKpRNi0iw0hdrbx4eAsFV4t+V7S 71srSrexRreid6T18w3e91eXo292Cn64YTD/K2j357zl9QOd6tBpqpNoZeOcqrzJyVrg 0OYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Y9ag9+yc; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (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 a8-v6si29763984pla.35.2018.07.16.02.23.52; Mon, 16 Jul 2018 02:23:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Y9ag9+yc; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727654AbeGPJuU (ORCPT + 5 others); Mon, 16 Jul 2018 05:50:20 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:40623 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727594AbeGPJuU (ORCPT ); Mon, 16 Jul 2018 05:50:20 -0400 Received: by mail-lf0-f66.google.com with SMTP id y200-v6so31718978lfd.7 for ; Mon, 16 Jul 2018 02:23:49 -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; bh=yo90auERIivdMHrEB4rOQviqRW+C7immLk48F3OsHp0=; b=Y9ag9+ycys8PugybnniLPLGzLo4t4hPbcpqkZS2ADhZh5AkoDv+1C/01+kBV3JUdW8 UH/5Jn0yt9yuYaMEknae64uYGzTxnj9NTbqhw2pkp5gBqemJMCY1sQvOhZTBPFyLOoAF D+3OxMqLSV9ihOEX75ssFzWqOlgM4wz6vWRiA= 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=WmicqN0NC/sVcu6pZq4ovUIB6MQGUS9Oku6HzKDVe61rdOXTuhCLRV64ivIq3rnNc0 uS0nikNy1xLygVSq5wvf7yTx/9UuUhUq1ZWPMef3qM91Ccs5Hk2aHEFYqDgUKQb0BAdg 4BQp8S5p8bpXXX9CCeeK8cbc5iJ1vVR+CooGg1rkLyr0fFXCsfaNcJi++ZZ3xRs3YpSr Cqak/nG4H3ya728ZnK/SbENwQ1yhVGh7SjGvd+JsIGSD09Yg6R7gz3HUJRGChZc2FLZC tWzCNkYtwrf0k63jvQm+0VbqJQxGOA3Shsf9KBP548GZV9oBiflnxvPjuCHexqOlcGOv SuCw== X-Gm-Message-State: AOUpUlEzn/nDuQeppTniLlPh7k4fkUJhU7abpDHouNE+SCy43t03h/gE WukOraCOQJtjQwEcIIYUuDF2pQ44Ux8= 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 Cc: Linus Walleij , devicetree@vger.kernel.org, Sudeep Holla , Lorenzo Pieralisi , Liviu Dudau , Robin Murphy 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 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 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 -- 2.17.0 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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 */ }