Release 4.11 drivers/gpu/drm/omapdrm/omap_encoder.c
/*
* drivers/gpu/drm/omapdrm/omap_encoder.c
*
* Copyright (C) 2011 Texas Instruments
* Author: Rob Clark <rob@ti.com>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by
* the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <linux/list.h>
#include <drm/drm_crtc.h>
#include <drm/drm_crtc_helper.h>
#include <drm/drm_edid.h>
#include "omap_drv.h"
/*
* encoder funcs
*/
#define to_omap_encoder(x) container_of(x, struct omap_encoder, base)
/* The encoder and connector both map to same dssdev.. the encoder
* handles the 'active' parts, ie. anything the modifies the state
* of the hw, and the connector handles the 'read-only' parts, like
* detecting connection and reading edid.
*/
struct omap_encoder {
struct drm_encoder base;
struct omap_dss_device *dssdev;
};
struct omap_dss_device *omap_encoder_get_dssdev(struct drm_encoder *encoder)
{
struct omap_encoder *omap_encoder = to_omap_encoder(encoder);
return omap_encoder->dssdev;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Archit Taneja | 27 | 100.00% | 1 | 100.00% |
Total | 27 | 100.00% | 1 | 100.00% |
static void omap_encoder_destroy(struct drm_encoder *encoder)
{
struct omap_encoder *omap_encoder = to_omap_encoder(encoder);
drm_encoder_cleanup(encoder);
kfree(omap_encoder);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Rob Clark | 31 | 100.00% | 1 | 100.00% |
Total | 31 | 100.00% | 1 | 100.00% |
static const struct drm_encoder_funcs omap_encoder_funcs = {
.destroy = omap_encoder_destroy,
};
static void omap_encoder_mode_set(struct drm_encoder *encoder,
struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
{
struct drm_device *dev = encoder->dev;
struct omap_encoder *omap_encoder = to_omap_encoder(encoder);
struct omap_dss_device *dssdev = omap_encoder->dssdev;
struct drm_connector *connector;
bool hdmi_mode;
int r;
hdmi_mode = false;
list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
if (connector->encoder == encoder) {
hdmi_mode = omap_connector_get_hdmi_mode(connector);
break;
}
}
if (dssdev->driver->set_hdmi_mode)
dssdev->driver->set_hdmi_mode(dssdev, hdmi_mode);
if (hdmi_mode && dssdev->driver->set_hdmi_infoframe) {
struct hdmi_avi_infoframe avi;
r = drm_hdmi_avi_infoframe_from_display_mode(&avi, adjusted_mode);
if (r == 0)
dssdev->driver->set_hdmi_infoframe(dssdev, &avi);
}
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Tomi Valkeinen | 136 | 87.74% | 1 | 50.00% |
Rob Clark | 19 | 12.26% | 1 | 50.00% |
Total | 155 | 100.00% | 2 | 100.00% |
static void omap_encoder_disable(struct drm_encoder *encoder)
{
struct omap_encoder *omap_encoder = to_omap_encoder(encoder);
struct omap_dss_device *dssdev = omap_encoder->dssdev;
struct omap_dss_driver *dssdrv = dssdev->driver;
dssdrv->disable(dssdev);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Rob Clark | 37 | 80.43% | 2 | 66.67% |
Laurent Pinchart | 9 | 19.57% | 1 | 33.33% |
Total | 46 | 100.00% | 3 | 100.00% |
static int omap_encoder_update(struct drm_encoder *encoder,
enum omap_channel channel,
struct videomode *vm)
{
struct drm_device *dev = encoder->dev;
struct omap_encoder *omap_encoder = to_omap_encoder(encoder);
struct omap_dss_device *dssdev = omap_encoder->dssdev;
struct omap_dss_driver *dssdrv = dssdev->driver;
int ret;
if (dssdrv->check_timings) {
ret = dssdrv->check_timings(dssdev, vm);
} else {
struct videomode t = {0};
dssdrv->get_timings(dssdev, &t);
if (memcmp(vm, &t, sizeof(*vm)))
ret = -EINVAL;
else
ret = 0;
}
if (ret) {
dev_err(dev->dev, "could not set timings: %d\n", ret);
return ret;
}
if (dssdrv->set_timings)
dssdrv->set_timings(dssdev, vm);
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Rob Clark | 95 | 57.93% | 2 | 28.57% |
Archit Taneja | 57 | 34.76% | 1 | 14.29% |
Peter Ujfalusi | 6 | 3.66% | 2 | 28.57% |
Laurent Pinchart | 6 | 3.66% | 2 | 28.57% |
Total | 164 | 100.00% | 7 | 100.00% |
static void omap_encoder_enable(struct drm_encoder *encoder)
{
struct omap_encoder *omap_encoder = to_omap_encoder(encoder);
struct omap_dss_device *dssdev = omap_encoder->dssdev;
struct omap_dss_driver *dssdrv = dssdev->driver;
int r;
omap_encoder_update(encoder, omap_crtc_channel(encoder->crtc),
omap_crtc_timings(encoder->crtc));
r = dssdrv->enable(dssdev);
if (r)
dev_err(encoder->dev->dev,
"Failed to enable display '%s': %d\n",
dssdev->name, r);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Laurent Pinchart | 65 | 71.43% | 1 | 50.00% |
Tomi Valkeinen | 26 | 28.57% | 1 | 50.00% |
Total | 91 | 100.00% | 2 | 100.00% |
static int omap_encoder_atomic_check(struct drm_encoder *encoder,
struct drm_crtc_state *crtc_state,
struct drm_connector_state *conn_state)
{
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Laurent Pinchart | 24 | 100.00% | 1 | 100.00% |
Total | 24 | 100.00% | 1 | 100.00% |
static const struct drm_encoder_helper_funcs omap_encoder_helper_funcs = {
.mode_set = omap_encoder_mode_set,
.disable = omap_encoder_disable,
.enable = omap_encoder_enable,
.atomic_check = omap_encoder_atomic_check,
};
/* initialize encoder */
struct drm_encoder *omap_encoder_init(struct drm_device *dev,
struct omap_dss_device *dssdev)
{
struct drm_encoder *encoder = NULL;
struct omap_encoder *omap_encoder;
omap_encoder = kzalloc(sizeof(*omap_encoder), GFP_KERNEL);
if (!omap_encoder)
goto fail;
omap_encoder->dssdev = dssdev;
encoder = &omap_encoder->base;
drm_encoder_init(dev, encoder, &omap_encoder_funcs,
DRM_MODE_ENCODER_TMDS, NULL);
drm_encoder_helper_add(encoder, &omap_encoder_helper_funcs);
return encoder;
fail:
if (encoder)
omap_encoder_destroy(encoder);
return NULL;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Rob Clark | 100 | 98.04% | 3 | 75.00% |
Ville Syrjälä | 2 | 1.96% | 1 | 25.00% |
Total | 102 | 100.00% | 4 | 100.00% |
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Rob Clark | 328 | 45.49% | 4 | 26.67% |
Tomi Valkeinen | 164 | 22.75% | 2 | 13.33% |
Laurent Pinchart | 137 | 19.00% | 4 | 26.67% |
Archit Taneja | 84 | 11.65% | 2 | 13.33% |
Peter Ujfalusi | 6 | 0.83% | 2 | 13.33% |
Ville Syrjälä | 2 | 0.28% | 1 | 6.67% |
Total | 721 | 100.00% | 15 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.