mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arvind Sankar <arvinds@MIT.EDU>
To: linux-kernel@vger.kernel.org
Subject: vesafb mtrr setup question
Date: Mon, 25 Aug 2003 15:43:04 -0400	[thread overview]
Message-ID: <20030825194304.GA14893@m66-080-17.mit.edu> (raw)

The following lines are pulled out of drivers/video/vesafb.c (2.4.20):
Line 646 onwards..

> if (mtrr) {
>         int temp_size = video_size;
>         /* Find the largest power-of-two */
>         while (temp_size & (temp_size - 1))
>                 temp_size &= (temp_size - 1);
>                 
In the first place, the power of two computation computes the largest
power of 2 that is _smaller_ than video_size, so it looks like an
off-by-1 bug.

>         /* Try and find a power of two to add */
>         while (temp_size && mtrr_add(video_base, temp_size, MTRR_TYPE_WRCOMB, 1)==-EINVAL) {
>                 temp_size >>= 1;
>         }
> }

Secondly, what's the point of requesting a smaller write-combining
segment that won't cover all the video memory being used? If it fails
the first time round, shouldn't we either give up or attempt requesting
several contiguous segments?

-- arvind

             reply	other threads:[~2003-08-25 19:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-25 19:43 Arvind Sankar [this message]
2003-08-26 15:42 ` Alan Cox
2003-08-26 15:50   ` Arvind Sankar
2003-08-27 15:14     ` 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=20030825194304.GA14893@m66-080-17.mit.edu \
    --to=arvinds@mit.edu \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®