aero_boy 发表于 2006-4-17 00:21:58

我激战了一天终于把我的本本的宽屏搞定了,915的。
ML能正确的驱动915的显卡,只是默认的分辨率是1024x768, 如果要支持宽屏的话需要一个915的补丁。在Intel下的那个dri我没有搞定,用的是别外一个,附在后面。

1. 将这个补丁编译后,运行(用root运行)
   # 915resolution -l
Intel 915GM VBIOS Hack : version 0.1

Chipset: 915GM

Mode 30 : 640x480, 8 bits/pixel
Mode 32 : 800x600, 8 bits/pixel
Mode 34 : 1024x768, 8 bits/pixel
Mode 38 : 1280x1024, 8 bits/pixel
Mode 3a : 1600x1200, 8 bits/pixel
Mode 3c : 1280x800, 8 bits/pixel
Mode 41 : 640x480, 16 bits/pixel
Mode 43 : 800x600, 16 bits/pixel
Mode 45 : 1024x768, 16 bits/pixel
Mode 49 : 1280x1024, 16 bits/pixel
Mode 4b : 1600x1200, 16 bits/pixel
Mode 4d : 1280x800, 16 bits/pixel
Mode 50 : 640x480, 32 bits/pixel
Mode 52 : 800x600, 32 bits/pixel
Mode 54 : 1024x768, 32 bits/pixel
Mode 58 : 1280x1024, 32 bits/pixel
Mode 5a : 1600x1200, 32 bits/pixel
Mode 5c :1900x1600, 32 bits/pixel

会显示上面的目前能用的分辩率,找一个我们用不上的,比如5c 来改一下:
   # 915resolution 5c 1280 800
这时在用-l看,就成了:
    Mode 5c : 1280x800, 32 bits/pixel
把刚才运行的命令加了/etc/rc.d/rc.local中,就不用每次都手工运行了。

2.只做上面的不行,还要配xorg.conf
       将Section "Screen" 节中的各个 Modes中加上    "1280x800":
       SubSection "Display"
                Viewport   0 0
                Depth   24
                Modes    "1280x800"
        EndSubSection
3.如果这时启动的话还是1024x768在xorg的log中会提示找不到mode name:
    要xorg.conf中加下Modes小节,默认的好像没有,
    先运行# gtf 1280 800 60   //分辩率和刷新率,LCD都用60就行了
   会得到如下的行:
# 1280x800 @ 60.00 Hz (GTF) hsync: 49.68 kHz; pclk: 83.46 MHz
Modeline "1280x800_60.00"83.461280 1344 1480 1680800 801 804 828-HSync +Vsync

把它加到xorg.conf的Modes中 就行了,如下:
Section "Modes"
        Identifier   "Modes"
#gtf 1280 800 60
# 1280x800 @ 60.00 Hz (GTF) hsync: 49.68 kHz; pclk: 83.46 MHz
        Modeline "1280x800_60.00"83.461280 1344 1480 1680800 801 804 828-HSync +Vsync

EndSection

注意: 在Modeline 后的是"1280x800_60.00" 而在SubSection "Display" 的Modes 是没有后面的_60.00的,这开始就在这搞了半天 :oops:


====================
不知道怎么传文件,以下是源码,用gcc 915resolution.c -o 915resolution 编译就行了


/* 915 resolution by steve tomljenovic
*
* This was tested only on Sony VGN-FS550.Use at your own risk
*
* This code is based on the techniques used in :
*
*   - 855patch.Many thanks to Christian Zietz (czietz gmx net)
*   for demonstrating how to shadow the VBIOS into system RAM
*   and then modify it.
*
*   - 1280patch by Andrew Tipton (andrewtipton null li).
*
*   - 855resolution by Alain Poirier
*
* This source code is into the public domain.
*/

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#define __USE_GNU
#include <string.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <sys/io.h>
#include <unistd.h>
#include <assert.h>



#define NEW(a) ((a *)(calloc(1, sizeof(a))))
#define FREE(a) (free(a))

#define VBIOS_START         0xc0000
#define VBIOS_SIZE          0x10000

#define VBIOS_FILE    "/dev/mem"
#define VBIOS_OFFSET_IN_FILE VBIOS_START

#define CFG_SIGNATURE       "BIOS_DATA_BLOCK "

#define FALSE 0
#define TRUE 1

typedef unsigned char * address;
typedef unsigned char boolean;

