2010-12-15 04:14:24 +07:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2012 Red Hat
|
|
|
|
* based in parts on udlfb.c:
|
|
|
|
* Copyright (C) 2009 Roberto De Ioris <roberto@unbit.it>
|
|
|
|
* Copyright (C) 2009 Jaya Kumar <jayakumar.lkml@gmail.com>
|
|
|
|
* Copyright (C) 2009 Bernie Thompson <bernie@plugable.com>
|
|
|
|
*
|
|
|
|
* This file is subject to the terms and conditions of the GNU General Public
|
|
|
|
* License v2. See the file COPYING in the main directory of this archive for
|
|
|
|
* more details.
|
|
|
|
*/
|
|
|
|
|
2012-10-03 00:01:07 +07:00
|
|
|
#include <drm/drmP.h>
|
|
|
|
#include <drm/drm_crtc.h>
|
|
|
|
#include <drm/drm_crtc_helper.h>
|
2010-12-15 04:14:24 +07:00
|
|
|
#include "udl_drv.h"
|
|
|
|
|
|
|
|
/* dummy encoder */
|
2012-09-22 13:47:39 +07:00
|
|
|
static void udl_enc_destroy(struct drm_encoder *encoder)
|
2010-12-15 04:14:24 +07:00
|
|
|
{
|
|
|
|
drm_encoder_cleanup(encoder);
|
|
|
|
kfree(encoder);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void udl_encoder_disable(struct drm_encoder *encoder)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool udl_mode_fixup(struct drm_encoder *encoder,
|
2012-07-17 22:56:50 +07:00
|
|
|
const struct drm_display_mode *mode,
|
2010-12-15 04:14:24 +07:00
|
|
|
struct drm_display_mode *adjusted_mode)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void udl_encoder_prepare(struct drm_encoder *encoder)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static void udl_encoder_commit(struct drm_encoder *encoder)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static void udl_encoder_mode_set(struct drm_encoder *encoder,
|
|
|
|
struct drm_display_mode *mode,
|
|
|
|
struct drm_display_mode *adjusted_mode)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
udl_encoder_dpms(struct drm_encoder *encoder, int mode)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static const struct drm_encoder_helper_funcs udl_helper_funcs = {
|
|
|
|
.dpms = udl_encoder_dpms,
|
|
|
|
.mode_fixup = udl_mode_fixup,
|
|
|
|
.prepare = udl_encoder_prepare,
|
|
|
|
.mode_set = udl_encoder_mode_set,
|
|
|
|
.commit = udl_encoder_commit,
|
|
|
|
.disable = udl_encoder_disable,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct drm_encoder_funcs udl_enc_funcs = {
|
|
|
|
.destroy = udl_enc_destroy,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct drm_encoder *udl_encoder_init(struct drm_device *dev)
|
|
|
|
{
|
|
|
|
struct drm_encoder *encoder;
|
|
|
|
|
|
|
|
encoder = kzalloc(sizeof(struct drm_encoder), GFP_KERNEL);
|
|
|
|
if (!encoder)
|
|
|
|
return NULL;
|
|
|
|
|
drm: Pass 'name' to drm_encoder_init()
Done with coccinelle for the most part. However, it thinks '...' is
part of the semantic patch, so I put an 'int DOTDOTDOT' placeholder
in its place and got rid of it with sed afterwards.
@@
identifier dev, encoder, funcs;
@@
int drm_encoder_init(struct drm_device *dev,
struct drm_encoder *encoder,
const struct drm_encoder_funcs *funcs,
int encoder_type
+ ,const char *name, int DOTDOTDOT
)
{ ... }
@@
identifier dev, encoder, funcs;
@@
int drm_encoder_init(struct drm_device *dev,
struct drm_encoder *encoder,
const struct drm_encoder_funcs *funcs,
int encoder_type
+ ,const char *name, int DOTDOTDOT
);
@@
expression E1, E2, E3, E4;
@@
drm_encoder_init(E1, E2, E3, E4
+ ,NULL
)
v2: Add ', or NULL...' to @name kernel doc (Jani)
Annotate the function with __printf() attribute (Jani)
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1449670818-2966-1-git-send-email-ville.syrjala@linux.intel.com
2015-12-09 21:20:18 +07:00
|
|
|
drm_encoder_init(dev, encoder, &udl_enc_funcs, DRM_MODE_ENCODER_TMDS,
|
|
|
|
NULL);
|
2010-12-15 04:14:24 +07:00
|
|
|
drm_encoder_helper_add(encoder, &udl_helper_funcs);
|
|
|
|
encoder->possible_crtcs = 1;
|
|
|
|
return encoder;
|
|
|
|
}
|