9front - general discussion about 9front
 help / color / mirror / Atom feed
From: Michael Forney <mforney@mforney.org>
To: 9front@9front.org
Subject: [9front] [PATCH 1/3] igfx: maintain single/double-channel LVDS mode from BIOS
Date: Wed,  2 Mar 2022 02:26:36 -0800	[thread overview]
Message-ID: <20220302102638.14043-2-mforney@mforney.org> (raw)
In-Reply-To: <20220302102638.14043-1-mforney@mforney.org>

---
Not quite sure why single-channel mode doesn't work on my laptop;
I just get a backlit black screen. The linux driver seems to use
whatever the BIOS set, so it seems like we should do the same.

The linux driver also has a parameter i915.lvds_channel_mode to
force single/double channel. I confirmed that when I set
i915.lvds_channel_mode=1, I get a black screen in linux as well.
So I think it may be a hardware limitation rather than something
igfx is doing wrong.

 sys/src/cmd/aux/vga/igfx.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/sys/src/cmd/aux/vga/igfx.c b/sys/src/cmd/aux/vga/igfx.c
index a2537329b..db283587b 100644
--- a/sys/src/cmd/aux/vga/igfx.c
+++ b/sys/src/cmd/aux/vga/igfx.c
@@ -850,7 +850,12 @@ initdpll(Igfx *igfx, int x, int freq, int port)
 	dpll->ctrl.v &= ~(3<<24);
 	if(port == PortLCD){
 		p2 = 14;
-		if(freq > 112*MHz){
+		/*
+		 * Use dual-channel LVDS if the display clock is
+		 * outside the range of single-channel, or it was
+		 * preconfigured by the BIOS.
+		 */
+		if(freq > 112*MHz || (igfx->lvds.v>>4 & 3) == 3){
 			p2 >>= 1;
 			dpll->ctrl.v |= (1<<24);
 		}
-- 
2.34.1


  reply	other threads:[~2022-03-02 12:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-02 10:26 [9front] [PATCH 0/3] improve igfx ironlake support Michael Forney
2022-03-02 10:26 ` Michael Forney [this message]
2022-03-02 10:26 ` [9front] [PATCH 2/3] igfx: add TypeILK, since it differs slightly from SNB Michael Forney
2022-03-02 10:26 ` [9front] [PATCH 3/3] igfx: fix FDI link training on ironlake Michael Forney
2022-03-02 18:33 ` [9front] [PATCH 0/3] improve igfx ironlake support cinap_lenrek
2022-03-02 19:01 ` cinap_lenrek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220302102638.14043-2-mforney@mforney.org \
    --to=mforney@mforney.org \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).