typedef struct {
    unsigned char mode;
    unsigned char bits_per_pixel;
    unsigned short resolution;
    unsigned char unknown;
} __attribute__((packed)) vbios_mode;

typedef struct {
    unsigned char unknow1;
    unsigned char x1;
    unsigned char unknow2;
    unsigned char x2;
    unsigned char y1;
    unsigned char unknow3;
    unsigned char y2;
} __attribute__((packed)) vbios_resolution;


typedef struct {
    int bios_fd;
    address bios_ptr;

    address cnfg_ptr;

    vbios_mode * mode_table;
    int mode_table_size;

    boolean unlocked;
} vbios_map;


void initialize_system();
char * get_chipset(void);

vbios_map * open_vbios();
void close_vbios(vbios_map * map);

void unlock_vbios(vbios_map * map);
void relock_vbios(vbios_map * map);



void initialize_system(void) {
    if (iopl(3) < 0) {
      perror("Unable to obtain the proper IO permissions");
      exit(2);
    }
}

static unsigned int get_chipset_id(void) {
    outl(0x80000000, 0xcf8);
    return inl(0xcfc);
}

static char chipset_buffer;

char * get_chipset(void) {
    unsigned int id;
    char * name;
   
    id = get_chipset_id();

    switch (id) {
    case 0x25608086:
      name = "845G";
      break;
      
    case 0x35808086:
      name = "855GM";
      break;
      
    case 0x25708086:
      name = "865G";
      break;

    case 0x25908086:
      name = "915GM";
      break;

    default:
      sprintf(chipset_buffer, "Unknown (0x%08x)", id);
      name = chipset_buffer;
      break;
    }

    return name;
}


vbios_map * open_vbios() {
    vbios_map * map = NEW(vbios_map);

    /*
   *Map the video bios to memory
   */
   
    map->bios_fd = open(VBIOS_FILE, O_RDWR);
    if(map->bios_fd < 0) {
      perror("Unable to open the BIOS file");
      exit(2);
    }

    map->bios_ptr = mmap((void *)VBIOS_START, VBIOS_SIZE,
                         PROT_READ | PROT_WRITE, MAP_SHARED | MAP_FIXED,
                         map->bios_fd, VBIOS_OFFSET_IN_FILE);

    if (map->bios_ptr == NULL) {
      fprintf(stderr, "Cannot mmap() the video BIOS\n");
      close(map->bios_fd);
      exit(2);
    }

    /*
   * figure out where the configuration information is
   */
   
    map->cnfg_ptr = memmem(map->bios_ptr, VBIOS_SIZE, CFG_SIGNATURE, strlen(CFG_SIGNATURE));

    if (map->cnfg_ptr == NULL) {
      fprintf(stderr, "Couldn't find the configuration area in the VBIOS!\n");
      close_vbios(map);
      exit(2);
    }

    /*
   * Figure out where the mode table is and which type of bios we have
   */
   
    {
      address p = map->bios_ptr;
      address limit = map->bios_ptr + VBIOS_SIZE - (3 * sizeof(vbios_mode));
      
      while (p < limit && map->mode_table == 0) {
            vbios_mode * mode_ptr = (vbios_mode *) p;
            
            if (((mode_ptr.mode & 0xf0) == 0x30) && ((mode_ptr.mode & 0xf0) == 0x30) &&
                ((mode_ptr.mode & 0xf0) == 0x30) && ((mode_ptr.mode & 0xf0) == 0x30)) {

                map->mode_table = mode_ptr;
            }
            
            p++;
      }

      if (map->mode_table == 0) {
            fprintf(stderr, "Unable to locate mode table!\n");
            close_vbios(map);
            exit(2);
      }
    }

    /*
   * Determine size of mode table
   */
   
    {
      vbios_mode * mode_ptr = map->mode_table;
      
      while (mode_ptr->mode != 0xff) {
            map->mode_table_size++;
            mode_ptr++;
      }
    }
   
   
    return map;
}

void close_vbios(vbios_map * map) {
    assert(!map->unlocked);

    if(map->bios_ptr == NULL) {
      fprintf(stderr, "BIOS should be open already!\n");
      exit(2);
    }

    munmap(map->bios_ptr, VBIOS_SIZE);
    close(map->bios_fd);

    FREE(map);
}

