Rev 1221 | Rev 1404 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1221 | Rev 1321 | ||
---|---|---|---|
Line 551... | Line 551... | ||
551 | { |
551 | { |
552 | return mode->vdisplay; |
552 | return mode->vdisplay; |
553 | } |
553 | } |
554 | EXPORT_SYMBOL(drm_mode_height); |
554 | EXPORT_SYMBOL(drm_mode_height); |
Line -... | Line 555... | ||
- | 555 | ||
- | 556 | /** drm_mode_hsync - get the hsync of a mode |
|
- | 557 | * @mode: mode |
|
- | 558 | * |
|
- | 559 | * LOCKING: |
|
- | 560 | * None. |
|
- | 561 | * |
|
- | 562 | * Return @modes's hsync rate in kHz, rounded to the nearest int. |
|
- | 563 | */ |
|
- | 564 | int drm_mode_hsync(struct drm_display_mode *mode) |
|
- | 565 | { |
|
- | 566 | unsigned int calc_val; |
|
- | 567 | ||
- | 568 | if (mode->hsync) |
|
- | 569 | return mode->hsync; |
|
- | 570 | ||
- | 571 | if (mode->htotal < 0) |
|
- | 572 | return 0; |
|
- | 573 | ||
- | 574 | calc_val = (mode->clock * 1000) / mode->htotal; /* hsync in Hz */ |
|
- | 575 | calc_val += 500; /* round to 1000Hz */ |
|
- | 576 | calc_val /= 1000; /* truncate to kHz */ |
|
- | 577 | ||
- | 578 | return calc_val; |
|
- | 579 | } |
|
- | 580 | EXPORT_SYMBOL(drm_mode_hsync); |
|
555 | 581 | ||
556 | /** |
582 | /** |
557 | * drm_mode_vrefresh - get the vrefresh of a mode |
583 | * drm_mode_vrefresh - get the vrefresh of a mode |
558 | * @mode: mode |
584 | * @mode: mode |
559 | * |
585 | * |
560 | * LOCKING: |
586 | * LOCKING: |
561 | * None. |
587 | * None. |
562 | * |
588 | * |
563 | * Return @mode's vrefresh rate or calculate it if necessary. |
589 | * Return @mode's vrefresh rate in Hz or calculate it if necessary. |
564 | * |
590 | * |
565 | * FIXME: why is this needed? shouldn't vrefresh be set already? |
591 | * FIXME: why is this needed? shouldn't vrefresh be set already? |
566 | * |
592 | * |
567 | * RETURNS: |
593 | * RETURNS: |