Release 4.7 drivers/gpu/drm/exynos/exynos_drm_crtc.c
  
  
/* exynos_drm_crtc.c
 *
 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
 * Authors:
 *      Inki Dae <inki.dae@samsung.com>
 *      Joonyoung Shim <jy0922.shim@samsung.com>
 *      Seung-Woo Kim <sw0312.kim@samsung.com>
 *
 * This program is free software; you can redistribute  it and/or modify it
 * under  the terms of  the GNU General  Public License as published by the
 * Free Software Foundation;  either version 2 of the  License, or (at your
 * option) any later version.
 */
#include <drm/drmP.h>
#include <drm/drm_crtc_helper.h>
#include <drm/drm_atomic.h>
#include <drm/drm_atomic_helper.h>
#include "exynos_drm_crtc.h"
#include "exynos_drm_drv.h"
#include "exynos_drm_plane.h"
static void exynos_drm_crtc_enable(struct drm_crtc *crtc)
{
	struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
	if (exynos_crtc->ops->enable)
		exynos_crtc->ops->enable(exynos_crtc);
	drm_crtc_vblank_on(crtc);
}
Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| gustavo padovan | gustavo padovan | 18 | 41.86% | 2 | 40.00% | 
| inki dae | inki dae | 14 | 32.56% | 2 | 40.00% | 
| joonyoung shim | joonyoung shim | 11 | 25.58% | 1 | 20.00% | 
 | Total | 43 | 100.00% | 5 | 100.00% | 
static void exynos_drm_crtc_disable(struct drm_crtc *crtc)
{
	struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
	drm_crtc_vblank_off(crtc);
	if (exynos_crtc->ops->disable)
		exynos_crtc->ops->disable(exynos_crtc);
}
Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| gustavo padovan | gustavo padovan | 26 | 60.47% | 4 | 44.44% | 
| sean paul | sean paul | 9 | 20.93% | 1 | 11.11% | 
| inki dae | inki dae | 6 | 13.95% | 2 | 22.22% | 
| joonyoung shim | joonyoung shim | 1 | 2.33% | 1 | 11.11% | 
| andrzej hajda | andrzej hajda | 1 | 2.33% | 1 | 11.11% | 
 | Total | 43 | 100.00% | 9 | 100.00% | 
static void
exynos_drm_crtc_mode_set_nofb(struct drm_crtc *crtc)
{
	struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
	if (exynos_crtc->ops->commit)
		exynos_crtc->ops->commit(exynos_crtc);
}
Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| inki dae | inki dae | 15 | 39.47% | 2 | 40.00% | 
| joonyoung shim | joonyoung shim | 12 | 31.58% | 1 | 20.00% | 
| gustavo padovan | gustavo padovan | 11 | 28.95% | 2 | 40.00% | 
 | Total | 38 | 100.00% | 5 | 100.00% | 
static int exynos_crtc_atomic_check(struct drm_crtc *crtc,
				     struct drm_crtc_state *state)
{
	struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
	if (!state->enable)
		return 0;
	if (exynos_crtc->ops->atomic_check)
		return exynos_crtc->ops->atomic_check(exynos_crtc, state);
	return 0;
}
Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| andrzej hajda | andrzej hajda | 59 | 100.00% | 2 | 100.00% | 
 | Total | 59 | 100.00% | 2 | 100.00% | 
static void exynos_crtc_atomic_begin(struct drm_crtc *crtc,
				     struct drm_crtc_state *old_crtc_state)
{
	struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
	exynos_crtc->event = crtc->state->event;
	if (exynos_crtc->ops->atomic_begin)
		exynos_crtc->ops->atomic_begin(exynos_crtc);
}
Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| gustavo padovan | gustavo padovan | 24 | 45.28% | 4 | 57.14% | 
| inki dae | inki dae | 20 | 37.74% | 1 | 14.29% | 
| maarten lankhorst | maarten lankhorst | 5 | 9.43% | 1 | 14.29% | 
| mandeep singh baines | mandeep singh baines | 4 | 7.55% | 1 | 14.29% | 
 | Total | 53 | 100.00% | 7 | 100.00% | 
static void exynos_crtc_atomic_flush(struct drm_crtc *crtc,
				     struct drm_crtc_state *old_crtc_state)
{
	struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
	if (exynos_crtc->ops->atomic_flush)
		exynos_crtc->ops->atomic_flush(exynos_crtc);
}
Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| gustavo padovan | gustavo padovan | 38 | 88.37% | 2 | 66.67% | 
| maarten lankhorst | maarten lankhorst | 5 | 11.63% | 1 | 33.33% | 
 | Total | 43 | 100.00% | 3 | 100.00% | 
