Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262177AbTHYTnL (ORCPT ); Mon, 25 Aug 2003 15:43:11 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262191AbTHYTnK (ORCPT ); Mon, 25 Aug 2003 15:43:10 -0400 Received: from FORT-POINT-STATION.MIT.EDU ([18.7.7.76]:20127 "EHLO fort-point-station.mit.edu") by vger.kernel.org with ESMTP id S262177AbTHYTnG (ORCPT ); Mon, 25 Aug 2003 15:43:06 -0400 Date: Mon, 25 Aug 2003 15:43:04 -0400 From: Arvind Sankar To: linux-kernel@vger.kernel.org Subject: vesafb mtrr setup question Message-ID: <20030825194304.GA14893@m66-080-17.mit.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1144 Lines: 30 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 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/