void unlock_vbios(vbios_map * map) {
    assert(!map->unlocked);

    map->unlocked = TRUE;

    outl(0x80000090, 0xcf8);

#if DEBUG
    {
      unsigned int t = inl(0xcfc);
      printf("unlock PAM: (0x%08x)\n", t);
    }
#endif
   
    outb(0x33, 0xcfd);
    outb(0x33, 0xcfe);

#if DEBUG
    {
      unsigned int t = inl(0xcfc);
      printf("unlock PAM: (0x%08x)\n", t);
    }
#endif

}

void relock_vbios(vbios_map * map) {
    assert(map->unlocked);

    map->unlocked = FALSE;
   
    outl(0x80000090, 0xcf8);

#if DEBUG
    {
      unsigned int t = inl(0xcfc);
      printf("relock PAM: (0x%08x)\n", t);
    }
#endif

    outb(0x11, 0xcfd);
    outb(0x11, 0xcfe);

#if DEBUG
    {
      unsigned int t = inl(0xcfc);
      printf("relock PAM: (0x%08x)\n", t);
    }
#endif
}


vbios_resolution * map_resolution(vbios_map * map, unsigned short res) {

    vbios_resolution * ptr = ((vbios_resolution*)(map->bios_ptr + res));

    return ptr;
}


void list_modes(vbios_map *map) {
    unsigned int i, x, y;

    for (i=0; i < map->mode_table_size; i++) {
      vbios_resolution * res = map_resolution(map, map->mode_table.resolution);

      x = ((((unsigned int) res->x2) & 0xf0) << 4) | res->x1;
      y = ((((unsigned int) res->y2) & 0xf0) << 4) | res->y1;

      if (x != 0 && y != 0) {
            printf("Mode %02x : %dx%d, %d bits/pixel\n", map->mode_table.mode, x, y, map->mode_table.bits_per_pixel);
      }
    }
}


void set_mode(vbios_map * map, unsigned int mode, unsigned int x, unsigned int y) {
    unsigned int i;


    for (i=0; i < map->mode_table_size; i++) {
      if (map->mode_table.mode == mode) {
            vbios_resolution * res = map_resolution(map, map->mode_table.resolution);

            res->x2 = (res->x2 & 0x0f) | ((x >> 4) & 0xf0);
            res->x1 = (x & 0xff);
            
            res->y2 = (res->y2 & 0x0f) | ((y >> 4) & 0xf0);
            res->y1 = (y & 0xff);
      }
    }

   
}   

int parse_args(int argc, char *argv[], int *list, int *mode, int *x, int *y) {
    int index = 1;

    *list = *mode = *x = *y = 0;

    if ((argc > index) && !strcmp(argv, "-l")) {
      *list = 1;
      index++;

      if(argc<=index) {
            return 0;
      }
    }
   
    if(argc-index != 3) {
      return -1;
    }

    *mode = (int) strtol(argv, NULL, 16);
    *x = atoi(argv);
    *y = atoi(argv);

    return 0;
}

void usage(char *name) {
    printf("Usage: %s [-l] \n", name);
    printf("Set the resolution to XxY for mode\n");
    printf("Options:\n");
    printf("    -l display the modes found into the vbios\n");
}

int main (int argc, char *argv[]) {
    vbios_map * map;
    char * chipset;
    int list, mode, x, y;

    printf("Intel 915GM VBIOS Hack : version 0.1\n\n");

    if (parse_args(argc, argv, &list, &mode, &x, &y) == -1) {
      usage(argv);
      return 2;
    }

    initialize_system();
   
    chipset = get_chipset();

    printf("Chipset: %s\n", chipset);

    map = open_vbios();

    printf("\n");

    if (list) {
      list_modes(map);
    }

    if (mode!=0 && x!=0 && y!=0) {
      unlock_vbios(map);
      set_mode(map, mode, x, y);
      relock_vbios(map);
      
      printf("** Patch mode %02x to resolution %dx%d complete\n", mode, x, y);
      
      if (list) {
            list_modes(map);
      }
    }

    close_vbios(map);
   
    return 0;
}

-----------------------------------------

chenlei9907 发表于 2006-4-17 05:37:47

好文章,收藏了。不过想顺便问问 intel的dri你说没有搞定 ,你都怎么搞了?我也遇到了同样的问题

chenlei9907 发表于 2006-4-17 15:35:30

终于搞定拉

简单总结一下 :mrgreen:

1.首先安装ML的时候,在最后配置显卡的时候一定要选,一个合适的。例如我的是DELL的本子,我就选 了DELL LCD pancle的 1280*1024的。显卡也一定要选,例如我的是Intel915就选了。之后的选择分辨率把1024*768 1280*1024都选上.测试通过后选择完成安装

