Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 1 | /* exynos_drm_encoder.c |
| 2 | * |
| 3 | * Copyright (c) 2011 Samsung Electronics Co., Ltd. |
| 4 | * Authors: |
| 5 | * Inki Dae <inki.dae@samsung.com> |
| 6 | * Joonyoung Shim <jy0922.shim@samsung.com> |
| 7 | * Seung-Woo Kim <sw0312.kim@samsung.com> |
| 8 | * |
| 9 | * Permission is hereby granted, free of charge, to any person obtaining a |
| 10 | * copy of this software and associated documentation files (the "Software"), |
| 11 | * to deal in the Software without restriction, including without limitation |
| 12 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 13 | * and/or sell copies of the Software, and to permit persons to whom the |
| 14 | * Software is furnished to do so, subject to the following conditions: |
| 15 | * |
| 16 | * The above copyright notice and this permission notice (including the next |
| 17 | * paragraph) shall be included in all copies or substantial portions of the |
| 18 | * Software. |
| 19 | * |
| 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 21 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 22 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 23 | * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR |
| 24 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
| 25 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
| 26 | * OTHER DEALINGS IN THE SOFTWARE. |
| 27 | */ |
| 28 | |
David Howells | 760285e | 2012-10-02 18:01:07 +0100 | [diff] [blame^] | 29 | #include <drm/drmP.h> |
| 30 | #include <drm/drm_crtc_helper.h> |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 31 | |
| 32 | #include "exynos_drm_drv.h" |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 33 | #include "exynos_drm_encoder.h" |
| 34 | |
| 35 | #define to_exynos_encoder(x) container_of(x, struct exynos_drm_encoder,\ |
| 36 | drm_encoder) |
| 37 | |
| 38 | /* |
| 39 | * exynos specific encoder structure. |
| 40 | * |
| 41 | * @drm_encoder: encoder object. |
| 42 | * @manager: specific encoder has its own manager to control a hardware |
| 43 | * appropriately and we can access a hardware drawing on this manager. |
Inki Dae | ec05da9 | 2011-12-06 11:06:54 +0900 | [diff] [blame] | 44 | * @dpms: store the encoder dpms value. |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 45 | */ |
| 46 | struct exynos_drm_encoder { |
| 47 | struct drm_encoder drm_encoder; |
| 48 | struct exynos_drm_manager *manager; |
Inki Dae | ec05da9 | 2011-12-06 11:06:54 +0900 | [diff] [blame] | 49 | int dpms; |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 50 | }; |
| 51 | |
Inki Dae | ec05da9 | 2011-12-06 11:06:54 +0900 | [diff] [blame] | 52 | static void exynos_drm_display_power(struct drm_encoder *encoder, int mode) |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 53 | { |
| 54 | struct drm_device *dev = encoder->dev; |
| 55 | struct drm_connector *connector; |
| 56 | struct exynos_drm_manager *manager = exynos_drm_get_manager(encoder); |
Joonyoung Shim | 396464d | 2011-11-14 15:20:49 +0900 | [diff] [blame] | 57 | |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 58 | list_for_each_entry(connector, &dev->mode_config.connector_list, head) { |
| 59 | if (connector->encoder == encoder) { |
Inki Dae | 74ccc53 | 2011-10-19 17:23:07 +0900 | [diff] [blame] | 60 | struct exynos_drm_display_ops *display_ops = |
| 61 | manager->display_ops; |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 62 | |
Joonyoung Shim | d2716c8 | 2011-11-04 17:04:45 +0900 | [diff] [blame] | 63 | DRM_DEBUG_KMS("connector[%d] dpms[%d]\n", |
| 64 | connector->base.id, mode); |
Inki Dae | 74ccc53 | 2011-10-19 17:23:07 +0900 | [diff] [blame] | 65 | if (display_ops && display_ops->power_on) |
| 66 | display_ops->power_on(manager->dev, mode); |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 67 | } |
| 68 | } |
| 69 | } |
| 70 | |
Inki Dae | ec05da9 | 2011-12-06 11:06:54 +0900 | [diff] [blame] | 71 | static void exynos_drm_encoder_dpms(struct drm_encoder *encoder, int mode) |
| 72 | { |
| 73 | struct drm_device *dev = encoder->dev; |
| 74 | struct exynos_drm_manager *manager = exynos_drm_get_manager(encoder); |
| 75 | struct exynos_drm_manager_ops *manager_ops = manager->ops; |
| 76 | struct exynos_drm_encoder *exynos_encoder = to_exynos_encoder(encoder); |
| 77 | |
| 78 | DRM_DEBUG_KMS("%s, encoder dpms: %d\n", __FILE__, mode); |
| 79 | |
| 80 | if (exynos_encoder->dpms == mode) { |
| 81 | DRM_DEBUG_KMS("desired dpms mode is same as previous one.\n"); |
| 82 | return; |
| 83 | } |
| 84 | |
| 85 | mutex_lock(&dev->struct_mutex); |
| 86 | |
| 87 | switch (mode) { |
| 88 | case DRM_MODE_DPMS_ON: |
| 89 | if (manager_ops && manager_ops->apply) |
| 90 | manager_ops->apply(manager->dev); |
| 91 | exynos_drm_display_power(encoder, mode); |
| 92 | exynos_encoder->dpms = mode; |
| 93 | break; |
| 94 | case DRM_MODE_DPMS_STANDBY: |
| 95 | case DRM_MODE_DPMS_SUSPEND: |
| 96 | case DRM_MODE_DPMS_OFF: |
| 97 | exynos_drm_display_power(encoder, mode); |
| 98 | exynos_encoder->dpms = mode; |
| 99 | break; |
| 100 | default: |
| 101 | DRM_ERROR("unspecified mode %d\n", mode); |
| 102 | break; |
| 103 | } |
| 104 | |
| 105 | mutex_unlock(&dev->struct_mutex); |
| 106 | } |
| 107 | |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 108 | static bool |
| 109 | exynos_drm_encoder_mode_fixup(struct drm_encoder *encoder, |
Laurent Pinchart | e811f5a | 2012-07-17 17:56:50 +0200 | [diff] [blame] | 110 | const struct drm_display_mode *mode, |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 111 | struct drm_display_mode *adjusted_mode) |
| 112 | { |
Inki Dae | 1de425b | 2012-03-16 18:47:04 +0900 | [diff] [blame] | 113 | struct drm_device *dev = encoder->dev; |
| 114 | struct drm_connector *connector; |
| 115 | struct exynos_drm_manager *manager = exynos_drm_get_manager(encoder); |
| 116 | struct exynos_drm_manager_ops *manager_ops = manager->ops; |
| 117 | |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 118 | DRM_DEBUG_KMS("%s\n", __FILE__); |
| 119 | |
Inki Dae | 1de425b | 2012-03-16 18:47:04 +0900 | [diff] [blame] | 120 | list_for_each_entry(connector, &dev->mode_config.connector_list, head) { |
| 121 | if (connector->encoder == encoder) |
| 122 | if (manager_ops && manager_ops->mode_fixup) |
| 123 | manager_ops->mode_fixup(manager->dev, connector, |
| 124 | mode, adjusted_mode); |
| 125 | } |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 126 | |
| 127 | return true; |
| 128 | } |
| 129 | |
| 130 | static void exynos_drm_encoder_mode_set(struct drm_encoder *encoder, |
| 131 | struct drm_display_mode *mode, |
| 132 | struct drm_display_mode *adjusted_mode) |
| 133 | { |
| 134 | struct drm_device *dev = encoder->dev; |
| 135 | struct drm_connector *connector; |
| 136 | struct exynos_drm_manager *manager = exynos_drm_get_manager(encoder); |
| 137 | struct exynos_drm_manager_ops *manager_ops = manager->ops; |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 138 | |
| 139 | DRM_DEBUG_KMS("%s\n", __FILE__); |
| 140 | |
Joonyoung Shim | bebab8f | 2012-06-27 14:27:07 +0900 | [diff] [blame] | 141 | exynos_drm_encoder_dpms(encoder, DRM_MODE_DPMS_ON); |
| 142 | |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 143 | list_for_each_entry(connector, &dev->mode_config.connector_list, head) { |
Joonyoung Shim | aeb2922 | 2012-06-27 14:27:01 +0900 | [diff] [blame] | 144 | if (connector->encoder == encoder) |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 145 | if (manager_ops && manager_ops->mode_set) |
Inki Dae | 1de425b | 2012-03-16 18:47:04 +0900 | [diff] [blame] | 146 | manager_ops->mode_set(manager->dev, |
| 147 | adjusted_mode); |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 148 | } |
| 149 | } |
| 150 | |
| 151 | static void exynos_drm_encoder_prepare(struct drm_encoder *encoder) |
| 152 | { |
| 153 | DRM_DEBUG_KMS("%s\n", __FILE__); |
| 154 | |
| 155 | /* drm framework doesn't check NULL. */ |
| 156 | } |
| 157 | |
| 158 | static void exynos_drm_encoder_commit(struct drm_encoder *encoder) |
| 159 | { |
| 160 | struct exynos_drm_manager *manager = exynos_drm_get_manager(encoder); |
| 161 | struct exynos_drm_manager_ops *manager_ops = manager->ops; |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 162 | |
| 163 | DRM_DEBUG_KMS("%s\n", __FILE__); |
| 164 | |
| 165 | if (manager_ops && manager_ops->commit) |
| 166 | manager_ops->commit(manager->dev); |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 167 | } |
| 168 | |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 169 | static struct drm_encoder_helper_funcs exynos_encoder_helper_funcs = { |
| 170 | .dpms = exynos_drm_encoder_dpms, |
| 171 | .mode_fixup = exynos_drm_encoder_mode_fixup, |
| 172 | .mode_set = exynos_drm_encoder_mode_set, |
| 173 | .prepare = exynos_drm_encoder_prepare, |
| 174 | .commit = exynos_drm_encoder_commit, |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 175 | }; |
| 176 | |
| 177 | static void exynos_drm_encoder_destroy(struct drm_encoder *encoder) |
| 178 | { |
| 179 | struct exynos_drm_encoder *exynos_encoder = |
| 180 | to_exynos_encoder(encoder); |
| 181 | |
| 182 | DRM_DEBUG_KMS("%s\n", __FILE__); |
| 183 | |
| 184 | exynos_encoder->manager->pipe = -1; |
| 185 | |
| 186 | drm_encoder_cleanup(encoder); |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 187 | kfree(exynos_encoder); |
| 188 | } |
| 189 | |
| 190 | static struct drm_encoder_funcs exynos_encoder_funcs = { |
| 191 | .destroy = exynos_drm_encoder_destroy, |
| 192 | }; |
| 193 | |
Inki Dae | d081f56 | 2012-02-15 11:25:19 +0900 | [diff] [blame] | 194 | static unsigned int exynos_drm_encoder_clones(struct drm_encoder *encoder) |
| 195 | { |
| 196 | struct drm_encoder *clone; |
| 197 | struct drm_device *dev = encoder->dev; |
| 198 | struct exynos_drm_encoder *exynos_encoder = to_exynos_encoder(encoder); |
| 199 | struct exynos_drm_display_ops *display_ops = |
| 200 | exynos_encoder->manager->display_ops; |
| 201 | unsigned int clone_mask = 0; |
| 202 | int cnt = 0; |
| 203 | |
| 204 | list_for_each_entry(clone, &dev->mode_config.encoder_list, head) { |
| 205 | switch (display_ops->type) { |
| 206 | case EXYNOS_DISPLAY_TYPE_LCD: |
| 207 | case EXYNOS_DISPLAY_TYPE_HDMI: |
Inki Dae | b73d123 | 2012-03-21 10:55:26 +0900 | [diff] [blame] | 208 | case EXYNOS_DISPLAY_TYPE_VIDI: |
Inki Dae | d081f56 | 2012-02-15 11:25:19 +0900 | [diff] [blame] | 209 | clone_mask |= (1 << (cnt++)); |
| 210 | break; |
| 211 | default: |
| 212 | continue; |
| 213 | } |
| 214 | } |
| 215 | |
| 216 | return clone_mask; |
| 217 | } |
| 218 | |
| 219 | void exynos_drm_encoder_setup(struct drm_device *dev) |
| 220 | { |
| 221 | struct drm_encoder *encoder; |
| 222 | |
| 223 | DRM_DEBUG_KMS("%s\n", __FILE__); |
| 224 | |
| 225 | list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) |
| 226 | encoder->possible_clones = exynos_drm_encoder_clones(encoder); |
| 227 | } |
| 228 | |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 229 | struct drm_encoder * |
| 230 | exynos_drm_encoder_create(struct drm_device *dev, |
| 231 | struct exynos_drm_manager *manager, |
| 232 | unsigned int possible_crtcs) |
| 233 | { |
| 234 | struct drm_encoder *encoder; |
| 235 | struct exynos_drm_encoder *exynos_encoder; |
| 236 | |
| 237 | DRM_DEBUG_KMS("%s\n", __FILE__); |
| 238 | |
| 239 | if (!manager || !possible_crtcs) |
| 240 | return NULL; |
| 241 | |
| 242 | if (!manager->dev) |
| 243 | return NULL; |
| 244 | |
| 245 | exynos_encoder = kzalloc(sizeof(*exynos_encoder), GFP_KERNEL); |
| 246 | if (!exynos_encoder) { |
| 247 | DRM_ERROR("failed to allocate encoder\n"); |
| 248 | return NULL; |
| 249 | } |
| 250 | |
Inki Dae | ec05da9 | 2011-12-06 11:06:54 +0900 | [diff] [blame] | 251 | exynos_encoder->dpms = DRM_MODE_DPMS_OFF; |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 252 | exynos_encoder->manager = manager; |
| 253 | encoder = &exynos_encoder->drm_encoder; |
| 254 | encoder->possible_crtcs = possible_crtcs; |
| 255 | |
| 256 | DRM_DEBUG_KMS("possible_crtcs = 0x%x\n", encoder->possible_crtcs); |
| 257 | |
| 258 | drm_encoder_init(dev, encoder, &exynos_encoder_funcs, |
| 259 | DRM_MODE_ENCODER_TMDS); |
| 260 | |
| 261 | drm_encoder_helper_add(encoder, &exynos_encoder_helper_funcs); |
| 262 | |
| 263 | DRM_DEBUG_KMS("encoder has been created\n"); |
| 264 | |
| 265 | return encoder; |
| 266 | } |
| 267 | |
| 268 | struct exynos_drm_manager *exynos_drm_get_manager(struct drm_encoder *encoder) |
| 269 | { |
| 270 | return to_exynos_encoder(encoder)->manager; |
| 271 | } |
| 272 | |
| 273 | void exynos_drm_fn_encoder(struct drm_crtc *crtc, void *data, |
| 274 | void (*fn)(struct drm_encoder *, void *)) |
| 275 | { |
| 276 | struct drm_device *dev = crtc->dev; |
| 277 | struct drm_encoder *encoder; |
Joonyoung Shim | d2716c8 | 2011-11-04 17:04:45 +0900 | [diff] [blame] | 278 | struct exynos_drm_private *private = dev->dev_private; |
| 279 | struct exynos_drm_manager *manager; |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 280 | |
| 281 | list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { |
Joonyoung Shim | d2716c8 | 2011-11-04 17:04:45 +0900 | [diff] [blame] | 282 | /* |
| 283 | * if crtc is detached from encoder, check pipe, |
| 284 | * otherwise check crtc attached to encoder |
| 285 | */ |
| 286 | if (!encoder->crtc) { |
| 287 | manager = to_exynos_encoder(encoder)->manager; |
| 288 | if (manager->pipe < 0 || |
| 289 | private->crtc[manager->pipe] != crtc) |
| 290 | continue; |
| 291 | } else { |
| 292 | if (encoder->crtc != crtc) |
| 293 | continue; |
| 294 | } |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 295 | |
| 296 | fn(encoder, data); |
| 297 | } |
| 298 | } |
| 299 | |
| 300 | void exynos_drm_enable_vblank(struct drm_encoder *encoder, void *data) |
| 301 | { |
| 302 | struct exynos_drm_manager *manager = |
| 303 | to_exynos_encoder(encoder)->manager; |
| 304 | struct exynos_drm_manager_ops *manager_ops = manager->ops; |
| 305 | int crtc = *(int *)data; |
| 306 | |
Joonyoung Shim | d249ce0 | 2012-06-27 14:27:02 +0900 | [diff] [blame] | 307 | if (manager->pipe != crtc) |
| 308 | return; |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 309 | |
| 310 | if (manager_ops->enable_vblank) |
| 311 | manager_ops->enable_vblank(manager->dev); |
| 312 | } |
| 313 | |
| 314 | void exynos_drm_disable_vblank(struct drm_encoder *encoder, void *data) |
| 315 | { |
| 316 | struct exynos_drm_manager *manager = |
| 317 | to_exynos_encoder(encoder)->manager; |
| 318 | struct exynos_drm_manager_ops *manager_ops = manager->ops; |
| 319 | int crtc = *(int *)data; |
| 320 | |
Joonyoung Shim | d249ce0 | 2012-06-27 14:27:02 +0900 | [diff] [blame] | 321 | if (manager->pipe != crtc) |
| 322 | return; |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 323 | |
| 324 | if (manager_ops->disable_vblank) |
| 325 | manager_ops->disable_vblank(manager->dev); |
| 326 | } |
| 327 | |
Inki Dae | ec05da9 | 2011-12-06 11:06:54 +0900 | [diff] [blame] | 328 | void exynos_drm_encoder_crtc_dpms(struct drm_encoder *encoder, void *data) |
| 329 | { |
Inki Dae | ec05da9 | 2011-12-06 11:06:54 +0900 | [diff] [blame] | 330 | struct exynos_drm_encoder *exynos_encoder = to_exynos_encoder(encoder); |
| 331 | struct exynos_drm_manager *manager = exynos_encoder->manager; |
| 332 | struct exynos_drm_manager_ops *manager_ops = manager->ops; |
Inki Dae | ec05da9 | 2011-12-06 11:06:54 +0900 | [diff] [blame] | 333 | int mode = *(int *)data; |
| 334 | |
| 335 | DRM_DEBUG_KMS("%s\n", __FILE__); |
| 336 | |
| 337 | if (manager_ops && manager_ops->dpms) |
| 338 | manager_ops->dpms(manager->dev, mode); |
| 339 | |
| 340 | /* |
Inki Dae | ec05da9 | 2011-12-06 11:06:54 +0900 | [diff] [blame] | 341 | * if this condition is ok then it means that the crtc is already |
| 342 | * detached from encoder and last function for detaching is properly |
| 343 | * done, so clear pipe from manager to prevent repeated call. |
| 344 | */ |
| 345 | if (mode > DRM_MODE_DPMS_ON) { |
| 346 | if (!encoder->crtc) |
| 347 | manager->pipe = -1; |
| 348 | } |
| 349 | } |
| 350 | |
Joonyoung Shim | d249ce0 | 2012-06-27 14:27:02 +0900 | [diff] [blame] | 351 | void exynos_drm_encoder_crtc_pipe(struct drm_encoder *encoder, void *data) |
| 352 | { |
| 353 | struct exynos_drm_manager *manager = |
| 354 | to_exynos_encoder(encoder)->manager; |
| 355 | int pipe = *(int *)data; |
| 356 | |
| 357 | DRM_DEBUG_KMS("%s\n", __FILE__); |
| 358 | |
| 359 | /* |
| 360 | * when crtc is detached from encoder, this pipe is used |
| 361 | * to select manager operation |
| 362 | */ |
| 363 | manager->pipe = pipe; |
| 364 | } |
Joonyoung Shim | 4070d21 | 2012-06-27 14:27:05 +0900 | [diff] [blame] | 365 | |
| 366 | void exynos_drm_encoder_plane_mode_set(struct drm_encoder *encoder, void *data) |
| 367 | { |
| 368 | struct exynos_drm_manager *manager = |
| 369 | to_exynos_encoder(encoder)->manager; |
| 370 | struct exynos_drm_overlay_ops *overlay_ops = manager->overlay_ops; |
| 371 | struct exynos_drm_overlay *overlay = data; |
| 372 | |
| 373 | DRM_DEBUG_KMS("%s\n", __FILE__); |
| 374 | |
| 375 | if (overlay_ops && overlay_ops->mode_set) |
| 376 | overlay_ops->mode_set(manager->dev, overlay); |
| 377 | } |
| 378 | |
| 379 | void exynos_drm_encoder_plane_commit(struct drm_encoder *encoder, void *data) |
| 380 | { |
| 381 | struct exynos_drm_manager *manager = |
| 382 | to_exynos_encoder(encoder)->manager; |
| 383 | struct exynos_drm_overlay_ops *overlay_ops = manager->overlay_ops; |
| 384 | int zpos = DEFAULT_ZPOS; |
| 385 | |
| 386 | DRM_DEBUG_KMS("%s\n", __FILE__); |
| 387 | |
| 388 | if (data) |
| 389 | zpos = *(int *)data; |
| 390 | |
| 391 | if (overlay_ops && overlay_ops->commit) |
| 392 | overlay_ops->commit(manager->dev, zpos); |
| 393 | } |
| 394 | |
Joonyoung Shim | cf5188a | 2012-06-27 14:27:09 +0900 | [diff] [blame] | 395 | void exynos_drm_encoder_plane_enable(struct drm_encoder *encoder, void *data) |
| 396 | { |
| 397 | struct exynos_drm_manager *manager = |
| 398 | to_exynos_encoder(encoder)->manager; |
| 399 | struct exynos_drm_overlay_ops *overlay_ops = manager->overlay_ops; |
| 400 | int zpos = DEFAULT_ZPOS; |
| 401 | |
| 402 | DRM_DEBUG_KMS("%s\n", __FILE__); |
| 403 | |
| 404 | if (data) |
| 405 | zpos = *(int *)data; |
| 406 | |
| 407 | if (overlay_ops && overlay_ops->enable) |
| 408 | overlay_ops->enable(manager->dev, zpos); |
| 409 | } |
| 410 | |
Joonyoung Shim | 4070d21 | 2012-06-27 14:27:05 +0900 | [diff] [blame] | 411 | void exynos_drm_encoder_plane_disable(struct drm_encoder *encoder, void *data) |
| 412 | { |
| 413 | struct exynos_drm_manager *manager = |
| 414 | to_exynos_encoder(encoder)->manager; |
| 415 | struct exynos_drm_overlay_ops *overlay_ops = manager->overlay_ops; |
| 416 | int zpos = DEFAULT_ZPOS; |
| 417 | |
| 418 | DRM_DEBUG_KMS("%s\n", __FILE__); |
| 419 | |
| 420 | if (data) |
| 421 | zpos = *(int *)data; |
| 422 | |
| 423 | if (overlay_ops && overlay_ops->disable) |
| 424 | overlay_ops->disable(manager->dev, zpos); |
| 425 | } |