static const struct drm_crtc_helper_funcs exynos_crtc_helper_funcs = {
	.enable		= exynos_drm_crtc_enable,
	.disable	= exynos_drm_crtc_disable,
	.mode_set_nofb	= exynos_drm_crtc_mode_set_nofb,
	.atomic_check	= exynos_crtc_atomic_check,
	.atomic_begin	= exynos_crtc_atomic_begin,
	.atomic_flush	= exynos_crtc_atomic_flush,
};
static void exynos_drm_crtc_destroy(struct drm_crtc *crtc)
{
	struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
	struct exynos_drm_private *private = crtc->dev->dev_private;
	private->crtc[exynos_crtc->pipe] = NULL;
	drm_crtc_cleanup(crtc);
	kfree(exynos_crtc);
}
Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| inki dae | inki dae | 53 | 100.00% | 1 | 100.00% | 
 | Total | 53 | 100.00% | 1 | 100.00% | 
static const struct drm_crtc_funcs exynos_crtc_funcs = {
	.set_config	= drm_atomic_helper_set_config,
	.page_flip	= drm_atomic_helper_page_flip,
	.destroy	= exynos_drm_crtc_destroy,
	.reset = drm_atomic_helper_crtc_reset,
	.atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state,
	.atomic_destroy_state = drm_atomic_helper_crtc_destroy_state,
};
struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev,
					struct drm_plane *plane,
					int pipe,
					enum exynos_drm_output_type type,
					const struct exynos_drm_crtc_ops *ops,
					void *ctx)
{
	struct exynos_drm_crtc *exynos_crtc;
	struct exynos_drm_private *private = drm_dev->dev_private;
	struct drm_crtc *crtc;
	int ret;
	exynos_crtc = kzalloc(sizeof(*exynos_crtc), GFP_KERNEL);
	if (!exynos_crtc)
		return ERR_PTR(-ENOMEM);
	exynos_crtc->pipe = pipe;
	exynos_crtc->type = type;
	exynos_crtc->ops = ops;
	exynos_crtc->ctx = ctx;
	init_waitqueue_head(&exynos_crtc->wait_update);
	crtc = &exynos_crtc->base;
	private->crtc[pipe] = crtc;
	ret = drm_crtc_init_with_planes(drm_dev, crtc, plane, NULL,
					&exynos_crtc_funcs, NULL);
	if (ret < 0)
		goto err_crtc;
	drm_crtc_helper_add(crtc, &exynos_crtc_helper_funcs);
	return exynos_crtc;
err_crtc:
	plane->funcs->destroy(plane);
	kfree(exynos_crtc);
	return ERR_PTR(ret);
}
Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| inki dae | inki dae | 77 | 40.74% | 1 | 7.69% | 
| gustavo padovan | gustavo padovan | 62 | 32.80% | 7 | 53.85% | 
| andrzej hajda | andrzej hajda | 38 | 20.11% | 1 | 7.69% | 
| sean paul | sean paul | 7 | 3.70% | 1 | 7.69% | 
| joonyoung shim | joonyoung shim | 2 | 1.06% | 1 | 7.69% | 
| ville syrjala | ville syrjala | 2 | 1.06% | 1 | 7.69% | 
| krzysztof kozlowski | krzysztof kozlowski | 1 | 0.53% | 1 | 7.69% | 
 | Total | 189 | 100.00% | 13 | 100.00% | 
int exynos_drm_crtc_enable_vblank(struct drm_device *dev, unsigned int pipe)
{
	struct exynos_drm_crtc *exynos_crtc = exynos_drm_crtc_from_pipe(dev,
									pipe);
	if (exynos_crtc->ops->enable_vblank)
		return exynos_crtc->ops->enable_vblank(exynos_crtc);
	return 0;
}
Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| inki dae | inki dae | 27 | 57.45% | 2 | 28.57% | 
| sean paul | sean paul | 11 | 23.40% | 1 | 14.29% | 
| gustavo padovan | gustavo padovan | 5 | 10.64% | 2 | 28.57% | 
| andrzej hajda | andrzej hajda | 3 | 6.38% | 1 | 14.29% | 
| thierry reding | thierry reding | 1 | 2.13% | 1 | 14.29% | 
 | Total | 47 | 100.00% | 7 | 100.00% | 
void exynos_drm_crtc_disable_vblank(struct drm_device *dev, unsigned int pipe)
{
	struct exynos_drm_crtc *exynos_crtc = exynos_drm_crtc_from_pipe(dev,
									pipe);
	if (exynos_crtc->ops->disable_vblank)
		exynos_crtc->ops->disable_vblank(exynos_crtc);
}
Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| inki dae | inki dae | 25 | 58.14% | 2 | 33.33% | 
| sean paul | sean paul | 11 | 25.58% | 1 | 16.67% | 
| andrzej hajda | andrzej hajda | 3 | 6.98% | 1 | 16.67% | 
| gustavo padovan | gustavo padovan | 3 | 6.98% | 1 | 16.67% | 
| thierry reding | thierry reding | 1 | 2.33% | 1 | 16.67% | 
 | Total | 43 | 100.00% | 6 | 100.00% | 
void exynos_drm_crtc_wait_pending_update(struct exynos_drm_crtc *exynos_crtc)
{
	wait_event_timeout(exynos_crtc->wait_update,
			   (atomic_read(&exynos_crtc->pending_update) == 0),
			   msecs_to_jiffies(50));
}
Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| gustavo padovan | gustavo padovan | 34 | 100.00% | 1 | 100.00% | 
 | Total | 34 | 100.00% | 1 | 100.00% | 