2进入X发现 分辨率还在1024*768.这是因为还上不到1280*1024.这个时候用楼上大915那个补丁,写入rc。local文件。 同时改xorg。conf把1280*1024 改成 1280*800

3不用安装任何驱动和补丁,直接还是在xorg。conf里面加入DRI的相关选项就可以打开3D了
4 测试 glxinfo glxgears

name of display: :0.0
display: :0screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.2
server glx extensions:

6320 frames in 5.0 seconds = 1263.994 FPS
6257 frames in 5.0 seconds = 1251.230 FPS
6317 frames in 5.0 seconds = 1263.243 FPS
6250 frames in 5.0 seconds = 1249.954 FPS
6322 frames in 5.0 seconds = 1264.275 FPS
6250 frames in 5.0 seconds = 1249.850 FPS
基本效果还是比较明显的。

sgb76 发表于 2006-4-17 18:37:49

终于搞定拉


3不用安装任何驱动和补丁,直接还是在xorg。conf里面加入DRI的相关选项就可以打开3D了

请问怎样在xorg.conf里进行修改加入dri相关选项以打开3D?能不能说的详细些啊?

chenlei9907 发表于 2006-4-18 00:12:33

请问怎样在xorg.conf里进行修改加入dri相关选项以打开3D?能不能说的详细些啊?

下回切换到linux里面看看xorg.conf之后贴出来。先占个位置。

chenlei9907 发表于 2006-4-18 02:37:56

Section "Device"
      Identifier      "Videocard0"
      Driver          "i810"
      VendorName      "Videocard vendor"
      BoardName       "Intel 915"
      VideoRam      131072
        Option                "DRI" "true"
        Option                 "Composite" "Enable"
        Option                "RENDER" "Enable"
EndSection

Section "DRI"
        Mode 0666
EndSection

KDE 发表于 2006-4-18 04:12:36

是不是重新编译一下内核的话,把显卡声卡网卡等统统编进内核的话就没有这些麻烦了吧。

? :!::?::?::?:
严重错误!安装第三方驱动,则内核里相应部分通常都要是模块,否则驱动程序因不能替换老模块,会报错。

tanhitzq 发表于 2006-4-21 00:01:58

这篇应该加个精华,

唯一一个介绍intel显卡3d驱动有效的好贴。

sgb76 发表于 2006-4-21 10:33:09

按照楼主的方法试了,修改xorg。conf,还是打不开3d,我的显卡是852集成显卡

tanhitzq 发表于 2006-4-21 11:39:42

按照楼主的方法试了,修改xorg。conf,还是打不开3d,我的显卡是852集成显卡

是不是使用root用户。

楼主也只是root才有加速的。

sgb76 发表于 2006-4-21 12:30:35

是呀,我一直使用root用户的,可还是不行啊,运行glxgears,只有570多FPS

tanhitzq 发表于 2006-4-21 13:03:12

把你的
glxinfo
运行结果
贴出来看看

sgb76 发表于 2006-4-21 13:17:50

运行glxinfo后,显示如下信息:请帮忙看看

name of display: :0.0
display: :0screen: 0
direct rendering: No
server glx vendor string: SGI
server glx version string: 1.2
server glx extensions:
    GLX_ARB_multisample, GLX_EXT_visual_info, GLX_EXT_visual_rating,
    GLX_EXT_import_context, GLX_OML_swap_method, GLX_SGI_make_current_read,
    GLX_SGIS_multisample, GLX_SGIX_hyperpipe, GLX_SGIX_swap_barrier,
    GLX_SGIX_fbconfig
client glx vendor string: SGI
client glx version string: 1.4
client glx extensions:
    GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context,
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_allocate_memory,
    GLX_MESA_swap_control, GLX_MESA_swap_frame_usage, GLX_OML_swap_method,
    GLX_OML_sync_control, GLX_SGI_make_current_read, GLX_SGI_swap_control,
    GLX_SGI_video_sync, GLX_SGIS_multisample, GLX_SGIX_fbconfig,
    GLX_SGIX_pbuffer, GLX_SGIX_visual_select_group
GLX extensions:
    GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context,
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_OML_swap_method,
    GLX_SGI_make_current_read, GLX_SGIS_multisample, GLX_SGIX_fbconfig
