29 #define to_omap_encoder(x) container_of(x, struct omap_encoder, base)
36 static void omap_encoder_destroy(
struct drm_encoder *encoder)
39 DBG(
"%s", omap_encoder->
mgr->name);
47 DBG(
"%s: %d", omap_encoder->
mgr->name, mode);
50 static bool omap_encoder_mode_fixup(
struct drm_encoder *encoder,
55 DBG(
"%s", omap_encoder->
mgr->name);
59 static void omap_encoder_mode_set(
struct drm_encoder *encoder,
70 DBG(
"%s: set mode: %dx%d", omap_encoder->
mgr->name,
75 if (connector->
encoder == encoder) {
81 static void omap_encoder_prepare(
struct drm_encoder *encoder)
86 DBG(
"%s", omap_encoder->
mgr->name);
90 static void omap_encoder_commit(
struct drm_encoder *encoder)
95 DBG(
"%s", omap_encoder->
mgr->name);
96 omap_encoder->
mgr->apply(omap_encoder->
mgr);
101 .destroy = omap_encoder_destroy,
105 .dpms = omap_encoder_dpms,
106 .mode_fixup = omap_encoder_mode_fixup,
107 .mode_set = omap_encoder_mode_set,
108 .prepare = omap_encoder_prepare,
109 .commit = omap_encoder_commit,
116 return omap_encoder->
mgr;
124 struct omap_encoder *omap_encoder;
130 omap_encoder = kzalloc(
sizeof(*omap_encoder),
GFP_KERNEL);
132 dev_err(dev->dev,
"could not allocate encoder\n");
136 omap_encoder->
mgr = mgr;
137 encoder = &omap_encoder->
base;
141 drm_encoder_helper_add(encoder, &omap_encoder_helper_funcs);
153 dev_err(dev->dev,
"could not set manager info\n");
157 ret = mgr->
apply(mgr);
159 dev_err(dev->dev,
"could not apply\n");
167 omap_encoder_destroy(encoder);