comparison drivers/radeon_vid.c @ 26759:8eff880f638c

cosmetics: Remove useless parentheses from return statements.
author diego
date Fri, 16 May 2008 09:42:28 +0000
parents a506a6ab14e1
children 08d18fe9da52
comparison
equal deleted inserted replaced
26758:9fb1d2c3dbd4 26759:8eff880f638c
334 334
335 static char *fourcc_format_name(int format) 335 static char *fourcc_format_name(int format)
336 { 336 {
337 switch(format) 337 switch(format)
338 { 338 {
339 case IMGFMT_RGB8: return("RGB 8-bit"); 339 case IMGFMT_RGB8: return "RGB 8-bit";
340 case IMGFMT_RGB15: return("RGB 15-bit"); 340 case IMGFMT_RGB15: return "RGB 15-bit";
341 case IMGFMT_RGB16: return("RGB 16-bit"); 341 case IMGFMT_RGB16: return "RGB 16-bit";
342 case IMGFMT_RGB24: return("RGB 24-bit"); 342 case IMGFMT_RGB24: return "RGB 24-bit";
343 case IMGFMT_RGB32: return("RGB 32-bit"); 343 case IMGFMT_RGB32: return "RGB 32-bit";
344 case IMGFMT_BGR8: return("BGR 8-bit"); 344 case IMGFMT_BGR8: return "BGR 8-bit";
345 case IMGFMT_BGR15: return("BGR 15-bit"); 345 case IMGFMT_BGR15: return "BGR 15-bit";
346 case IMGFMT_BGR16: return("BGR 16-bit"); 346 case IMGFMT_BGR16: return "BGR 16-bit";
347 case IMGFMT_BGR24: return("BGR 24-bit"); 347 case IMGFMT_BGR24: return "BGR 24-bit";
348 case IMGFMT_BGR32: return("BGR 32-bit"); 348 case IMGFMT_BGR32: return "BGR 32-bit";
349 case IMGFMT_YVU9: return("Planar YVU9"); 349 case IMGFMT_YVU9: return "Planar YVU9";
350 case IMGFMT_IF09: return("Planar IF09"); 350 case IMGFMT_IF09: return "Planar IF09";
351 case IMGFMT_YV12: return("Planar YV12"); 351 case IMGFMT_YV12: return "Planar YV12";
352 case IMGFMT_I420: return("Planar I420"); 352 case IMGFMT_I420: return "Planar I420";
353 case IMGFMT_IYUV: return("Planar IYUV"); 353 case IMGFMT_IYUV: return "Planar IYUV";
354 case IMGFMT_CLPL: return("Planar CLPL"); 354 case IMGFMT_CLPL: return "Planar CLPL";
355 case IMGFMT_Y800: return("Planar Y800"); 355 case IMGFMT_Y800: return "Planar Y800";
356 case IMGFMT_Y8: return("Planar Y8"); 356 case IMGFMT_Y8: return "Planar Y8";
357 case IMGFMT_IUYV: return("Packed IUYV"); 357 case IMGFMT_IUYV: return "Packed IUYV";
358 case IMGFMT_IY41: return("Packed IY41"); 358 case IMGFMT_IY41: return "Packed IY41";
359 case IMGFMT_IYU1: return("Packed IYU1"); 359 case IMGFMT_IYU1: return "Packed IYU1";
360 case IMGFMT_IYU2: return("Packed IYU2"); 360 case IMGFMT_IYU2: return "Packed IYU2";
361 case IMGFMT_UYNV: return("Packed UYNV"); 361 case IMGFMT_UYNV: return "Packed UYNV";
362 case IMGFMT_cyuv: return("Packed CYUV"); 362 case IMGFMT_cyuv: return "Packed CYUV";
363 case IMGFMT_Y422: return("Packed Y422"); 363 case IMGFMT_Y422: return "Packed Y422";
364 case IMGFMT_YUY2: return("Packed YUY2"); 364 case IMGFMT_YUY2: return "Packed YUY2";
365 case IMGFMT_YUNV: return("Packed YUNV"); 365 case IMGFMT_YUNV: return "Packed YUNV";
366 case IMGFMT_UYVY: return("Packed UYVY"); 366 case IMGFMT_UYVY: return "Packed UYVY";
367 // case IMGFMT_YVYU: return("Packed YVYU"); 367 // case IMGFMT_YVYU: return "Packed YVYU";
368 case IMGFMT_Y41P: return("Packed Y41P"); 368 case IMGFMT_Y41P: return "Packed Y41P";
369 case IMGFMT_Y211: return("Packed Y211"); 369 case IMGFMT_Y211: return "Packed Y211";
370 case IMGFMT_Y41T: return("Packed Y41T"); 370 case IMGFMT_Y41T: return "Packed Y41T";
371 case IMGFMT_Y42T: return("Packed Y42T"); 371 case IMGFMT_Y42T: return "Packed Y42T";
372 case IMGFMT_V422: return("Packed V422"); 372 case IMGFMT_V422: return "Packed V422";
373 case IMGFMT_V655: return("Packed V655"); 373 case IMGFMT_V655: return "Packed V655";
374 case IMGFMT_CLJR: return("Packed CLJR"); 374 case IMGFMT_CLJR: return "Packed CLJR";
375 case IMGFMT_YUVP: return("Packed YUVP"); 375 case IMGFMT_YUVP: return "Packed YUVP";
376 case IMGFMT_UYVP: return("Packed UYVP"); 376 case IMGFMT_UYVP: return "Packed UYVP";
377 case IMGFMT_MPEGPES: return("Mpeg PES"); 377 case IMGFMT_MPEGPES: return "Mpeg PES";
378 } 378 }
379 return("Unknown"); 379 return "Unknown";
380 } 380 }
381 381
382 382
383 /* 383 /*
384 * IO macros 384 * IO macros
1108 1108
1109 case MGA_VID_FSEL: 1109 case MGA_VID_FSEL:
1110 if(copy_from_user(&frame,(int *) arg,sizeof(int))) 1110 if(copy_from_user(&frame,(int *) arg,sizeof(int)))
1111 { 1111 {
1112 printk(RVID_MSG"FSEL failed copy from userspace\n"); 1112 printk(RVID_MSG"FSEL failed copy from userspace\n");
1113 return(-EFAULT); 1113 return -EFAULT;
1114 } 1114 }
1115 radeon_vid_frame_sel(frame); 1115 radeon_vid_frame_sel(frame);
1116 break; 1116 break;
1117 1117
1118 default: 1118 default:
1119 printk(RVID_MSG"Invalid ioctl\n"); 1119 printk(RVID_MSG"Invalid ioctl\n");
1120 return (-EINVAL); 1120 return -EINVAL;
1121 } 1121 }
1122 1122
1123 return 0; 1123 return 0;
1124 } 1124 }
1125 1125
1403 RTRACE(RVID_MSG"mapping video memory into userspace\n"); 1403 RTRACE(RVID_MSG"mapping video memory into userspace\n");
1404 if(remap_page_range(vma->vm_start, radeon_mem_base + radeon_overlay_off, 1404 if(remap_page_range(vma->vm_start, radeon_mem_base + radeon_overlay_off,
1405 vma->vm_end - vma->vm_start, vma->vm_page_prot)) 1405 vma->vm_end - vma->vm_start, vma->vm_page_prot))
1406 { 1406 {
1407 printk(RVID_MSG"error mapping video memory\n"); 1407 printk(RVID_MSG"error mapping video memory\n");
1408 return(-EAGAIN); 1408 return -EAGAIN;
1409 } 1409 }
1410 1410
1411 return(0); 1411 return 0;
1412 } 1412 }
1413 1413
1414 static int radeon_vid_release(struct inode *inode, struct file *file) 1414 static int radeon_vid_release(struct inode *inode, struct file *file)
1415 { 1415 {
1416 radeon_vid_in_use = 0; 1416 radeon_vid_in_use = 0;
1428 static int radeon_vid_open(struct inode *inode, struct file *file) 1428 static int radeon_vid_open(struct inode *inode, struct file *file)
1429 { 1429 {
1430 int minor = MINOR(inode->i_rdev); 1430 int minor = MINOR(inode->i_rdev);
1431 1431
1432 if(minor != 0) 1432 if(minor != 0)
1433 return(-ENXIO); 1433 return -ENXIO;
1434 1434
1435 if(radeon_vid_in_use == 1) 1435 if(radeon_vid_in_use == 1)
1436 return(-EBUSY); 1436 return -EBUSY;
1437 1437
1438 radeon_vid_in_use = 1; 1438 radeon_vid_in_use = 1;
1439 MOD_INC_USE_COUNT; 1439 MOD_INC_USE_COUNT;
1440 return(0); 1440 return 0;
1441 } 1441 }
1442 1442
1443 #if LINUX_VERSION_CODE >= 0x020400 1443 #if LINUX_VERSION_CODE >= 0x020400
1444 static struct file_operations radeon_vid_fops = 1444 static struct file_operations radeon_vid_fops =
1445 { 1445 {
1521 smtrr.vram_valid = 1; 1521 smtrr.vram_valid = 1;
1522 /* let there be speed */ 1522 /* let there be speed */
1523 printk(RVID_MSG"MTRR set to ON\n"); 1523 printk(RVID_MSG"MTRR set to ON\n");
1524 } 1524 }
1525 #endif /* CONFIG_MTRR */ 1525 #endif /* CONFIG_MTRR */
1526 return(0); 1526 return 0;
1527 } 1527 }
1528 1528
1529 int __init init_module(void) 1529 int __init init_module(void)
1530 { 1530 {
1531 return radeon_vid_initialize(); 1531 return radeon_vid_initialize();