OpenGL vendor string: Mesa project: www.mesa3d.org
OpenGL renderer string: Mesa GLX Indirect
OpenGL version string: 1.2 (1.5 Mesa 6.4.1)
OpenGL extensions:
    GL_ARB_depth_texture, GL_ARB_imaging, GL_ARB_multitexture,
    GL_ARB_point_parameters, GL_ARB_point_sprite, GL_ARB_shadow,
    GL_ARB_shadow_ambient, GL_ARB_texture_border_clamp,
    GL_ARB_texture_cube_map, GL_ARB_texture_env_add,
    GL_ARB_texture_env_combine, GL_ARB_texture_env_crossbar,
    GL_ARB_texture_env_dot3, GL_ARB_texture_mirrored_repeat,
    GL_ARB_transpose_matrix, GL_ARB_window_pos, GL_EXT_abgr, GL_EXT_bgra,
    GL_EXT_blend_color, GL_EXT_blend_func_separate, GL_EXT_blend_logic_op,
    GL_EXT_blend_minmax, GL_EXT_blend_subtract, GL_EXT_clip_volume_hint,
    GL_EXT_copy_texture, GL_EXT_draw_range_elements, GL_EXT_fog_coord,
    GL_EXT_multi_draw_arrays, GL_EXT_packed_pixels, GL_EXT_point_parameters,
    GL_EXT_polygon_offset, GL_EXT_rescale_normal, GL_EXT_secondary_color,
    GL_EXT_separate_specular_color, GL_EXT_shadow_funcs,
    GL_EXT_stencil_two_side, GL_EXT_stencil_wrap, GL_EXT_subtexture,
    GL_EXT_texture, GL_EXT_texture3D, GL_EXT_texture_edge_clamp,
    GL_EXT_texture_env_add, GL_EXT_texture_env_combine,
    GL_EXT_texture_env_dot3, GL_EXT_texture_lod_bias, GL_EXT_texture_object,
    GL_EXT_texture_rectangle, GL_EXT_vertex_array, GL_APPLE_packed_pixels,
    GL_ATI_texture_env_combine3, GL_ATI_texture_mirror_once,
    GL_ATIX_texture_env_combine3, GL_IBM_texture_mirrored_repeat,
    GL_INGR_blend_func_separate, GL_MESA_pack_invert, GL_MESA_ycbcr_texture,
    GL_NV_blend_square, GL_NV_point_sprite, GL_NV_texgen_reflection,
    GL_NV_texture_rectangle, GL_SGIS_generate_mipmap,
    GL_SGIS_texture_border_clamp, GL_SGIS_texture_edge_clamp,
    GL_SGIS_texture_lod, GL_SGIX_depth_texture, GL_SGIX_shadow,
    GL_SGIX_shadow_ambient, GL_SUN_multi_draw_arrays
glu version: 1.3
glu extensions:
    GLU_EXT_nurbs_tessellator, GLU_EXT_object_space_tess

   visualxbf lv rg d st colorbuffer ax dp st accumbuffermscav
id dep cl sp sz lci b rorgba bf th clrgba ns b eat
----------------------------------------------------------------------
0x23 24 tc0 240 ry.88800 16000000 0 None
0x24 24 tc0 240 ry.88800 168 16 16 1600 0 None
0x25 24 tc0 320 ry.88880 168 16 16 16 160 0 None
0x26 24 tc0 320 r..88880 168 16 16 16 160 0 None
0x27 24 dc0 240 ry.88800 16000000 0 None
0x28 24 dc0 240 ry.88800 168 16 16 1600 0 None
0x29 24 dc0 320 ry.88880 168 16 16 16 160 0 None
0x2a 24 dc0 320 r..88880 168 16 16 16 160 0 None

winen_qin 发表于 2008-10-17 11:26:57

回复 1# chenlei9907 的帖子

我也是相同的电脑,出现了完全相同的现象。而且丢了光盘,弄了半天没搞好。看了大侠的回答,很高深,不懂。
后来一下子解决了。其实处理很简单。
到dell的网站,根据自己的电脑型号选取相应的型号:笔记本,inspriron,630m,XP,
然后它在显卡上有三个驱动程序,分别是推荐的,可选的,紧急的。按照经验,我只安装了
推荐的和紧急的,结果不行,后来再安装可选的程序,结果一下子就解决了。
Winen Qin

[email protected]
页: 1 [2]
查看完整版本: 请教关于 Intel915GM显卡都驱动问题(已经搞定)