Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

viafb: remove unused max_hres/vres

This patch removes the max_hres and max_vres which are not used at
the moment. In general they could be useful but it would be better
to get them via any standard EDID implementation and not the buggy
incomplete one currently used which is also removed as far as
possible.

Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>

+3 -137
-2
drivers/video/via/chip.h
··· 142 142 int h_active; 143 143 int v_active; 144 144 int max_pixel_clock; 145 - int max_hres; 146 - int max_vres; 147 145 }; 148 146 149 147 struct lvds_setting_information {
+3 -135
drivers/video/via/dvi.c
··· 28 28 static void __devinit dvi_get_panel_size_from_DDCv1( 29 29 struct tmds_chip_information *tmds_chip, 30 30 struct tmds_setting_information *tmds_setting); 31 - static void __devinit dvi_get_panel_size_from_DDCv2( 32 - struct tmds_chip_information *tmds_chip, 33 - struct tmds_setting_information *tmds_setting); 34 31 static int viafb_dvi_query_EDID(void); 35 32 36 33 static int check_tmds_chip(int device_id_subaddr, int device_id) ··· 44 47 DEBUG_MSG(KERN_INFO "viafb_init_dvi_size()\n"); 45 48 46 49 viafb_dvi_sense(); 47 - switch (viafb_dvi_query_EDID()) { 48 - case 1: 50 + if (viafb_dvi_query_EDID() == 1) 49 51 dvi_get_panel_size_from_DDCv1(tmds_chip, tmds_setting); 50 - break; 51 - case 2: 52 - dvi_get_panel_size_from_DDCv2(tmds_chip, tmds_setting); 53 - break; 54 - default: 55 - printk(KERN_WARNING "viafb_init_dvi_size: DVI panel size undetected!\n"); 56 - break; 57 - } 58 52 59 53 return; 60 54 } ··· 294 306 return EDID_VERSION_1; /* Found EDID1 Table */ 295 307 } 296 308 297 - data0 = (u8) tmds_register_read(0x00); 298 - viaparinfo->chip_info->tmds_chip_info.tmds_chip_slave_addr = restore; 299 - if (data0 == 0x20) 300 - return EDID_VERSION_2; /* Found EDID2 Table */ 301 - else 302 - return false; 309 + return false; 303 310 } 304 311 305 312 /* Get Panel Size Using EDID1 Table */ ··· 302 319 struct tmds_chip_information *tmds_chip, 303 320 struct tmds_setting_information *tmds_setting) 304 321 { 305 - int i, max_h = 0, tmp, restore; 306 - unsigned char rData; 322 + int i, restore; 307 323 unsigned char EDID_DATA[18]; 308 324 309 325 DEBUG_MSG(KERN_INFO "\n dvi_get_panel_size_from_DDCv1 \n"); 310 326 311 327 restore = tmds_chip->tmds_chip_slave_addr; 312 328 tmds_chip->tmds_chip_slave_addr = 0xA0; 313 - 314 - rData = tmds_register_read(0x23); 315 - if (rData & 0x3C) 316 - max_h = 640; 317 - if (rData & 0xC0) 318 - max_h = 720; 319 - if (rData & 0x03) 320 - max_h = 800; 321 - 322 - rData = tmds_register_read(0x24); 323 - if (rData & 0xC0) 324 - max_h = 800; 325 - if (rData & 0x1E) 326 - max_h = 1024; 327 - if (rData & 0x01) 328 - max_h = 1280; 329 - 330 329 for (i = 0x25; i < 0x6D; i++) { 331 330 switch (i) { 332 - case 0x26: 333 - case 0x28: 334 - case 0x2A: 335 - case 0x2C: 336 - case 0x2E: 337 - case 0x30: 338 - case 0x32: 339 - case 0x34: 340 - rData = tmds_register_read(i); 341 - if (rData == 1) 342 - break; 343 - /* data = (data + 31) * 8 */ 344 - tmp = (rData + 31) << 3; 345 - if (tmp > max_h) 346 - max_h = tmp; 347 - break; 348 - 349 331 case 0x36: 350 332 case 0x48: 351 333 case 0x5A: ··· 331 383 } 332 384 } 333 385 334 - tmds_setting->max_hres = max_h; 335 - switch (max_h) { 336 - case 640: 337 - tmds_setting->max_vres = 480; 338 - break; 339 - case 800: 340 - tmds_setting->max_vres = 600; 341 - break; 342 - case 1024: 343 - tmds_setting->max_vres = 768; 344 - break; 345 - case 1280: 346 - tmds_setting->max_vres = 1024; 347 - break; 348 - case 1400: 349 - tmds_setting->max_vres = 1050; 350 - break; 351 - case 1440: 352 - tmds_setting->max_vres = 1050; 353 - break; 354 - case 1600: 355 - tmds_setting->max_vres = 1200; 356 - break; 357 - case 1920: 358 - tmds_setting->max_vres = 1080; 359 - break; 360 - default: 361 - DEBUG_MSG(KERN_INFO "Unknown panel size max resolution = %d ! " 362 - "set default panel size.\n", max_h); 363 - break; 364 - } 365 - 366 386 DEBUG_MSG(KERN_INFO "DVI max pixelclock = %d\n", 367 387 tmds_setting->max_pixel_clock); 368 - tmds_chip->tmds_chip_slave_addr = restore; 369 - } 370 - 371 - /* Get Panel Size Using EDID2 Table */ 372 - static void __devinit dvi_get_panel_size_from_DDCv2( 373 - struct tmds_chip_information *tmds_chip, 374 - struct tmds_setting_information *tmds_setting) 375 - { 376 - int restore; 377 - unsigned char R_Buffer[2]; 378 - 379 - DEBUG_MSG(KERN_INFO "\n dvi_get_panel_size_from_DDCv2 \n"); 380 - 381 - restore = tmds_chip->tmds_chip_slave_addr; 382 - tmds_chip->tmds_chip_slave_addr = 0xA2; 383 - 384 - /* Horizontal: 0x76, 0x77 */ 385 - tmds_register_read_bytes(0x76, R_Buffer, 2); 386 - tmds_setting->max_hres = R_Buffer[0] + (R_Buffer[1] << 8); 387 - 388 - switch (tmds_setting->max_hres) { 389 - case 640: 390 - tmds_setting->max_vres = 480; 391 - break; 392 - case 800: 393 - tmds_setting->max_vres = 600; 394 - break; 395 - case 1024: 396 - tmds_setting->max_vres = 768; 397 - break; 398 - case 1280: 399 - tmds_setting->max_vres = 1024; 400 - break; 401 - case 1400: 402 - tmds_setting->max_vres = 1050; 403 - break; 404 - case 1440: 405 - tmds_setting->max_vres = 1050; 406 - break; 407 - case 1600: 408 - tmds_setting->max_vres = 1200; 409 - break; 410 - default: 411 - DEBUG_MSG(KERN_INFO "Unknown panel size max resolution = %d! " 412 - "set default panel size.\n", tmds_setting->max_hres); 413 - break; 414 - } 415 - 416 388 tmds_chip->tmds_chip_slave_addr = restore; 417 389 } 418 390