blob: 46e23986e8fdd615679bd7e7977372b1d1ca168d [file] [log] [blame]
Narendra Muppalla1b0b3352015-09-29 10:16:51 -07001/* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 */
12
13#ifndef __SDE_KMS_H__
14#define __SDE_KMS_H__
15
16#include "msm_drv.h"
17#include "msm_kms.h"
Alan Kwong112a84f2016-05-24 20:49:21 -040018#include "msm_mmu.h"
Narendra Muppalla1b0b3352015-09-29 10:16:51 -070019#include "mdp/mdp_kms.h"
20#include "sde_hw_catalog.h"
Clarence Ipc475b082016-06-26 09:27:23 -040021#include "sde_hw_ctl.h"
Abhijit Kulkarni40e38162016-06-26 22:12:09 -040022#include "sde_hw_lm.h"
Ben Chan78647cd2016-06-26 22:02:47 -040023#include "sde_hw_interrupts.h"
Alan Kwongd21960f2016-07-29 03:33:17 -040024#include "sde_hw_wb.h"
25#include "sde_hw_top.h"
Clarence Ipe59fb3f2016-07-26 13:39:59 -040026#include "sde_connector.h"
Lloyd Atkinson11f34442016-08-11 11:19:52 -040027#include "sde_rm.h"
Dhaval Patel3949f032016-06-20 16:24:33 -070028#include "sde_power_handle.h"
Alan Kwongf5dd86c2016-08-09 18:08:17 -040029#include "sde_irq.h"
Ben Chan78647cd2016-06-26 22:02:47 -040030
Clarence Ip31c19b52016-06-10 15:42:08 -040031/**
32 * SDE_DEBUG - macro for kms/plane/crtc/encoder/connector logs
33 * @fmt: Pointer to format string
34 */
35#define SDE_DEBUG(fmt, ...) \
36 do { \
37 if (unlikely(drm_debug & DRM_UT_KMS)) \
38 drm_ut_debug_printk(__func__, fmt, ##__VA_ARGS__); \
39 else \
40 pr_debug(fmt, ##__VA_ARGS__); \
41 } while (0)
42
43/**
44 * SDE_DEBUG_DRIVER - macro for hardware driver logging
45 * @fmt: Pointer to format string
46 */
47#define SDE_DEBUG_DRIVER(fmt, ...) \
48 do { \
49 if (unlikely(drm_debug & DRM_UT_DRIVER)) \
50 drm_ut_debug_printk(__func__, fmt, ##__VA_ARGS__); \
51 else \
52 pr_debug(fmt, ##__VA_ARGS__); \
53 } while (0)
54
55#define SDE_ERROR(fmt, ...) pr_err(fmt, ##__VA_ARGS__)
56
Dhaval Patelec10fad2016-08-22 14:40:48 -070057#define POPULATE_RECT(rect, a, b, c, d, Q16_flag) \
58 do { \
59 (rect)->x = (Q16_flag) ? (a) >> 16 : (a); \
60 (rect)->y = (Q16_flag) ? (b) >> 16 : (b); \
61 (rect)->w = (Q16_flag) ? (c) >> 16 : (c); \
62 (rect)->h = (Q16_flag) ? (d) >> 16 : (d); \
63 } while (0)
64
65#define CHECK_LAYER_BOUNDS(offset, size, max_size) \
66 (((size) > (max_size)) || ((offset) > ((max_size) - (size))))
67
Clarence Ipfd96ba22016-09-09 16:45:44 -040068/**
69 * ktime_compare_safe - compare two ktime structures
70 * This macro is similar to the standard ktime_compare() function, but
71 * attempts to also handle ktime overflows.
72 * @A: First ktime value
73 * @B: Second ktime value
74 * Returns: -1 if A < B, 0 if A == B, 1 if A > B
75 */
76#define ktime_compare_safe(A, B) \
77 ktime_compare(ktime_sub((A), (B)), ktime_set(0, 0))
78
Ben Chan78647cd2016-06-26 22:02:47 -040079/*
80 * struct sde_irq_callback - IRQ callback handlers
81 * @func: intr handler
82 * @arg: argument for the handler
83 */
84struct sde_irq_callback {
85 void (*func)(void *arg, int irq_idx);
86 void *arg;
87};
88
89/**
90 * struct sde_irq: IRQ structure contains callback registration info
91 * @total_irq: total number of irq_idx obtained from HW interrupts mapping
92 * @irq_cb_tbl: array of IRQ callbacks setting
93 * @cb_lock: callback lock
94 */
95struct sde_irq {
96 u32 total_irqs;
97 struct sde_irq_callback *irq_cb_tbl;
98 spinlock_t cb_lock;
99};
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700100
Abhijit Kulkarni40e38162016-06-26 22:12:09 -0400101/**
Lloyd Atkinson11f34442016-08-11 11:19:52 -0400102 * Encoder functions and data types
103 * @intfs: Interfaces this encoder is using, INTF_MODE_NONE if unused
104 * @wbs: Writebacks this encoder is using, INTF_MODE_NONE if unused
105 * @needs_cdm: Encoder requests a CDM based on pixel format conversion needs
106 * @display_num_of_h_tiles:
Abhijit Kulkarni40e38162016-06-26 22:12:09 -0400107 */
Lloyd Atkinson11f34442016-08-11 11:19:52 -0400108struct sde_encoder_hw_resources {
109 enum sde_intf_mode intfs[INTF_MAX];
110 enum sde_intf_mode wbs[WB_MAX];
111 bool needs_cdm;
112 u32 display_num_of_h_tiles;
Abhijit Kulkarni40e38162016-06-26 22:12:09 -0400113};
114
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700115struct sde_kms {
Ben Chan78647cd2016-06-26 22:02:47 -0400116 struct msm_kms base;
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700117 struct drm_device *dev;
Dhaval Patel3949f032016-06-20 16:24:33 -0700118 int core_rev;
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700119 struct sde_mdss_cfg *catalog;
120
Alan Kwong112a84f2016-05-24 20:49:21 -0400121 struct msm_mmu *mmu[MSM_SMMU_DOMAIN_MAX];
122 int mmu_id[MSM_SMMU_DOMAIN_MAX];
Dhaval Patel3949f032016-06-20 16:24:33 -0700123 struct sde_power_client *core_client;
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700124
Clarence Ip4ce59322016-06-26 22:27:51 -0400125 /* directory entry for debugfs */
126 void *debugfs_root;
127
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700128 /* io/register spaces: */
Alan Kwongdfa8c082016-07-29 04:10:00 -0400129 void __iomem *mmio, *vbif[VBIF_MAX];
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700130
131 struct regulator *vdd;
132 struct regulator *mmagic;
133 struct regulator *venus;
134
Alan Kwongf5dd86c2016-08-09 18:08:17 -0400135 struct sde_irq_controller irq_controller;
Ben Chan78647cd2016-06-26 22:02:47 -0400136
137 struct sde_hw_intr *hw_intr;
138 struct sde_irq irq_obj;
Lloyd Atkinson11f34442016-08-11 11:19:52 -0400139
140 struct sde_rm rm;
Alan Kwong5d324e42016-07-28 22:56:18 -0400141
142 struct sde_hw_vbif *hw_vbif[VBIF_MAX];
143 struct sde_hw_mdp *hw_mdp;
Ben Chan78647cd2016-06-26 22:02:47 -0400144};
145
146struct vsync_info {
147 u32 frame_count;
148 u32 line_count;
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700149};
150
151#define to_sde_kms(x) container_of(x, struct sde_kms, base)
152
Alan Kwong5d324e42016-07-28 22:56:18 -0400153struct sde_vbif_set_ot_params {
154 u32 xin_id;
155 u32 num;
156 u32 width;
157 u32 height;
158 u32 frame_rate;
159 bool rd;
160 bool is_wfd;
161 u32 vbif_idx;
162 u32 clk_ctrl;
163};
164
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700165struct sde_plane_state {
166 struct drm_plane_state base;
167
168 /* aligned with property */
Clarence Ipe78efb72016-06-24 18:35:21 -0400169 uint64_t property_values[PLANE_PROP_COUNT];
170
171 /* blob properties */
172 struct drm_property_blob *property_blobs[PLANE_PROP_BLOBCOUNT];
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700173
Clarence Ipcae1bb62016-07-07 12:07:13 -0400174 /* dereferenced input fence pointer */
175 void *input_fence;
Clarence Ipae4e60c2016-06-26 22:44:04 -0400176
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700177 /* assigned by crtc blender */
178 enum sde_stage stage;
179
180 /* some additional transactional status to help us know in the
181 * apply path whether we need to update SMP allocation, and
182 * whether current update is still pending:
183 */
184 bool mode_changed : 1;
185 bool pending : 1;
186};
187
188#define to_sde_plane_state(x) \
Clarence Ip4c1d9772016-06-26 09:35:38 -0400189 container_of(x, struct sde_plane_state, base)
190
191/**
192 * sde_plane_get_property - Query integer value of plane property
193 *
194 * @S: Pointer to plane state
195 * @X: Property index, from enum msm_mdp_plane_property
196 *
197 * Return: Integer value of requested property
198 */
199#define sde_plane_get_property(S, X) \
200 ((S) && ((X) < PLANE_PROP_COUNT) ? ((S)->property_values[(X)]) : 0)
201
202/**
203 * sde_plane_get_property32 - Query 32-bit representation of plane property
204 *
205 * @S: Pointer to plane state
206 * @X: Property index, from enum msm_mdp_plane_property
207 *
208 * Return: 32-bit value of requested property
209 */
210#define sde_plane_get_property32(S, X) \
211 ((S) && ((X) < PLANE_PROP_COUNT) ? \
212 (uint32_t)((S)->property_values[(X)]) : 0)
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700213
Ben Chan78647cd2016-06-26 22:02:47 -0400214/**
Clarence Ip4ce59322016-06-26 22:27:51 -0400215 * Debugfs functions - extra helper functions for debugfs support
216 *
217 * Main debugfs documentation is located at,
218 *
219 * Documentation/filesystems/debugfs.txt
220 *
221 * @sde_debugfs_setup_regset32: Initialize data for sde_debugfs_create_regset32
222 * @sde_debugfs_create_regset32: Create 32-bit register dump file
223 * @sde_debugfs_get_root: Get root dentry for SDE_KMS's debugfs node
224 */
225
226/**
227 * Companion structure for sde_debugfs_create_regset32. Do not initialize the
228 * members of this structure explicitly; use sde_debugfs_setup_regset32 instead.
229 */
230struct sde_debugfs_regset32 {
231 uint32_t offset;
232 uint32_t blk_len;
233 void __iomem *base;
234};
235
236/**
237 * sde_debugfs_setup_regset32 - Initialize register block definition for debugfs
238 * This function is meant to initialize sde_debugfs_regset32 structures for use
239 * with sde_debugfs_create_regset32.
240 * @regset: opaque register definition structure
241 * @offset: sub-block offset
242 * @length: sub-block length, in bytes
243 * @base: base IOMEM address
244 */
245void sde_debugfs_setup_regset32(struct sde_debugfs_regset32 *regset,
246 uint32_t offset, uint32_t length, void __iomem *base);
247
248/**
249 * sde_debugfs_create_regset32 - Create register read back file for debugfs
250 *
251 * This function is almost identical to the standard debugfs_create_regset32()
252 * function, with the main difference being that a list of register
253 * names/offsets do not need to be provided. The 'read' function simply outputs
254 * sequential register values over a specified range.
255 *
256 * Similar to the related debugfs_create_regset32 API, the structure pointed to
257 * by regset needs to persist for the lifetime of the created file. The calling
258 * code is responsible for initialization/management of this structure.
259 *
260 * The structure pointed to by regset is meant to be opaque. Please use
261 * sde_debugfs_setup_regset32 to initialize it.
262 *
263 * @name: File name within debugfs
264 * @mode: File mode within debugfs
265 * @parent: Parent directory entry within debugfs, can be NULL
266 * @regset: Pointer to persistent register block definition
267 *
268 * Return: dentry pointer for newly created file, use either debugfs_remove()
269 * or debugfs_remove_recursive() (on a parent directory) to remove the
270 * file
271 */
272void *sde_debugfs_create_regset32(const char *name, umode_t mode,
273 void *parent, struct sde_debugfs_regset32 *regset);
274
275/**
276 * sde_debugfs_get_root - Return root directory entry for SDE's debugfs
277 *
278 * The return value should be passed as the 'parent' argument to subsequent
279 * debugfs create calls.
280 *
281 * @sde_kms: Pointer to SDE's KMS structure
282 *
283 * Return: dentry pointer for SDE's debugfs location
284 */
285void *sde_debugfs_get_root(struct sde_kms *sde_kms);
286
287/**
Clarence Ipb218a3c2016-07-15 14:17:42 -0400288 * SDE info management functions
289 * These functions/definitions allow for building up a 'sde_info' structure
290 * containing one or more "key=value\n" entries.
291 */
292#define SDE_KMS_INFO_MAX_SIZE 4096
293
294/**
295 * struct sde_kms_info - connector information structure container
296 * @data: Array of information character data
297 * @len: Current length of information data
298 * @staged_len: Temporary data buffer length, commit to
299 * len using sde_kms_info_stop
300 * @start: Whether or not a partial data entry was just started
301 */
302struct sde_kms_info {
303 char data[SDE_KMS_INFO_MAX_SIZE];
304 uint32_t len;
305 uint32_t staged_len;
306 bool start;
307};
308
309/**
310 * SDE_KMS_INFO_DATA - Macro for accessing sde_kms_info data bytes
311 * @S: Pointer to sde_kms_info structure
312 * Returns: Pointer to byte data
313 */
314#define SDE_KMS_INFO_DATA(S) ((S) ? ((struct sde_kms_info *)(S))->data : 0)
315
316/**
317 * SDE_KMS_INFO_DATALEN - Macro for accessing sde_kms_info data length
318 * @S: Pointer to sde_kms_info structure
319 * Returns: Size of available byte data
320 */
321#define SDE_KMS_INFO_DATALEN(S) ((S) ? ((struct sde_kms_info *)(S))->len : 0)
322
323/**
324 * sde_kms_info_reset - reset sde_kms_info structure
325 * @info: Pointer to sde_kms_info structure
326 */
327void sde_kms_info_reset(struct sde_kms_info *info);
328
329/**
330 * sde_kms_info_add_keyint - add integer value to 'sde_kms_info'
331 * @info: Pointer to sde_kms_info structure
332 * @key: Pointer to key string
333 * @value: Signed 32-bit integer value
334 */
335void sde_kms_info_add_keyint(struct sde_kms_info *info,
336 const char *key,
337 int32_t value);
338
339/**
340 * sde_kms_info_add_keystr - add string value to 'sde_kms_info'
341 * @info: Pointer to sde_kms_info structure
342 * @key: Pointer to key string
343 * @value: Pointer to string value
344 */
345void sde_kms_info_add_keystr(struct sde_kms_info *info,
346 const char *key,
347 const char *value);
348
349/**
350 * sde_kms_info_start - begin adding key to 'sde_kms_info'
351 * Usage:
352 * sde_kms_info_start(key)
353 * sde_kms_info_append(val_1)
354 * ...
355 * sde_kms_info_append(val_n)
356 * sde_kms_info_stop
357 * @info: Pointer to sde_kms_info structure
358 * @key: Pointer to key string
359 */
360void sde_kms_info_start(struct sde_kms_info *info,
361 const char *key);
362
363/**
364 * sde_kms_info_append - append value string to 'sde_kms_info'
365 * Usage:
366 * sde_kms_info_start(key)
367 * sde_kms_info_append(val_1)
368 * ...
369 * sde_kms_info_append(val_n)
370 * sde_kms_info_stop
371 * @info: Pointer to sde_kms_info structure
372 * @str: Pointer to partial value string
373 */
374void sde_kms_info_append(struct sde_kms_info *info,
375 const char *str);
376
377/**
378 * sde_kms_info_append_format - append format code string to 'sde_kms_info'
379 * Usage:
380 * sde_kms_info_start(key)
381 * sde_kms_info_append_format(fourcc, modifier)
382 * ...
383 * sde_kms_info_stop
384 * @info: Pointer to sde_kms_info structure
385 * @pixel_format: FOURCC format code
386 * @modifier: 64-bit drm format modifier
387 */
388void sde_kms_info_append_format(struct sde_kms_info *info,
389 uint32_t pixel_format,
390 uint64_t modifier);
391
392/**
393 * sde_kms_info_stop - finish adding key to 'sde_kms_info'
394 * Usage:
395 * sde_kms_info_start(key)
396 * sde_kms_info_append(val_1)
397 * ...
398 * sde_kms_info_append(val_n)
399 * sde_kms_info_stop
400 * @info: Pointer to sde_kms_info structure
401 */
402void sde_kms_info_stop(struct sde_kms_info *info);
403
404/**
Ben Chan78647cd2016-06-26 22:02:47 -0400405 * Vblank enable/disable functions
406 */
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700407int sde_enable_vblank(struct msm_kms *kms, struct drm_crtc *crtc);
408void sde_disable_vblank(struct msm_kms *kms, struct drm_crtc *crtc);
409
Abhijit Kulkarni40e38162016-06-26 22:12:09 -0400410/**
411 * Plane functions
412 */
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700413enum sde_sspp sde_plane_pipe(struct drm_plane *plane);
Clarence Ipcae1bb62016-07-07 12:07:13 -0400414void sde_plane_flush(struct drm_plane *plane);
Clarence Ipdbde9832016-06-26 09:48:36 -0400415struct drm_plane *sde_plane_init(struct drm_device *dev,
416 uint32_t pipe, bool primary_plane);
Clarence Ip7a753bb2016-07-07 11:47:44 -0400417
418/**
Clarence Ipcae1bb62016-07-07 12:07:13 -0400419 * sde_plane_wait_input_fence - wait for input fence object
Clarence Ip7a753bb2016-07-07 11:47:44 -0400420 * @plane: Pointer to DRM plane object
421 * @wait_ms: Wait timeout value
422 * Returns: Zero on success
423 */
Clarence Ipcae1bb62016-07-07 12:07:13 -0400424int sde_plane_wait_input_fence(struct drm_plane *plane, uint32_t wait_ms);
Clarence Ipcb410d42016-06-26 22:52:33 -0400425
426/**
Clarence Ipcae1bb62016-07-07 12:07:13 -0400427 * sde_plane_color_fill - Enables color fill on plane
Clarence Ipcb410d42016-06-26 22:52:33 -0400428 * @plane: Pointer to DRM plane object
429 * @color: RGB fill color value, [23..16] Blue, [15..8] Green, [7..0] Red
430 * @alpha: 8-bit fill alpha value, 255 selects 100% alpha
431 *
432 * Returns: 0 on success
433 */
434int sde_plane_color_fill(struct drm_plane *plane,
435 uint32_t color, uint32_t alpha);
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700436
Abhijit Kulkarni40e38162016-06-26 22:12:09 -0400437/**
438 * CRTC functions
439 */
Abhijit Kulkarni7acb3262016-07-05 15:27:25 -0400440int sde_crtc_vblank(struct drm_crtc *crtc, bool en);
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700441void sde_crtc_cancel_pending_flip(struct drm_crtc *crtc, struct drm_file *file);
Lloyd Atkinson5d722782016-05-30 14:09:41 -0400442void sde_crtc_commit_kickoff(struct drm_crtc *crtc);
Clarence Ip24f80662016-06-13 19:05:32 -0400443
444/**
445 * sde_crtc_prepare_fence - callback to prepare for output fences
446 * @crtc: Pointer to drm crtc object
447 */
448void sde_crtc_prepare_fence(struct drm_crtc *crtc);
449
Lloyd Atkinsone7bcdd22016-08-11 10:53:37 -0400450/**
451 * sde_crtc_init - create a new crtc object
452 * @dev: sde device
Lloyd Atkinsone7bcdd22016-08-11 10:53:37 -0400453 * @plane: base plane
454 * @vblank_id: Id for reporting vblank. Id in range from 0..dev->num_crtcs.
455 * @Return: new crtc object or error
456 */
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700457struct drm_crtc *sde_crtc_init(struct drm_device *dev,
Lloyd Atkinsone7bcdd22016-08-11 10:53:37 -0400458 struct drm_plane *plane,
459 int vblank_id);
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700460
Abhijit Kulkarni40e38162016-06-26 22:12:09 -0400461/**
Clarence Ip24f80662016-06-13 19:05:32 -0400462 * sde_crtc_complete_commit - callback signalling completion of current commit
463 * @crtc: Pointer to drm crtc object
464 */
465void sde_crtc_complete_commit(struct drm_crtc *crtc);
466
467/**
Lloyd Atkinson5d722782016-05-30 14:09:41 -0400468 * sde_encoder_get_hw_resources - Populate table of required hardware resources
469 * @encoder: encoder pointer
470 * @hw_res: resource table to populate with encoder required resources
Lloyd Atkinson11f34442016-08-11 11:19:52 -0400471 * @conn_state: report hw reqs based on this proposed connector state
Lloyd Atkinson5d722782016-05-30 14:09:41 -0400472 */
Abhijit Kulkarni3e3e0d22016-06-24 17:56:13 -0400473void sde_encoder_get_hw_resources(struct drm_encoder *encoder,
Lloyd Atkinson11f34442016-08-11 11:19:52 -0400474 struct sde_encoder_hw_resources *hw_res,
475 struct drm_connector_state *conn_state);
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700476
Lloyd Atkinson5d722782016-05-30 14:09:41 -0400477/**
Lloyd Atkinsone7bcdd22016-08-11 10:53:37 -0400478 * sde_encoder_needs_ctl_start - Get whether encoder type requires ctl_start
479 * CMD and WB encoders need ctl_start, video encs do not.
480 * @encoder: encoder pointer
481 * @Return: true if the encoder type requires ctl_start issued
482 */
483bool sde_encoder_needs_ctl_start(struct drm_encoder *encoder);
484
485/**
Lloyd Atkinson5d722782016-05-30 14:09:41 -0400486 * sde_encoder_register_vblank_callback - provide callback to encoder that
487 * will be called on the next vblank.
488 * @encoder: encoder pointer
489 * @cb: callback pointer, provide NULL to deregister and disable IRQs
490 * @data: user data provided to callback
491 */
492void sde_encoder_register_vblank_callback(struct drm_encoder *encoder,
493 void (*cb)(void *), void *data);
494
495/**
496 * sde_encoder_schedule_kickoff - Register a callback with the encoder to
497 * trigger a double buffer flip of the ctl path (i.e. ctl flush and start)
498 * at the appropriate time.
499 * Immediately: if no previous commit is outstanding.
500 * Delayed: Save the callback, and return. Does not block. Callback will
501 * be triggered later. E.g. cmd encoder will trigger at pp_done irq
502 * irq if it outstanding.
503 * Callback registered is expected to flush _all_ ctl paths of the crtc
504 * @encoder: encoder pointer
505 * @cb: callback pointer, provide NULL to deregister
506 * @data: user data provided to callback
507 */
508void sde_encoder_schedule_kickoff(struct drm_encoder *encoder,
509 void (*cb)(void *), void *data);
510
511/**
512 * sde_encoder_wait_nxt_committed - Wait for hardware to have flushed the
513 * current pending frames to hardware at a vblank or ctl_start
514 * Encoders will map this differently depending on irqs
515 * vid mode -> vsync_irq
516 * @encoder: encoder pointer
517 *
518 * Return: 0 on success, -EWOULDBLOCK if already signaled, error otherwise
519 */
520int sde_encoder_wait_for_commit_done(struct drm_encoder *drm_encoder);
521
522/**
Clarence Ip03521982016-08-26 10:49:47 -0400523 * sde_encoder_get_intf_mode - returns current underlying interface mode
524 * @encoder: encoder pointer
525 * Returns: Interface mode of underlying physical master encoder
526 */
527enum sde_intf_mode sde_encoder_get_intf_mode(struct drm_encoder *encoder);
528
529/**
Lloyd Atkinson5d722782016-05-30 14:09:41 -0400530 * sde_encoders_init - query platform, create all encoders and bridges,
531 * and register them with the drm_device
532 * @dev: drm device pointer
533 */
534void sde_encoders_init(struct drm_device *dev);
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700535
Alan Kwong5d324e42016-07-28 22:56:18 -0400536/**
537 * sde_vbif_set_ot_limit - set OT limit for vbif client
538 * @sde_kms: SDE handler
539 * @params: Pointer to OT configuration parameters
540 */
541void sde_vbif_set_ot_limit(struct sde_kms *sde_kms,
542 struct sde_vbif_set_ot_params *params);
543
Narendra Muppalla1b0b3352015-09-29 10:16:51 -0700544#endif /* __sde_kms_H__ */