void exynos_drm_crtc_finish_update(struct exynos_drm_crtc *exynos_crtc,
				struct exynos_drm_plane *exynos_plane)
{
	struct drm_crtc *crtc = &exynos_crtc->base;
	unsigned long flags;
	exynos_plane->pending_fb = NULL;
	if (atomic_dec_and_test(&exynos_crtc->pending_update))
		wake_up(&exynos_crtc->wait_update);
	spin_lock_irqsave(&crtc->dev->event_lock, flags);
	if (exynos_crtc->event)
		drm_crtc_send_vblank_event(crtc, exynos_crtc->event);
	exynos_crtc->event = NULL;
	spin_unlock_irqrestore(&crtc->dev->event_lock, flags);
}
Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| gustavo padovan | gustavo padovan | 42 | 42.86% | 3 | 42.86% | 
| rahul sharma | rahul sharma | 39 | 39.80% | 1 | 14.29% | 
| mandeep singh baines | mandeep singh baines | 11 | 11.22% | 1 | 14.29% | 
| inki dae | inki dae | 5 | 5.10% | 1 | 14.29% | 
| rob clark | rob clark | 1 | 1.02% | 1 | 14.29% | 
 | Total | 98 | 100.00% | 7 | 100.00% | 
int exynos_drm_crtc_get_pipe_from_type(struct drm_device *drm_dev,
				       enum exynos_drm_output_type out_type)
{
	struct drm_crtc *crtc;
	list_for_each_entry(crtc, &drm_dev->mode_config.crtc_list, head) {
		struct exynos_drm_crtc *exynos_crtc;
		exynos_crtc = to_exynos_crtc(crtc);
		if (exynos_crtc->type == out_type)
			return exynos_crtc->pipe;
	}
	return -EPERM;
}
Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| inki dae | inki dae | 56 | 96.55% | 1 | 50.00% | 
| gustavo padovan | gustavo padovan | 2 | 3.45% | 1 | 50.00% | 
 | Total | 58 | 100.00% | 2 | 100.00% | 
void exynos_drm_crtc_te_handler(struct drm_crtc *crtc)
{
	struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
	if (exynos_crtc->ops->te_handler)
		exynos_crtc->ops->te_handler(exynos_crtc);
}
Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| youngjun cho | youngjun cho | 32 | 86.49% | 1 | 50.00% | 
| gustavo padovan | gustavo padovan | 5 | 13.51% | 1 | 50.00% | 
 | Total | 37 | 100.00% | 2 | 100.00% | 
void exynos_drm_crtc_cancel_page_flip(struct drm_crtc *crtc,
					struct drm_file *file)
{
	struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
	struct drm_pending_vblank_event *e;
	unsigned long flags;
	spin_lock_irqsave(&crtc->dev->event_lock, flags);
	e = exynos_crtc->event;
	if (e && e->base.file_priv == file) {
		exynos_crtc->event = NULL;
		atomic_dec(&exynos_crtc->pending_update);
	}
	spin_unlock_irqrestore(&crtc->dev->event_lock, flags);
	if (e && e->base.file_priv == file)
		drm_event_cancel_free(crtc->dev, &e->base);
}
Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| inki dae | inki dae | 92 | 79.31% | 1 | 50.00% | 
| andrzej hajda | andrzej hajda | 24 | 20.69% | 1 | 50.00% | 
 | Total | 116 | 100.00% | 2 | 100.00% | 
Overall Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| inki dae | inki dae | 417 | 39.64% | 8 | 15.09% | 
| gustavo padovan | gustavo padovan | 325 | 30.89% | 22 | 41.51% | 
| andrzej hajda | andrzej hajda | 133 | 12.64% | 6 | 11.32% | 
| rahul sharma | rahul sharma | 39 | 3.71% | 1 | 1.89% | 
| sean paul | sean paul | 38 | 3.61% | 1 | 1.89% | 
| youngjun cho | youngjun cho | 32 | 3.04% | 1 | 1.89% | 
| joonyoung shim | joonyoung shim | 30 | 2.85% | 5 | 9.43% | 
| mandeep singh baines | mandeep singh baines | 15 | 1.43% | 1 | 1.89% | 
| maarten lankhorst | maarten lankhorst | 10 | 0.95% | 1 | 1.89% | 
| ville syrjala | ville syrjala | 4 | 0.38% | 2 | 3.77% | 
| mark brown | mark brown | 3 | 0.29% | 1 | 1.89% | 
| david howells | david howells | 2 | 0.19% | 1 | 1.89% | 
| thierry reding | thierry reding | 2 | 0.19% | 1 | 1.89% | 
| rob clark | rob clark | 1 | 0.10% | 1 | 1.89% | 
| krzysztof kozlowski | krzysztof kozlowski | 1 | 0.10% | 1 | 1.89% | 
 | Total | 1052 | 100.00% | 53 | 100.00% | 
  
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.