public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Willy TARREAU <willy@w.ods.org>
To: Thomas Backlund <tmb@iki.fi>
Cc: Willy Tarreau <willy@w.ods.org>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2.4.21-rc1] vesafb with large memory
Date: Sun, 4 May 2003 11:49:00 +0200	[thread overview]
Message-ID: <20030504094900.GA342@pcw.home.local> (raw)
In-Reply-To: <200305031546.57631.tmb@iki.fi>

Hi Thomas,

 
> the correct line should AFAIK be:
> video_size = screen_info.lfb_width * screen_info.lfb_height * video_bpp;
> 
> (AFAIK we are calculating bits here, not bytes so the '/8' you used is 
> wrong... could you try without it, and let me know...)

No, after verification, I insist, we're really calculating BYTES here. Please
take a look :

================== with lfb_width/8 :

wtap:~$ dmesg|grep vesafb
vesafb: framebuffer at 0xe9000000, mapped to 0xe0825000, size 1435k
vesafb: mode is 1400x1050x8, linelength=1400, pages=4
vesafb: protected mode interface info at c000:50ae
vesafb: scrolling: redraw

wtap:~$ grep vesafb /proc/iomem
    e9000000-e9166e2f : vesafb

wtap:~$ cat /proc/mtrr
reg00: base=0x00000000 (   0MB), size= 512MB: write-back, count=1
reg01: base=0xe9000000 (3728MB), size=   1MB: write-combining, count=1

================== with lfb_width :

wtap:~$ dmesg|grep vesafb
vesafb: framebuffer at 0xe9000000, mapped to 0xe0825000, size 11484k
vesafb: mode is 1400x1050x8, linelength=1400, pages=4
vesafb: protected mode interface info at c000:50ae
vesafb: scrolling: redraw

wtap:~$ grep vesafb /proc/iomem
    e9000000-e9b3717f : vesafb

wtap:~$ cat /proc/mtrr
reg00: base=0x00000000 (   0MB), size= 512MB: write-back, count=1
reg01: base=0xe9000000 (3728MB), size=   8MB: write-combining, count=1

============

So I think that the correct line really is :
  video_size = screen_info.lfb_width * screen_info.lfb_height * video_bpp / 8;

(Which also handles line widths which are not multiple of 8).

BTW, I wonder why we truncate the mtrr size to the highest lower power of 2.
Shouldn't we round it up to the next one ?

Personnally, I would find this change more logical. For instance, it returns
1 MB for video_size between 1MB and 2MB-1 inclusive.

Any comments ?

Willy

--- ./drivers/video/vesafb.c
+++ ./drivers/video/vesafb.c
@@ -647,4 +647,5 @@
-		int temp_size = video_size;
+		int temp_size = video_size - 1;
 		/* Find the largest power-of-two */
 		while (temp_size & (temp_size - 1))
 			temp_size &= (temp_size - 1);
+		temp_size <<= 1;


  parent reply	other threads:[~2003-05-04  9:36 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-30 21:33 [PATCH 2.4.21-rc1] vesafb with large memory O.Sezer
2003-05-01 12:00 ` Thomas Backlund
2003-05-01 12:07   ` Alan Cox
2003-05-01 15:01     ` Thomas Backlund
2003-05-01 14:49       ` Alan Cox
2003-05-01 17:39         ` Thomas Backlund
2003-05-02  0:14         ` Thomas Backlund
2003-05-02 13:03           ` Willy Tarreau
2003-05-03 12:46             ` Thomas Backlund
2003-05-03 21:58               ` Willy Tarreau
2003-05-04  9:49               ` Willy TARREAU [this message]
2003-05-06  0:21                 ` Thomas Backlund
  -- strict thread matches above, loose matches on Subject: below --
2003-05-06 15:58 Walt H
2003-05-01 14:20 O.Sezer
2003-05-01 15:03 ` Thomas Backlund
2003-05-01 15:09   ` O.Sezer
2003-04-30 18:58 O.Sezer
2003-04-30  8:09 Adam Mercer
2003-04-30 11:26 ` Alan Cox

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=20030504094900.GA342@pcw.home.local \
    --to=willy@w.ods.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tmb@iki.fi \
    /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