Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9eabe7a3 authored by Lloyd Atkinson's avatar Lloyd Atkinson Committed by Narendra Muppalla
Browse files

drm/msm/sde: move sde_crtc declarations into sde_crtc header



Clean up the sde_kms header by moving the crtc related function
declarations into the crtc specific header file. Also clean up
some of the unused macros in the sde crtc files.

Change-Id: If377e6acb13c8253781c085100a695b6e86e6329
Signed-off-by: default avatarLloyd Atkinson <latkinso@codeaurora.org>
parent ac933647
Loading
Loading
Loading
Loading
+1 −9
Original line number Diff line number Diff line
@@ -26,14 +26,6 @@
#include "sde_crtc.h"
#include "sde_color_processing.h"

#define CTL(i)       (CTL_0 + (i))
#define LM(i)        (LM_0  + (i))
#define INTF(i)      (INTF_0 + (i))

/* uncomment to enable higher level IRQ msg's */
/*#define DBG_IRQ      DBG*/
#define DBG_IRQ(fmt, ...)

/* default input fence timeout, in ms */
#define SDE_CRTC_INPUT_FENCE_TIMEOUT    2000

@@ -350,7 +342,7 @@ static void sde_crtc_vblank_cb(void *data)
	struct drm_crtc *crtc = (struct drm_crtc *)data;

	drm_crtc_handle_vblank(crtc);
	DBG_IRQ("");
	DRM_DEBUG_VBL("crtc%d\n", crtc->base.id);
	MSM_EVT(crtc->dev, crtc->base.id, 0);
}

+42 −6
Original line number Diff line number Diff line
@@ -19,10 +19,6 @@
#include "sde_kms.h"

#define SDE_CRTC_NAME_SIZE	12
#define PENDING_FLIP		2
/* worst case one frame wait time based on 30 FPS : 33.33ms*/
#define CRTC_MAX_WAIT_ONE_FRAME     34
#define CRTC_HW_MIXER_MAXSTAGES(c, idx) ((c)->mixer[idx].sblk->maxblendstages)

/**
 * struct sde_crtc_mixer: stores the map for each virtual pipeline in the CRTC
@@ -49,7 +45,8 @@ struct sde_crtc_mixer {
 * @num_ctls      : Number of ctl paths in use
 * @num_mixers    : Number of mixers in use
 * @mixer         : List of active mixers
 * @event         : Pointer to last received drm vblank event
 * @event         : Pointer to last received drm vblank event. If there is a
 *                  pending vblank event, this will be non-null.
 * @pending       : Whether or not an update is pending
 * @vsync_count   : Running count of received vsync events
 * @drm_requested_vblank : Whether vblanks have been enabled in the encoder
@@ -70,7 +67,6 @@ struct sde_crtc {
	u32 num_mixers;
	struct sde_crtc_mixer mixers[CRTC_DUAL_MIXERS];

	/*if there is a pending flip, these will be non-null */
	struct drm_pending_vblank_event *event;
	u32 vsync_count;

@@ -139,4 +135,44 @@ static inline uint32_t get_crtc_split_width(struct drm_crtc *crtc)
	return sde_crtc_mixer_width(sde_crtc, mode);
}

/**
 * sde_crtc_vblank - enable or disable vblanks for this crtc
 * @crtc: Pointer to drm crtc object
 * @en: true to enable vblanks, false to disable
 */
int sde_crtc_vblank(struct drm_crtc *crtc, bool en);

/**
 * sde_crtc_commit_kickoff - trigger kickoff of the commit for this crtc
 * @crtc: Pointer to drm crtc object
 */
void sde_crtc_commit_kickoff(struct drm_crtc *crtc);

/**
 * sde_crtc_prepare_fence - callback to prepare for output fences
 * @crtc: Pointer to drm crtc object
 */
void sde_crtc_prepare_fence(struct drm_crtc *crtc);

/**
 * sde_crtc_init - create a new crtc object
 * @dev: sde device
 * @plane: base plane
 * @Return: new crtc object or error
 */
struct drm_crtc *sde_crtc_init(struct drm_device *dev, struct drm_plane *plane);

/**
 * sde_crtc_complete_commit - callback signalling completion of current commit
 * @crtc: Pointer to drm crtc object
 */
void sde_crtc_complete_commit(struct drm_crtc *crtc);

/**
 * sde_crtc_cancel_pending_flip - complete flip for clients on lastclose
 * @crtc: Pointer to drm crtc object
 * @file: client to cancel's file handle
 */
void sde_crtc_cancel_pending_flip(struct drm_crtc *crtc, struct drm_file *file);

#endif /* _SDE_CRTC_H_ */
+2 −1
Original line number Diff line number Diff line
@@ -41,7 +41,8 @@
#define MAX_PHYS_ENCODERS_PER_VIRTUAL \
	(MAX_H_TILES_PER_DISPLAY * NUM_PHYS_ENCODER_TYPES)

#define WAIT_TIMEOUT_MSEC 100
/* Wait timeout sized on worst case of 4 60fps frames ~= 67ms */
#define WAIT_TIMEOUT_MSEC 67

/**
 * struct sde_encoder_virt - virtual encoder. Container of one or more physical
+1 −28
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@
#include "sde_hw_wb.h"
#include "sde_hw_top.h"
#include "sde_connector.h"
#include "sde_crtc.h"
#include "sde_rm.h"
#include "sde_power_handle.h"
#include "sde_irq.h"
@@ -416,34 +417,6 @@ int sde_plane_wait_input_fence(struct drm_plane *plane, uint32_t wait_ms);
int sde_plane_color_fill(struct drm_plane *plane,
		uint32_t color, uint32_t alpha);

/**
 * CRTC functions
 */
int sde_crtc_vblank(struct drm_crtc *crtc, bool en);
void sde_crtc_commit_kickoff(struct drm_crtc *crtc);

/**
 * sde_crtc_prepare_fence - callback to prepare for output fences
 * @crtc: Pointer to drm crtc object
 */
void sde_crtc_prepare_fence(struct drm_crtc *crtc);

/**
 * sde_crtc_init - create a new crtc object
 * @dev: sde device
 * @plane: base plane
 * @Return: new crtc object or error
 */
struct drm_crtc *sde_crtc_init(struct drm_device *dev, struct drm_plane *plane);

/**
 * sde_crtc_complete_commit - callback signalling completion of current commit
 * @crtc: Pointer to drm crtc object
 */
void sde_crtc_complete_commit(struct drm_crtc *crtc);

void sde_crtc_cancel_pending_flip(struct drm_crtc *crtc, struct drm_file *file);

/**
 * sde_encoder_get_hw_resources - Populate table of required hardware resources
 * @encoder:	encoder pointer