diff options
author | Dave Airlie <airlied@redhat.com> | 2016-11-10 18:25:32 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2016-11-10 18:25:32 -0500 |
commit | db8feb6979e91c2e916631a75dbfe9f10f6b05e5 (patch) | |
tree | b4aa5965f207c18d908a794e5f4e647604d77553 /drivers/gpu/drm/i915/intel_sprite.c | |
parent | afdd548f742ca454fc343696de472f3aaa5dc488 (diff) | |
parent | 58e197d631d44f9f4817b8198b43132a40de1164 (diff) |
Merge tag 'drm-intel-next-2016-11-08' of git://anongit.freedesktop.org/git/drm-intel into drm-next
- gpu idling rework for s/r (Imre)
- vlv mappable scanout fix
- speed up probing in resume (Lyude)
- dp audio workarounds for gen9 (Dhinakaran)
- more conversion to using dev_priv internally (Ville)
- more gen9+ wm fixes and cleanups (Maarten)
- shrinker cleanup&fixes (Chris)
- reorg plane init code (Ville)
- implement support for multiple timelines (prep work for scheduler)
from Chris and all
- untangle dev->struct_mutex locking as prep for multiple timelines
(Chris)
- refactor bxt phy code and collect it all in intel_dpio_phy.c (Ander)
- another gvt with bugfixes all over from Zhenyu
- piles of lspcon fixes from Imre
- 90/270 rotation fixes (Ville)
- guc log buffer support (Akash+Sagar)
- fbc fixes from Paulo
- untangle rpm vs. tiling-fences/mmaps (Chris)
- fix atomic commit to wait on the right fences (Daniel Stone)
* tag 'drm-intel-next-2016-11-08' of git://anongit.freedesktop.org/git/drm-intel: (181 commits)
drm/i915: Update DRIVER_DATE to 20161108
drm/i915: Mark CPU cache as dirty when used for rendering
drm/i915: Add assert for no pending GPU requests during suspend/resume in LR mode
drm/i915: Make sure engines are idle during GPU idling in LR mode
drm/i915: Avoid early GPU idling due to race with new request
drm/i915: Avoid early GPU idling due to already pending idle work
drm/i915: Limit Valleyview and earlier to only using mappable scanout
drm/i915: Round tile chunks up for constructing partial VMAs
drm/i915: Remove the vma from the object list upon close
drm/i915: Reinit polling before hpd when resuming
drm/i915: Remove redundant reprobe in i915_drm_resume
drm/i915/dp: Extend BDW DP audio workaround to GEN9 platforms
drm/i915/dp: BDW cdclk fix for DP audio
drm/i915: Fix pages pin counting around swizzle quirk
drm/i915: Fix test on inputs for vma_compare()
drm/i915/guc: Cache the client mapping
drm/i915: Tidy slab cache allocations
drm/i915: Introduce HAS_64BIT_RELOC
drm/i915: Show the execlist queue in debugfs/i915_engine_info
drm/i915: Unify global_list into global_link
...
Diffstat (limited to 'drivers/gpu/drm/i915/intel_sprite.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_sprite.c | 91 |
1 files changed, 40 insertions, 51 deletions
diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c index 43d0350856e7..df0fbb4b15a3 100644 --- a/drivers/gpu/drm/i915/intel_sprite.c +++ b/drivers/gpu/drm/i915/intel_sprite.c | |||
@@ -1042,10 +1042,10 @@ static uint32_t skl_plane_formats[] = { | |||
1042 | DRM_FORMAT_VYUY, | 1042 | DRM_FORMAT_VYUY, |
1043 | }; | 1043 | }; |
1044 | 1044 | ||
1045 | int | 1045 | struct intel_plane * |
1046 | intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane) | 1046 | intel_sprite_plane_create(struct drm_i915_private *dev_priv, |
1047 | enum pipe pipe, int plane) | ||
1047 | { | 1048 | { |
1048 | struct drm_i915_private *dev_priv = to_i915(dev); | ||
1049 | struct intel_plane *intel_plane = NULL; | 1049 | struct intel_plane *intel_plane = NULL; |
1050 | struct intel_plane_state *state = NULL; | 1050 | struct intel_plane_state *state = NULL; |
1051 | unsigned long possible_crtcs; | 1051 | unsigned long possible_crtcs; |
@@ -1054,9 +1054,6 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane) | |||
1054 | int num_plane_formats; | 1054 | int num_plane_formats; |
1055 | int ret; | 1055 | int ret; |
1056 | 1056 | ||
1057 | if (INTEL_INFO(dev)->gen < 5) | ||
1058 | return -ENODEV; | ||
1059 | |||
1060 | intel_plane = kzalloc(sizeof(*intel_plane), GFP_KERNEL); | 1057 | intel_plane = kzalloc(sizeof(*intel_plane), GFP_KERNEL); |
1061 | if (!intel_plane) { | 1058 | if (!intel_plane) { |
1062 | ret = -ENOMEM; | 1059 | ret = -ENOMEM; |
@@ -1070,25 +1067,25 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane) | |||
1070 | } | 1067 | } |
1071 | intel_plane->base.state = &state->base; | 1068 | intel_plane->base.state = &state->base; |
1072 | 1069 | ||
1073 | switch (INTEL_INFO(dev)->gen) { | 1070 | if (INTEL_GEN(dev_priv) >= 9) { |
1074 | case 5: | ||
1075 | case 6: | ||
1076 | intel_plane->can_scale = true; | 1071 | intel_plane->can_scale = true; |
1077 | intel_plane->max_downscale = 16; | 1072 | state->scaler_id = -1; |
1078 | intel_plane->update_plane = ilk_update_plane; | ||
1079 | intel_plane->disable_plane = ilk_disable_plane; | ||
1080 | 1073 | ||
1081 | if (IS_GEN6(dev_priv)) { | 1074 | intel_plane->update_plane = skl_update_plane; |
1082 | plane_formats = snb_plane_formats; | 1075 | intel_plane->disable_plane = skl_disable_plane; |
1083 | num_plane_formats = ARRAY_SIZE(snb_plane_formats); | ||
1084 | } else { | ||
1085 | plane_formats = ilk_plane_formats; | ||
1086 | num_plane_formats = ARRAY_SIZE(ilk_plane_formats); | ||
1087 | } | ||
1088 | break; | ||
1089 | 1076 | ||
1090 | case 7: | 1077 | plane_formats = skl_plane_formats; |
1091 | case 8: | 1078 | num_plane_formats = ARRAY_SIZE(skl_plane_formats); |
1079 | } else if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) { | ||
1080 | intel_plane->can_scale = false; | ||
1081 | intel_plane->max_downscale = 1; | ||
1082 | |||
1083 | intel_plane->update_plane = vlv_update_plane; | ||
1084 | intel_plane->disable_plane = vlv_disable_plane; | ||
1085 | |||
1086 | plane_formats = vlv_plane_formats; | ||
1087 | num_plane_formats = ARRAY_SIZE(vlv_plane_formats); | ||
1088 | } else if (INTEL_GEN(dev_priv) >= 7) { | ||
1092 | if (IS_IVYBRIDGE(dev_priv)) { | 1089 | if (IS_IVYBRIDGE(dev_priv)) { |
1093 | intel_plane->can_scale = true; | 1090 | intel_plane->can_scale = true; |
1094 | intel_plane->max_downscale = 2; | 1091 | intel_plane->max_downscale = 2; |
@@ -1097,33 +1094,25 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane) | |||
1097 | intel_plane->max_downscale = 1; | 1094 | intel_plane->max_downscale = 1; |
1098 | } | 1095 | } |
1099 | 1096 | ||
1100 | if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) { | 1097 | intel_plane->update_plane = ivb_update_plane; |
1101 | intel_plane->update_plane = vlv_update_plane; | 1098 | intel_plane->disable_plane = ivb_disable_plane; |
1102 | intel_plane->disable_plane = vlv_disable_plane; | ||
1103 | 1099 | ||
1104 | plane_formats = vlv_plane_formats; | 1100 | plane_formats = snb_plane_formats; |
1105 | num_plane_formats = ARRAY_SIZE(vlv_plane_formats); | 1101 | num_plane_formats = ARRAY_SIZE(snb_plane_formats); |
1106 | } else { | 1102 | } else { |
1107 | intel_plane->update_plane = ivb_update_plane; | 1103 | intel_plane->can_scale = true; |
1108 | intel_plane->disable_plane = ivb_disable_plane; | 1104 | intel_plane->max_downscale = 16; |
1105 | |||
1106 | intel_plane->update_plane = ilk_update_plane; | ||
1107 | intel_plane->disable_plane = ilk_disable_plane; | ||
1109 | 1108 | ||
1109 | if (IS_GEN6(dev_priv)) { | ||
1110 | plane_formats = snb_plane_formats; | 1110 | plane_formats = snb_plane_formats; |
1111 | num_plane_formats = ARRAY_SIZE(snb_plane_formats); | 1111 | num_plane_formats = ARRAY_SIZE(snb_plane_formats); |
1112 | } else { | ||
1113 | plane_formats = ilk_plane_formats; | ||
1114 | num_plane_formats = ARRAY_SIZE(ilk_plane_formats); | ||
1112 | } | 1115 | } |
1113 | break; | ||
1114 | case 9: | ||
1115 | intel_plane->can_scale = true; | ||
1116 | intel_plane->update_plane = skl_update_plane; | ||
1117 | intel_plane->disable_plane = skl_disable_plane; | ||
1118 | state->scaler_id = -1; | ||
1119 | |||
1120 | plane_formats = skl_plane_formats; | ||
1121 | num_plane_formats = ARRAY_SIZE(skl_plane_formats); | ||
1122 | break; | ||
1123 | default: | ||
1124 | MISSING_CASE(INTEL_INFO(dev)->gen); | ||
1125 | ret = -ENODEV; | ||
1126 | goto fail; | ||
1127 | } | 1116 | } |
1128 | 1117 | ||
1129 | if (INTEL_GEN(dev_priv) >= 9) { | 1118 | if (INTEL_GEN(dev_priv) >= 9) { |
@@ -1142,15 +1131,15 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane) | |||
1142 | 1131 | ||
1143 | possible_crtcs = (1 << pipe); | 1132 | possible_crtcs = (1 << pipe); |
1144 | 1133 | ||
1145 | if (INTEL_INFO(dev)->gen >= 9) | 1134 | if (INTEL_GEN(dev_priv) >= 9) |
1146 | ret = drm_universal_plane_init(dev, &intel_plane->base, possible_crtcs, | 1135 | ret = drm_universal_plane_init(&dev_priv->drm, &intel_plane->base, |
1147 | &intel_plane_funcs, | 1136 | possible_crtcs, &intel_plane_funcs, |
1148 | plane_formats, num_plane_formats, | 1137 | plane_formats, num_plane_formats, |
1149 | DRM_PLANE_TYPE_OVERLAY, | 1138 | DRM_PLANE_TYPE_OVERLAY, |
1150 | "plane %d%c", plane + 2, pipe_name(pipe)); | 1139 | "plane %d%c", plane + 2, pipe_name(pipe)); |
1151 | else | 1140 | else |
1152 | ret = drm_universal_plane_init(dev, &intel_plane->base, possible_crtcs, | 1141 | ret = drm_universal_plane_init(&dev_priv->drm, &intel_plane->base, |
1153 | &intel_plane_funcs, | 1142 | possible_crtcs, &intel_plane_funcs, |
1154 | plane_formats, num_plane_formats, | 1143 | plane_formats, num_plane_formats, |
1155 | DRM_PLANE_TYPE_OVERLAY, | 1144 | DRM_PLANE_TYPE_OVERLAY, |
1156 | "sprite %c", sprite_name(pipe, plane)); | 1145 | "sprite %c", sprite_name(pipe, plane)); |
@@ -1163,11 +1152,11 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane) | |||
1163 | 1152 | ||
1164 | drm_plane_helper_add(&intel_plane->base, &intel_plane_helper_funcs); | 1153 | drm_plane_helper_add(&intel_plane->base, &intel_plane_helper_funcs); |
1165 | 1154 | ||
1166 | return 0; | 1155 | return intel_plane; |
1167 | 1156 | ||
1168 | fail: | 1157 | fail: |
1169 | kfree(state); | 1158 | kfree(state); |
1170 | kfree(intel_plane); | 1159 | kfree(intel_plane); |
1171 | 1160 | ||
1172 | return ret; | 1161 | return ERR_PTR(ret); |
1173 | } | 1162 | } |