From patchwork Tue Feb 6 12:18:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 126993 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp2864435ljc; Tue, 6 Feb 2018 04:19:39 -0800 (PST) X-Google-Smtp-Source: AH8x224oyV9dsEjf38qXdjTOMu2H4jkLN8b48WTRLc3VmahZzblzsI4HcG+PPS3PERmTShxqT67W X-Received: by 2002:a17:902:4383:: with SMTP id j3-v6mr2205907pld.320.1517919579862; Tue, 06 Feb 2018 04:19:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517919579; cv=none; d=google.com; s=arc-20160816; b=qIyu7ftIXAn8SMPR6dwgoCdP1ztykUiBRkiecuuak5syxQm7QQVObUXuN1Uh4cOWkl +ieCikJSB6VTeV0/iIv/tKUqe68RfNhY5VEKG40iVZp2oOI9yx8eWXBy1QYXDIN8Pf4B R3CXjS53db3jzXKDqH316SzRnIykdrh1gx1vAkS0RTN7a5pNhNd2e+GIrNvKKSooR6JR S8st5ArMtVZ6fOJKtfSECEPA+wMAqe9cotc8IPrmynGzAxCpFrZtNRYt8opeHFILL7Jn tWcic33TT9EwYXBuzPH/6v1LKRca63hn4EhQO1Qz/jfv+lHY2mfxLNB+3NWAMyVyJRUi rPYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:message-id:date:subject:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=SnW/WxbdHgQnTfY0DLkuj8C1Vfho1oqqUUnI4eZZFlU=; b=kmEklCNy9gqhkqo/auotOC45KnK4V3p/5b/EWfajEzHL1CnluaJCC/uqBDhWHQLii7 t6GEWtAULM2uUBiF5F2eXae/5U+pNIHkxorpZqIn506dM2rzg62xb1hKbuVXioY+z8ft bfJ7sAhfQXMSV32OqbeD5XecZ0HgfKK0bovomfAHXTVNbe9T7Xw0ys2WbHCG5r0hy4ab jNLDugRfp+gMhHAcgGZeL2Xr98BpJXJCakG/QiOEyJ9P/9vdKYXrNwt0r/RdJ5M/rV4f o+YYl12gEeee/vxyiZgUWwAueRYlIrXmOxJN/Yw8ih+GryFyReamcyYwtmUvet2kCv1h jhnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=SZpqGXDL; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id s19si6756348pgn.24.2018.02.06.04.19.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 06 Feb 2018 04:19:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=SZpqGXDL; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 697CB6E040; Tue, 6 Feb 2018 12:19:07 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf0-x242.google.com (mail-lf0-x242.google.com [IPv6:2a00:1450:4010:c07::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 203FC6E040 for ; Tue, 6 Feb 2018 12:19:05 +0000 (UTC) Received: by mail-lf0-x242.google.com with SMTP id h92so2426023lfi.7 for ; Tue, 06 Feb 2018 04:19:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=5j8YXIUSIyX09cIdJaoIfhhjzmRBM0emZ7xmzcvH41M=; b=SZpqGXDL43tqTr1XToj0NB1NP3ewSbkXk5x9iT2N0ZHNzTxJCCc6skVBeO7uNzT4J2 r17hLBe8epet1Ahpb1h4Vl3GlqjGAgEYctoWVT78q54psKzWwED1q31BXfkSFjRexWnC qIURg9V9iAlcOZUEWhV7MX1wWtxKNwcDQt7Z4= 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=5j8YXIUSIyX09cIdJaoIfhhjzmRBM0emZ7xmzcvH41M=; b=r059gWQ3NMKPYTeFPrXVcmeHLY++4nzqHnMLUhQBhr51TjDXrpdwKmgPrDvHBxRpsk gL1qqy3ilXxN4A77jPyRz74YFgNAwxogDMStGgrZUSigU7HRHTosTS+9X9OcBagC+tUJ kIWpxNoXMufjjNY1idqojPceTn6d0bUgVuDIzzw6Ni8E1N3M7G+b80TOSo+pFcP/Qinm ryfh9+dNsv35nxPJOWyJDKYxRmzkWcQB4u8jRmKaY0X+lghdrc5ghOvLWTU4srBLVL2Q LouVQNQwbqLBVJ7kr4ZMCdr4Hzbngw79+KnJBkRmVBu7dwLw+M52i43uF4FFs94b42Oy qyKw== X-Gm-Message-State: APf1xPBswI99qB5CYU00qXDYMd/OynhvS/jMb4X521lpaod8tSWR+0SB a6bxWTSzerKamC4aHipfjQnnfsnr3rk= X-Received: by 10.25.178.217 with SMTP id t86mr1671679lfk.51.1517919544334; Tue, 06 Feb 2018 04:19:04 -0800 (PST) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id f11sm598631lja.63.2018.02.06.04.19.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 06 Feb 2018 04:19:03 -0800 (PST) From: Linus Walleij To: Daniel Vetter , Jani Nikula , Sean Paul , Eric Anholt , Peter Ujfalusi , Tomi Valkeinen Subject: [PATCH 0/3] Bandwidth limitation on PL111, take 2 Date: Tue, 6 Feb 2018 13:18:51 +0100 Message-Id: <20180206121854.4407-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.14.3 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: linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" I had to add a hook into the simple KMS helper to be able to gate off too high bandwidths on the PL111. Let me know what you think. This solution is inspired by the OMAPDRM commit a7631c4b9846 "drm/omap: Filter displays mode based on bandwidth limit" by Peter Ujfalusi. I'm not super-happy that we don't know or negotiate the desired pixel format when the CRTC asks the driver whether the mode is valid, I need to think more about this for the future. For now patch 2/2 just hammers that down to 16 or 32 BPP depending on variant, so we get running code. But the BPP is not used to negotiate formats wrt bandwidth, we just fix that variable and work on the resolution limitation. Maybe the 16BPP systems are in such a minority that this hard-coding is reasonable. Linus Walleij (3): drm: simple_kms_helper: Add mode_valid() callback support drm/pl111: Make the default BPP a per-variant variable drm/pl111: Use max memory bandwidth for resolution drivers/gpu/drm/drm_simple_kms_helper.c | 15 +++++++++++++++ drivers/gpu/drm/pl111/pl111_display.c | 30 ++++++++++++++++++++++++++++++ drivers/gpu/drm/pl111/pl111_drm.h | 3 +++ drivers/gpu/drm/pl111/pl111_drv.c | 10 +++++++++- drivers/gpu/drm/pl111/pl111_versatile.c | 2 ++ include/drm/drm_simple_kms_helper.h | 15 +++++++++++++++ 6 files changed, 74 insertions(+), 1 deletion(-)