diff options
| author | Dave Airlie <airlied@redhat.com> | 2009-12-22 20:18:33 -0500 |
|---|---|---|
| committer | Dave Airlie <airlied@redhat.com> | 2009-12-22 20:18:33 -0500 |
| commit | d94a5108f716bbd524358eb5a440d63991744a62 (patch) | |
| tree | 221988e3e87c26bf0cdf16cc411b3e3220c8637e | |
| parent | 44f9e6c6bc508b202755d9e9e48a8ba96a5f0fa4 (diff) | |
| parent | 0786201d8cd0730e72b0e087484dd47cc5f58409 (diff) | |
Merge remote branch 'korg/drm-radeon-next' into drm-linus
* korg/drm-radeon-next:
drm/radeon/kms: add definitions for v4 power tables
drm/radeon/kms: never combine LVDS with another encoder
drm/radeon/kms: Check module arguments to be valid V2
drm/radeon/kms: Avoid crash when trying to cleanup uninitialized structure
drm/radeon/kms: add cvt mode if we only have lvds w/h and no edid (v4)
drm/radeon/kms: add 3DC compression support
drm/radeon/kms: allow rendering while no colorbuffer is set on r300
drm/radeon/kms: enable memory clock reading on legacy (V2)
drm/radeon/kms: prevent parallel AtomBIOS calls
drm/radeon/kms: set proper default tv standard
drm/radeon/kms: fix legacy rmx
drm/radeon/kms/atom: fill in proper defines for digital setup
21 files changed, 459 insertions, 61 deletions
diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c index 6578d19dff93..388140a7e651 100644 --- a/drivers/gpu/drm/radeon/atom.c +++ b/drivers/gpu/drm/radeon/atom.c | |||
| @@ -58,6 +58,7 @@ typedef struct { | |||
| 58 | } atom_exec_context; | 58 | } atom_exec_context; |
| 59 | 59 | ||
| 60 | int atom_debug = 0; | 60 | int atom_debug = 0; |
| 61 | static void atom_execute_table_locked(struct atom_context *ctx, int index, uint32_t * params); | ||
| 61 | void atom_execute_table(struct atom_context *ctx, int index, uint32_t * params); | 62 | void atom_execute_table(struct atom_context *ctx, int index, uint32_t * params); |
| 62 | 63 | ||
| 63 | static uint32_t atom_arg_mask[8] = | 64 | static uint32_t atom_arg_mask[8] = |
| @@ -573,7 +574,7 @@ static void atom_op_calltable(atom_exec_context *ctx, int *ptr, int arg) | |||
| 573 | else | 574 | else |
| 574 | SDEBUG(" table: %d\n", idx); | 575 | SDEBUG(" table: %d\n", idx); |
| 575 | if (U16(ctx->ctx->cmd_table + 4 + 2 * idx)) | 576 | if (U16(ctx->ctx->cmd_table + 4 + 2 * idx)) |
| 576 | atom_execute_table(ctx->ctx, idx, ctx->ps + ctx->ps_shift); | 577 | atom_execute_table_locked(ctx->ctx, idx, ctx->ps + ctx->ps_shift); |
| 577 | } | 578 | } |
| 578 | 579 | ||
| 579 | static void atom_op_clear(atom_exec_context *ctx, int *ptr, int arg) | 580 | static void atom_op_clear(atom_exec_context *ctx, int *ptr, int arg) |
| @@ -1040,7 +1041,7 @@ static struct { | |||
| 1040 | atom_op_shr, ATOM_ARG_MC}, { | 1041 | atom_op_shr, ATOM_ARG_MC}, { |
| 1041 | atom_op_debug, 0},}; | 1042 | atom_op_debug, 0},}; |
| 1042 | 1043 | ||
| 1043 | void atom_execute_table(struct atom_context *ctx, int index, uint32_t * params) | 1044 | static void atom_execute_table_locked(struct atom_context *ctx, int index, uint32_t * params) |
| 1044 | { | 1045 | { |
| 1045 | int base = CU16(ctx->cmd_table + 4 + 2 * index); | 1046 | int base = CU16(ctx->cmd_table + 4 + 2 * index); |
| 1046 | int len, ws, ps, ptr; | 1047 | int len, ws, ps, ptr; |
| @@ -1092,6 +1093,13 @@ void atom_execute_table(struct atom_context *ctx, int index, uint32_t * params) | |||
| 1092 | kfree(ectx.ws); | 1093 | kfree(ectx.ws); |
| 1093 | } | 1094 | } |
| 1094 | 1095 | ||
| 1096 | void atom_execute_table(struct atom_context *ctx, int index, uint32_t * params) | ||
| 1097 | { | ||
| 1098 | mutex_lock(&ctx->mutex); | ||
| 1099 | atom_execute_table_locked(ctx, index, params); | ||
| 1100 | mutex_unlock(&ctx->mutex); | ||
| 1101 | } | ||
| 1102 | |||
| 1095 | static int atom_iio_len[] = { 1, 2, 3, 3, 3, 3, 4, 4, 4, 3 }; | 1103 | static int atom_iio_len[] = { 1, 2, 3, 3, 3, 3, 4, 4, 4, 3 }; |
| 1096 | 1104 | ||
| 1097 | static void atom_index_iio(struct atom_context *ctx, int base) | 1105 | static void atom_index_iio(struct atom_context *ctx, int base) |
diff --git a/drivers/gpu/drm/radeon/atom.h b/drivers/gpu/drm/radeon/atom.h index 6671848e5ea1..47fd943f6d14 100644 --- a/drivers/gpu/drm/radeon/atom.h +++ b/drivers/gpu/drm/radeon/atom.h | |||
| @@ -120,6 +120,7 @@ struct card_info { | |||
| 120 | 120 | ||
| 121 | struct atom_context { | 121 | struct atom_context { |
| 122 | struct card_info *card; | 122 | struct card_info *card; |
| 123 | struct mutex mutex; | ||
| 123 | void *bios; | 124 | void *bios; |
| 124 | uint32_t cmd_table, data_table; | 125 | uint32_t cmd_table, data_table; |
| 125 | uint16_t *iio; | 126 | uint16_t *iio; |
diff --git a/drivers/gpu/drm/radeon/atombios.h b/drivers/gpu/drm/radeon/atombios.h index e83927644de4..8e28842080df 100644 --- a/drivers/gpu/drm/radeon/atombios.h +++ b/drivers/gpu/drm/radeon/atombios.h | |||
| @@ -4690,6 +4690,205 @@ typedef struct _ATOM_POWERPLAY_INFO_V3 { | |||
| 4690 | ATOM_POWERMODE_INFO_V3 asPowerPlayInfo[ATOM_MAX_NUMBEROF_POWER_BLOCK]; | 4690 | ATOM_POWERMODE_INFO_V3 asPowerPlayInfo[ATOM_MAX_NUMBEROF_POWER_BLOCK]; |
| 4691 | } ATOM_POWERPLAY_INFO_V3; | 4691 | } ATOM_POWERPLAY_INFO_V3; |
| 4692 | 4692 | ||
| 4693 | /* New PPlib */ | ||
| 4694 | /**************************************************************************/ | ||
| 4695 | typedef struct _ATOM_PPLIB_THERMALCONTROLLER | ||
| 4696 | |||
| 4697 | { | ||
| 4698 | UCHAR ucType; // one of ATOM_PP_THERMALCONTROLLER_* | ||
| 4699 | UCHAR ucI2cLine; // as interpreted by DAL I2C | ||
| 4700 | UCHAR ucI2cAddress; | ||
| 4701 | UCHAR ucFanParameters; // Fan Control Parameters. | ||
| 4702 | UCHAR ucFanMinRPM; // Fan Minimum RPM (hundreds) -- for display purposes only. | ||
| 4703 | UCHAR ucFanMaxRPM; // Fan Maximum RPM (hundreds) -- for display purposes only. | ||
| 4704 | UCHAR ucReserved; // ---- | ||
| 4705 | UCHAR ucFlags; // to be defined | ||
| 4706 | } ATOM_PPLIB_THERMALCONTROLLER; | ||
| 4707 | |||
| 4708 | #define ATOM_PP_FANPARAMETERS_TACHOMETER_PULSES_PER_REVOLUTION_MASK 0x0f | ||
| 4709 | #define ATOM_PP_FANPARAMETERS_NOFAN 0x80 // No fan is connected to this controller. | ||
| 4710 | |||
| 4711 | #define ATOM_PP_THERMALCONTROLLER_NONE 0 | ||
| 4712 | #define ATOM_PP_THERMALCONTROLLER_LM63 1 // Not used by PPLib | ||
| 4713 | #define ATOM_PP_THERMALCONTROLLER_ADM1032 2 // Not used by PPLib | ||
| 4714 | #define ATOM_PP_THERMALCONTROLLER_ADM1030 3 // Not used by PPLib | ||
| 4715 | #define ATOM_PP_THERMALCONTROLLER_MUA6649 4 // Not used by PPLib | ||
| 4716 | #define ATOM_PP_THERMALCONTROLLER_LM64 5 | ||
| 4717 | #define ATOM_PP_THERMALCONTROLLER_F75375 6 // Not used by PPLib | ||
| 4718 | #define ATOM_PP_THERMALCONTROLLER_RV6xx 7 | ||
| 4719 | #define ATOM_PP_THERMALCONTROLLER_RV770 8 | ||
| 4720 | #define ATOM_PP_THERMALCONTROLLER_ADT7473 9 | ||
| 4721 | |||
| 4722 | typedef struct _ATOM_PPLIB_STATE | ||
| 4723 | { | ||
| 4724 | UCHAR ucNonClockStateIndex; | ||
| 4725 | UCHAR ucClockStateIndices[1]; // variable-sized | ||
| 4726 | } ATOM_PPLIB_STATE; | ||
| 4727 | |||
| 4728 | //// ATOM_PPLIB_POWERPLAYTABLE::ulPlatformCaps | ||
| 4729 | #define ATOM_PP_PLATFORM_CAP_BACKBIAS 1 | ||
| 4730 | #define ATOM_PP_PLATFORM_CAP_POWERPLAY 2 | ||
| 4731 | #define ATOM_PP_PLATFORM_CAP_SBIOSPOWERSOURCE 4 | ||
| 4732 | #define ATOM_PP_PLATFORM_CAP_ASPM_L0s 8 | ||
| 4733 | #define ATOM_PP_PLATFORM_CAP_ASPM_L1 16 | ||
| 4734 | #define ATOM_PP_PLATFORM_CAP_HARDWAREDC 32 | ||
| 4735 | #define ATOM_PP_PLATFORM_CAP_GEMINIPRIMARY 64 | ||
| 4736 | #define ATOM_PP_PLATFORM_CAP_STEPVDDC 128 | ||
| 4737 | #define ATOM_PP_PLATFORM_CAP_VOLTAGECONTROL 256 | ||
| 4738 | #define ATOM_PP_PLATFORM_CAP_SIDEPORTCONTROL 512 | ||
| 4739 | #define ATOM_PP_PLATFORM_CAP_TURNOFFPLL_ASPML1 1024 | ||
| 4740 | #define ATOM_PP_PLATFORM_CAP_HTLINKCONTROL 2048 | ||
| 4741 | |||
| 4742 | typedef struct _ATOM_PPLIB_POWERPLAYTABLE | ||
| 4743 | { | ||
| 4744 | ATOM_COMMON_TABLE_HEADER sHeader; | ||
| 4745 | |||
| 4746 | UCHAR ucDataRevision; | ||
| 4747 | |||
| 4748 | UCHAR ucNumStates; | ||
| 4749 | UCHAR ucStateEntrySize; | ||
| 4750 | UCHAR ucClockInfoSize; | ||
| 4751 | UCHAR ucNonClockSize; | ||
| 4752 | |||
| 4753 | // offset from start of this table to array of ucNumStates ATOM_PPLIB_STATE structures | ||
| 4754 | USHORT usStateArrayOffset; | ||
| 4755 | |||
| 4756 | // offset from start of this table to array of ASIC-specific structures, | ||
| 4757 | // currently ATOM_PPLIB_CLOCK_INFO. | ||
| 4758 | USHORT usClockInfoArrayOffset; | ||
| 4759 | |||
| 4760 | // offset from start of this table to array of ATOM_PPLIB_NONCLOCK_INFO | ||
| 4761 | USHORT usNonClockInfoArrayOffset; | ||
| 4762 | |||
| 4763 | USHORT usBackbiasTime; // in microseconds | ||
| 4764 | USHORT usVoltageTime; // in microseconds | ||
| 4765 | USHORT usTableSize; //the size of this structure, or the extended structure | ||
| 4766 | |||
| 4767 | ULONG ulPlatformCaps; // See ATOM_PPLIB_CAPS_* | ||
| 4768 | |||
| 4769 | ATOM_PPLIB_THERMALCONTROLLER sThermalController; | ||
| 4770 | |||
| 4771 | USHORT usBootClockInfoOffset; | ||
| 4772 | USHORT usBootNonClockInfoOffset; | ||
| 4773 | |||
| 4774 | } ATOM_PPLIB_POWERPLAYTABLE; | ||
| 4775 | |||
| 4776 | //// ATOM_PPLIB_NONCLOCK_INFO::usClassification | ||
| 4777 | #define ATOM_PPLIB_CLASSIFICATION_UI_MASK 0x0007 | ||
| 4778 | #define ATOM_PPLIB_CLASSIFICATION_UI_SHIFT 0 | ||
| 4779 | #define ATOM_PPLIB_CLASSIFICATION_UI_NONE 0 | ||
| 4780 | #define ATOM_PPLIB_CLASSIFICATION_UI_BATTERY 1 | ||
| 4781 | #define ATOM_PPLIB_CLASSIFICATION_UI_BALANCED 3 | ||
| 4782 | #define ATOM_PPLIB_CLASSIFICATION_UI_PERFORMANCE 5 | ||
| 4783 | // 2, 4, 6, 7 are reserved | ||
| 4784 | |||
| 4785 | #define ATOM_PPLIB_CLASSIFICATION_BOOT 0x0008 | ||
| 4786 | #define ATOM_PPLIB_CLASSIFICATION_THERMAL 0x0010 | ||
| 4787 | #define ATOM_PPLIB_CLASSIFICATION_LIMITEDPOWERSOURCE 0x0020 | ||
| 4788 | #define ATOM_PPLIB_CLASSIFICATION_REST 0x0040 | ||
| 4789 | #define ATOM_PPLIB_CLASSIFICATION_FORCED 0x0080 | ||
| 4790 | #define ATOM_PPLIB_CLASSIFICATION_3DPERFORMANCE 0x0100 | ||
| 4791 | |||
