2019-06-03 05:44:50 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-only
|
staging: add omapdrm DRM/KMS driver for TI OMAP platforms
A DRM display driver for TI OMAP platform. Similar to omapfb (fbdev)
and omap_vout (v4l2 display) drivers in the past, this driver uses the
DSS2 driver to access the display hardware, including support for
HDMI, DVI, and various types of LCD panels. And it implements GEM
support for buffer allocation (for KMS as well as offscreen buffers
used by the xf86-video-omap userspace xorg driver).
The driver maps CRTCs to overlays, encoders to overlay-managers, and
connectors to dssdev's. Note that this arrangement might change slightly
when support for drm_plane overlays is added.
For GEM support, non-scanout buffers are using the shmem backed pages
provided by GEM core (In drm_gem_object_init()). In the case of scanout
buffers, which need to be physically contiguous, those are allocated
with CMA and use drm_gem_private_object_init().
See userspace xorg driver:
git://github.com/robclark/xf86-video-omap.git
Refer to this link for CMA (Continuous Memory Allocator):
http://lkml.org/lkml/2011/8/19/302
Links to previous versions of the patch:
v1: http://lwn.net/Articles/458137/
v2: http://patches.linaro.org/4156/
v3: http://patches.linaro.org/4688/
v4: http://patches.linaro.org/4791/
History:
v5: move headers from include/drm at Greg KH's request, minor rebasing
on 3.2-rc1, pull in private copies of drm_gem_{get,put}_pages()
because "drm/gem: add functions to get/put pages" patch is not
merged yet
v4: bit of rework of encoder/connector _dpms() code, modeset_init()
rework to not use nested functions, update TODO.txt
v3: minor cleanups, improved error handling for dev_load(), some minor
API changes that will be needed later for tiled buffer support
v2: replace omap_vram with CMA for scanout buffer allocation, remove
unneeded functions, use dma_addr_t for physical addresses, error
handling cleanup, refactor attach/detach pages into common drm
functions, split non-userspace-facing API into omap_priv.h, remove
plugin API
v1: original
Signed-off-by: Rob Clark <rob@ti.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-12 18:09:40 +00:00
|
|
|
/*
|
2017-12-05 20:29:31 +00:00
|
|
|
* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
|
staging: add omapdrm DRM/KMS driver for TI OMAP platforms
A DRM display driver for TI OMAP platform. Similar to omapfb (fbdev)
and omap_vout (v4l2 display) drivers in the past, this driver uses the
DSS2 driver to access the display hardware, including support for
HDMI, DVI, and various types of LCD panels. And it implements GEM
support for buffer allocation (for KMS as well as offscreen buffers
used by the xf86-video-omap userspace xorg driver).
The driver maps CRTCs to overlays, encoders to overlay-managers, and
connectors to dssdev's. Note that this arrangement might change slightly
when support for drm_plane overlays is added.
For GEM support, non-scanout buffers are using the shmem backed pages
provided by GEM core (In drm_gem_object_init()). In the case of scanout
buffers, which need to be physically contiguous, those are allocated
with CMA and use drm_gem_private_object_init().
See userspace xorg driver:
git://github.com/robclark/xf86-video-omap.git
Refer to this link for CMA (Continuous Memory Allocator):
http://lkml.org/lkml/2011/8/19/302
Links to previous versions of the patch:
v1: http://lwn.net/Articles/458137/
v2: http://patches.linaro.org/4156/
v3: http://patches.linaro.org/4688/
v4: http://patches.linaro.org/4791/
History:
v5: move headers from include/drm at Greg KH's request, minor rebasing
on 3.2-rc1, pull in private copies of drm_gem_{get,put}_pages()
because "drm/gem: add functions to get/put pages" patch is not
merged yet
v4: bit of rework of encoder/connector _dpms() code, modeset_init()
rework to not use nested functions, update TODO.txt
v3: minor cleanups, improved error handling for dev_load(), some minor
API changes that will be needed later for tiled buffer support
v2: replace omap_vram with CMA for scanout buffer allocation, remove
unneeded functions, use dma_addr_t for physical addresses, error
handling cleanup, refactor attach/detach pages into common drm
functions, split non-userspace-facing API into omap_priv.h, remove
plugin API
v1: original
Signed-off-by: Rob Clark <rob@ti.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-12 18:09:40 +00:00
|
|
|
* Author: Rob Clark <rob@ti.com>
|
|
|
|
*/
|
|
|
|
|
2015-03-05 19:31:37 +00:00
|
|
|
#include <linux/list.h>
|
|
|
|
|
|
|
|
#include <drm/drm_crtc.h>
|
2019-01-17 21:03:34 +00:00
|
|
|
#include <drm/drm_modeset_helper_vtables.h>
|
2014-06-18 11:19:48 +00:00
|
|
|
#include <drm/drm_edid.h>
|
2018-12-07 21:08:35 +00:00
|
|
|
#include <drm/drm_panel.h>
|
2014-06-18 11:19:48 +00:00
|
|
|
|
staging: add omapdrm DRM/KMS driver for TI OMAP platforms
A DRM display driver for TI OMAP platform. Similar to omapfb (fbdev)
and omap_vout (v4l2 display) drivers in the past, this driver uses the
DSS2 driver to access the display hardware, including support for
HDMI, DVI, and various types of LCD panels. And it implements GEM
support for buffer allocation (for KMS as well as offscreen buffers
used by the xf86-video-omap userspace xorg driver).
The driver maps CRTCs to overlays, encoders to overlay-managers, and
connectors to dssdev's. Note that this arrangement might change slightly
when support for drm_plane overlays is added.
For GEM support, non-scanout buffers are using the shmem backed pages
provided by GEM core (In drm_gem_object_init()). In the case of scanout
buffers, which need to be physically contiguous, those are allocated
with CMA and use drm_gem_private_object_init().
See userspace xorg driver:
git://github.com/robclark/xf86-video-omap.git
Refer to this link for CMA (Continuous Memory Allocator):
http://lkml.org/lkml/2011/8/19/302
Links to previous versions of the patch:
v1: http://lwn.net/Articles/458137/
v2: http://patches.linaro.org/4156/
v3: http://patches.linaro.org/4688/
v4: http://patches.linaro.org/4791/
History:
v5: move headers from include/drm at Greg KH's request, minor rebasing
on 3.2-rc1, pull in private copies of drm_gem_{get,put}_pages()
because "drm/gem: add functions to get/put pages" patch is not
merged yet
v4: bit of rework of encoder/connector _dpms() code, modeset_init()
rework to not use nested functions, update TODO.txt
v3: minor cleanups, improved error handling for dev_load(), some minor
API changes that will be needed later for tiled buffer support
v2: replace omap_vram with CMA for scanout buffer allocation, remove
unneeded functions, use dma_addr_t for physical addresses, error
handling cleanup, refactor attach/detach pages into common drm
functions, split non-userspace-facing API into omap_priv.h, remove
plugin API
v1: original
Signed-off-by: Rob Clark <rob@ti.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-12 18:09:40 +00:00
|
|
|
#include "omap_drv.h"
|
|
|
|
|
|
|
|
/*
|
|
|
|
* encoder funcs
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define to_omap_encoder(x) container_of(x, struct omap_encoder, base)
|
|
|
|
|
2012-12-04 19:59:12 +00:00
|
|
|
/* 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.
|
|
|
|
*/
|
staging: add omapdrm DRM/KMS driver for TI OMAP platforms
A DRM display driver for TI OMAP platform. Similar to omapfb (fbdev)
and omap_vout (v4l2 display) drivers in the past, this driver uses the
DSS2 driver to access the display hardware, including support for
HDMI, DVI, and various types of LCD panels. And it implements GEM
support for buffer allocation (for KMS as well as offscreen buffers
used by the xf86-video-omap userspace xorg driver).
The driver maps CRTCs to overlays, encoders to overlay-managers, and
connectors to dssdev's. Note that this arrangement might change slightly
when support for drm_plane overlays is added.
For GEM support, non-scanout buffers are using the shmem backed pages
provided by GEM core (In drm_gem_object_init()). In the case of scanout
buffers, which need to be physically contiguous, those are allocated
with CMA and use drm_gem_private_object_init().
See userspace xorg driver:
git://github.com/robclark/xf86-video-omap.git
Refer to this link for CMA (Continuous Memory Allocator):
http://lkml.org/lkml/2011/8/19/302
Links to previous versions of the patch:
v1: http://lwn.net/Articles/458137/
v2: http://patches.linaro.org/4156/
v3: http://patches.linaro.org/4688/
v4: http://patches.linaro.org/4791/
History:
v5: move headers from include/drm at Greg KH's request, minor rebasing
on 3.2-rc1, pull in private copies of drm_gem_{get,put}_pages()
because "drm/gem: add functions to get/put pages" patch is not
merged yet
v4: bit of rework of encoder/connector _dpms() code, modeset_init()
rework to not use nested functions, update TODO.txt
v3: minor cleanups, improved error handling for dev_load(), some minor
API changes that will be needed later for tiled buffer support
v2: replace omap_vram with CMA for scanout buffer allocation, remove
unneeded functions, use dma_addr_t for physical addresses, error
handling cleanup, refactor attach/detach pages into common drm
functions, split non-userspace-facing API into omap_priv.h, remove
plugin API
v1: original
Signed-off-by: Rob Clark <rob@ti.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-12 18:09:40 +00:00
|
|
|
struct omap_encoder {
|
|
|
|
struct drm_encoder base;
|
2018-05-31 20:14:43 +00:00
|
|
|
struct omap_dss_device *output;
|
staging: add omapdrm DRM/KMS driver for TI OMAP platforms
A DRM display driver for TI OMAP platform. Similar to omapfb (fbdev)
and omap_vout (v4l2 display) drivers in the past, this driver uses the
DSS2 driver to access the display hardware, including support for
HDMI, DVI, and various types of LCD panels. And it implements GEM
support for buffer allocation (for KMS as well as offscreen buffers
used by the xf86-video-omap userspace xorg driver).
The driver maps CRTCs to overlays, encoders to overlay-managers, and
connectors to dssdev's. Note that this arrangement might change slightly
when support for drm_plane overlays is added.
For GEM support, non-scanout buffers are using the shmem backed pages
provided by GEM core (In drm_gem_object_init()). In the case of scanout
buffers, which need to be physically contiguous, those are allocated
with CMA and use drm_gem_private_object_init().
See userspace xorg driver:
git://github.com/robclark/xf86-video-omap.git
Refer to this link for CMA (Continuous Memory Allocator):
http://lkml.org/lkml/2011/8/19/302
Links to previous versions of the patch:
v1: http://lwn.net/Articles/458137/
v2: http://patches.linaro.org/4156/
v3: http://patches.linaro.org/4688/
v4: http://patches.linaro.org/4791/
History:
v5: move headers from include/drm at Greg KH's request, minor rebasing
on 3.2-rc1, pull in private copies of drm_gem_{get,put}_pages()
because "drm/gem: add functions to get/put pages" patch is not
merged yet
v4: bit of rework of encoder/connector _dpms() code, modeset_init()
rework to not use nested functions, update TODO.txt
v3: minor cleanups, improved error handling for dev_load(), some minor
API changes that will be needed later for tiled buffer support
v2: replace omap_vram with CMA for scanout buffer allocation, remove
unneeded functions, use dma_addr_t for physical addresses, error
handling cleanup, refactor attach/detach pages into common drm
functions, split non-userspace-facing API into omap_priv.h, remove
plugin API
v1: original
Signed-off-by: Rob Clark <rob@ti.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-12 18:09:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static void omap_encoder_destroy(struct drm_encoder *encoder)
|
|
|
|
{
|
|
|
|
struct omap_encoder *omap_encoder = to_omap_encoder(encoder);
|
2014-01-02 09:19:53 +00:00
|
|
|
|
staging: add omapdrm DRM/KMS driver for TI OMAP platforms
A DRM display driver for TI OMAP platform. Similar to omapfb (fbdev)
and omap_vout (v4l2 display) drivers in the past, this driver uses the
DSS2 driver to access the display hardware, including support for
HDMI, DVI, and various types of LCD panels. And it implements GEM
support for buffer allocation (for KMS as well as offscreen buffers
used by the xf86-video-omap userspace xorg driver).
The driver maps CRTCs to overlays, encoders to overlay-managers, and
connectors to dssdev's. Note that this arrangement might change slightly
when support for drm_plane overlays is added.
For GEM support, non-scanout buffers are using the shmem backed pages
provided by GEM core (In drm_gem_object_init()). In the case of scanout
buffers, which need to be physically contiguous, those are allocated
with CMA and use drm_gem_private_object_init().
See userspace xorg driver:
git://github.com/robclark/xf86-video-omap.git
Refer to this link for CMA (Continuous Memory Allocator):
http://lkml.org/lkml/2011/8/19/302
Links to previous versions of the patch:
v1: http://lwn.net/Articles/458137/
v2: http://patches.linaro.org/4156/
v3: http://patches.linaro.org/4688/
v4: http://patches.linaro.org/4791/
History:
v5: move headers from include/drm at Greg KH's request, minor rebasing
on 3.2-rc1, pull in private copies of drm_gem_{get,put}_pages()
because "drm/gem: add functions to get/put pages" patch is not
merged yet
v4: bit of rework of encoder/connector _dpms() code, modeset_init()
rework to not use nested functions, update TODO.txt
v3: minor cleanups, improved error handling for dev_load(), some minor
API changes that will be needed later for tiled buffer support
v2: replace omap_vram with CMA for scanout buffer allocation, remove
unneeded functions, use dma_addr_t for physical addresses, error
handling cleanup, refactor attach/detach pages into common drm
functions, split non-userspace-facing API into omap_priv.h, remove
plugin API
v1: original
Signed-off-by: Rob Clark <rob@ti.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-12 18:09:40 +00:00
|
|
|
drm_encoder_cleanup(encoder);
|
|
|
|
kfree(omap_encoder);
|
|
|
|
}
|
|
|
|
|
2012-12-04 19:59:12 +00:00
|
|
|
static const struct drm_encoder_funcs omap_encoder_funcs = {
|
|
|
|
.destroy = omap_encoder_destroy,
|
|
|
|
};
|
|
|
|
|
2018-09-23 09:58:15 +00:00
|
|
|
static void omap_encoder_update_videomode_flags(struct videomode *vm,
|
|
|
|
u32 bus_flags)
|
|
|
|
{
|
|
|
|
if (!(vm->flags & (DISPLAY_FLAGS_DE_LOW |
|
|
|
|
DISPLAY_FLAGS_DE_HIGH))) {
|
|
|
|
if (bus_flags & DRM_BUS_FLAG_DE_LOW)
|
|
|
|
vm->flags |= DISPLAY_FLAGS_DE_LOW;
|
|
|
|
else if (bus_flags & DRM_BUS_FLAG_DE_HIGH)
|
|
|
|
vm->flags |= DISPLAY_FLAGS_DE_HIGH;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!(vm->flags & (DISPLAY_FLAGS_PIXDATA_POSEDGE |
|
|
|
|
DISPLAY_FLAGS_PIXDATA_NEGEDGE))) {
|
|
|
|
if (bus_flags & DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE)
|
|
|
|
vm->flags |= DISPLAY_FLAGS_PIXDATA_POSEDGE;
|
|
|
|
else if (bus_flags & DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE)
|
|
|
|
vm->flags |= DISPLAY_FLAGS_PIXDATA_NEGEDGE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!(vm->flags & (DISPLAY_FLAGS_SYNC_POSEDGE |
|
|
|
|
DISPLAY_FLAGS_SYNC_NEGEDGE))) {
|
|
|
|
if (bus_flags & DRM_BUS_FLAG_SYNC_DRIVE_POSEDGE)
|
|
|
|
vm->flags |= DISPLAY_FLAGS_SYNC_POSEDGE;
|
|
|
|
else if (bus_flags & DRM_BUS_FLAG_SYNC_DRIVE_NEGEDGE)
|
|
|
|
vm->flags |= DISPLAY_FLAGS_SYNC_NEGEDGE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-12-07 21:08:35 +00:00
|
|
|
static void omap_encoder_hdmi_mode_set(struct drm_connector *connector,
|
|
|
|
struct drm_encoder *encoder,
|
2018-11-21 16:09:14 +00:00
|
|
|
struct drm_display_mode *adjusted_mode)
|
|
|
|
{
|
|
|
|
struct omap_encoder *omap_encoder = to_omap_encoder(encoder);
|
|
|
|
struct omap_dss_device *dssdev = omap_encoder->output;
|
|
|
|
bool hdmi_mode;
|
|
|
|
|
2018-12-07 21:08:35 +00:00
|
|
|
hdmi_mode = omap_connector_get_hdmi_mode(connector);
|
2018-11-21 16:09:14 +00:00
|
|
|
|
|
|
|
if (dssdev->ops->hdmi.set_hdmi_mode)
|
|
|
|
dssdev->ops->hdmi.set_hdmi_mode(dssdev, hdmi_mode);
|
|
|
|
|
|
|
|
if (hdmi_mode && dssdev->ops->hdmi.set_infoframe) {
|
|
|
|
struct hdmi_avi_infoframe avi;
|
|
|
|
int r;
|
|
|
|
|
2019-01-11 15:32:10 +00:00
|
|
|
r = drm_hdmi_avi_infoframe_from_display_mode(&avi, connector,
|
|
|
|
adjusted_mode);
|
2018-11-21 16:09:14 +00:00
|
|
|
if (r == 0)
|
|
|
|
dssdev->ops->hdmi.set_infoframe(dssdev, &avi);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
staging: add omapdrm DRM/KMS driver for TI OMAP platforms
A DRM display driver for TI OMAP platform. Similar to omapfb (fbdev)
and omap_vout (v4l2 display) drivers in the past, this driver uses the
DSS2 driver to access the display hardware, including support for
HDMI, DVI, and various types of LCD panels. And it implements GEM
support for buffer allocation (for KMS as well as offscreen buffers
used by the xf86-video-omap userspace xorg driver).
The driver maps CRTCs to overlays, encoders to overlay-managers, and
connectors to dssdev's. Note that this arrangement might change slightly
when support for drm_plane overlays is added.
For GEM support, non-scanout buffers are using the shmem backed pages
provided by GEM core (In drm_gem_object_init()). In the case of scanout
buffers, which need to be physically contiguous, those are allocated
with CMA and use drm_gem_private_object_init().
See userspace xorg driver:
git://github.com/robclark/xf86-video-omap.git
Refer to this link for CMA (Continuous Memory Allocator):
http://lkml.org/lkml/2011/8/19/302
Links to previous versions of the patch:
v1: http://lwn.net/Articles/458137/
v2: http://patches.linaro.org/4156/
v3: http://patches.linaro.org/4688/
v4: http://patches.linaro.org/4791/
History:
v5: move headers from include/drm at Greg KH's request, minor rebasing
on 3.2-rc1, pull in private copies of drm_gem_{get,put}_pages()
because "drm/gem: add functions to get/put pages" patch is not
merged yet
v4: bit of rework of encoder/connector _dpms() code, modeset_init()
rework to not use nested functions, update TODO.txt
v3: minor cleanups, improved error handling for dev_load(), some minor
API changes that will be needed later for tiled buffer support
v2: replace omap_vram with CMA for scanout buffer allocation, remove
unneeded functions, use dma_addr_t for physical addresses, error
handling cleanup, refactor attach/detach pages into common drm
functions, split non-userspace-facing API into omap_priv.h, remove
plugin API
v1: original
Signed-off-by: Rob Clark <rob@ti.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-12 18:09:40 +00:00
|
|
|
static void omap_encoder_mode_set(struct drm_encoder *encoder,
|
2018-06-07 14:58:57 +00:00
|
|
|
struct drm_display_mode *mode,
|
|
|
|
struct drm_display_mode *adjusted_mode)
|
staging: add omapdrm DRM/KMS driver for TI OMAP platforms
A DRM display driver for TI OMAP platform. Similar to omapfb (fbdev)
and omap_vout (v4l2 display) drivers in the past, this driver uses the
DSS2 driver to access the display hardware, including support for
HDMI, DVI, and various types of LCD panels. And it implements GEM
support for buffer allocation (for KMS as well as offscreen buffers
used by the xf86-video-omap userspace xorg driver).
The driver maps CRTCs to overlays, encoders to overlay-managers, and
connectors to dssdev's. Note that this arrangement might change slightly
when support for drm_plane overlays is added.
For GEM support, non-scanout buffers are using the shmem backed pages
provided by GEM core (In drm_gem_object_init()). In the case of scanout
buffers, which need to be physically contiguous, those are allocated
with CMA and use drm_gem_private_object_init().
See userspace xorg driver:
git://github.com/robclark/xf86-video-omap.git
Refer to this link for CMA (Continuous Memory Allocator):
http://lkml.org/lkml/2011/8/19/302
Links to previous versions of the patch:
v1: http://lwn.net/Articles/458137/
v2: http://patches.linaro.org/4156/
v3: http://patches.linaro.org/4688/
v4: http://patches.linaro.org/4791/
History:
v5: move headers from include/drm at Greg KH's request, minor rebasing
on 3.2-rc1, pull in private copies of drm_gem_{get,put}_pages()
because "drm/gem: add functions to get/put pages" patch is not
merged yet
v4: bit of rework of encoder/connector _dpms() code, modeset_init()
rework to not use nested functions, update TODO.txt
v3: minor cleanups, improved error handling for dev_load(), some minor
API changes that will be needed later for tiled buffer support
v2: replace omap_vram with CMA for scanout buffer allocation, remove
unneeded functions, use dma_addr_t for physical addresses, error
handling cleanup, refactor attach/detach pages into common drm
functions, split non-userspace-facing API into omap_priv.h, remove
plugin API
v1: original
Signed-off-by: Rob Clark <rob@ti.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-12 18:09:40 +00:00
|
|
|
{
|
2014-06-18 11:19:48 +00:00
|
|
|
struct omap_encoder *omap_encoder = to_omap_encoder(encoder);
|
2018-09-23 09:58:15 +00:00
|
|
|
struct omap_dss_device *output = omap_encoder->output;
|
2018-06-07 14:58:57 +00:00
|
|
|
struct omap_dss_device *dssdev;
|
2018-12-07 21:08:35 +00:00
|
|
|
struct drm_device *dev = encoder->dev;
|
|
|
|
struct drm_connector *connector;
|
2018-09-23 09:58:15 +00:00
|
|
|
struct drm_bridge *bridge;
|
2018-06-07 14:58:57 +00:00
|
|
|
struct videomode vm = { 0 };
|
2018-12-07 21:08:35 +00:00
|
|
|
u32 bus_flags;
|
|
|
|
|
|
|
|
list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
|
|
|
|
if (connector->encoder == encoder)
|
|
|
|
break;
|
|
|
|
}
|
2014-06-18 11:19:48 +00:00
|
|
|
|
2018-06-07 14:58:57 +00:00
|
|
|
drm_display_mode_to_videomode(adjusted_mode, &vm);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* HACK: This fixes the vm flags.
|
|
|
|
* struct drm_display_mode does not contain the VSYNC/HSYNC/DE flags and
|
|
|
|
* they get lost when converting back and forth between struct
|
|
|
|
* drm_display_mode and struct videomode. The hack below goes and
|
|
|
|
* fetches the missing flags.
|
|
|
|
*
|
|
|
|
* A better solution is to use DRM's bus-flags through the whole driver.
|
|
|
|
*/
|
2018-09-23 09:58:15 +00:00
|
|
|
for (dssdev = output; dssdev; dssdev = dssdev->next)
|
|
|
|
omap_encoder_update_videomode_flags(&vm, dssdev->bus_flags);
|
2018-06-07 14:58:57 +00:00
|
|
|
|
2018-09-23 09:58:15 +00:00
|
|
|
for (bridge = output->bridge; bridge; bridge = bridge->next) {
|
|
|
|
if (!bridge->timings)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
bus_flags = bridge->timings->input_bus_flags;
|
|
|
|
omap_encoder_update_videomode_flags(&vm, bus_flags);
|
2018-06-07 14:58:57 +00:00
|
|
|
}
|
|
|
|
|
2018-12-07 21:08:35 +00:00
|
|
|
bus_flags = connector->display_info.bus_flags;
|
|
|
|
omap_encoder_update_videomode_flags(&vm, bus_flags);
|
|
|
|
|
2018-06-07 16:55:04 +00:00
|
|
|
/* Set timings for all devices in the display pipeline. */
|
2018-09-23 09:58:15 +00:00
|
|
|
dss_mgr_set_timings(output, &vm);
|
2018-06-07 16:55:04 +00:00
|
|
|
|
2018-09-23 09:58:15 +00:00
|
|
|
for (dssdev = output; dssdev; dssdev = dssdev->next) {
|
2018-06-07 16:55:04 +00:00
|
|
|
if (dssdev->ops->set_timings)
|
2018-09-21 14:00:29 +00:00
|
|
|
dssdev->ops->set_timings(dssdev, adjusted_mode);
|
2018-06-07 16:55:04 +00:00
|
|
|
}
|
2018-06-07 14:58:57 +00:00
|
|
|
|
2018-06-07 16:55:04 +00:00
|
|
|
/* Set the HDMI mode and HDMI infoframe if applicable. */
|
2018-09-23 09:58:15 +00:00
|
|
|
if (output->type == OMAP_DISPLAY_TYPE_HDMI)
|
2018-12-07 21:08:35 +00:00
|
|
|
omap_encoder_hdmi_mode_set(connector, encoder, adjusted_mode);
|
staging: add omapdrm DRM/KMS driver for TI OMAP platforms
A DRM display driver for TI OMAP platform. Similar to omapfb (fbdev)
and omap_vout (v4l2 display) drivers in the past, this driver uses the
DSS2 driver to access the display hardware, including support for
HDMI, DVI, and various types of LCD panels. And it implements GEM
support for buffer allocation (for KMS as well as offscreen buffers
used by the xf86-video-omap userspace xorg driver).
The driver maps CRTCs to overlays, encoders to overlay-managers, and
connectors to dssdev's. Note that this arrangement might change slightly
when support for drm_plane overlays is added.
For GEM support, non-scanout buffers are using the shmem backed pages
provided by GEM core (In drm_gem_object_init()). In the case of scanout
buffers, which need to be physically contiguous, those are allocated
with CMA and use drm_gem_private_object_init().
See userspace xorg driver:
git://github.com/robclark/xf86-video-omap.git
Refer to this link for CMA (Continuous Memory Allocator):
http://lkml.org/lkml/2011/8/19/302
Links to previous versions of the patch:
v1: http://lwn.net/Articles/458137/
v2: http://patches.linaro.org/4156/
v3: http://patches.linaro.org/4688/
v4: http://patches.linaro.org/4791/
History:
v5: move headers from include/drm at Greg KH's request, minor rebasing
on 3.2-rc1, pull in private copies of drm_gem_{get,put}_pages()
because "drm/gem: add functions to get/put pages" patch is not
merged yet
v4: bit of rework of encoder/connector _dpms() code, modeset_init()
rework to not use nested functions, update TODO.txt
v3: minor cleanups, improved error handling for dev_load(), some minor
API changes that will be needed later for tiled buffer support
v2: replace omap_vram with CMA for scanout buffer allocation, remove
unneeded functions, use dma_addr_t for physical addresses, error
handling cleanup, refactor attach/detach pages into common drm
functions, split non-userspace-facing API into omap_priv.h, remove
plugin API
v1: original
Signed-off-by: Rob Clark <rob@ti.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-12 18:09:40 +00:00
|
|
|
}
|
|
|
|
|
2015-03-06 22:22:39 +00:00
|
|
|
static void omap_encoder_disable(struct drm_encoder *encoder)
|
staging: add omapdrm DRM/KMS driver for TI OMAP platforms
A DRM display driver for TI OMAP platform. Similar to omapfb (fbdev)
and omap_vout (v4l2 display) drivers in the past, this driver uses the
DSS2 driver to access the display hardware, including support for
HDMI, DVI, and various types of LCD panels. And it implements GEM
support for buffer allocation (for KMS as well as offscreen buffers
used by the xf86-video-omap userspace xorg driver).
The driver maps CRTCs to overlays, encoders to overlay-managers, and
connectors to dssdev's. Note that this arrangement might change slightly
when support for drm_plane overlays is added.
For GEM support, non-scanout buffers are using the shmem backed pages
provided by GEM core (In drm_gem_object_init()). In the case of scanout
buffers, which need to be physically contiguous, those are allocated
with CMA and use drm_gem_private_object_init().
See userspace xorg driver:
git://github.com/robclark/xf86-video-omap.git
Refer to this link for CMA (Continuous Memory Allocator):
http://lkml.org/lkml/2011/8/19/302
Links to previous versions of the patch:
v1: http://lwn.net/Articles/458137/
v2: http://patches.linaro.org/4156/
v3: http://patches.linaro.org/4688/
v4: http://patches.linaro.org/4791/
History:
v5: move headers from include/drm at Greg KH's request, minor rebasing
on 3.2-rc1, pull in private copies of drm_gem_{get,put}_pages()
because "drm/gem: add functions to get/put pages" patch is not
merged yet
v4: bit of rework of encoder/connector _dpms() code, modeset_init()
rework to not use nested functions, update TODO.txt
v3: minor cleanups, improved error handling for dev_load(), some minor
API changes that will be needed later for tiled buffer support
v2: replace omap_vram with CMA for scanout buffer allocation, remove
unneeded functions, use dma_addr_t for physical addresses, error
handling cleanup, refactor attach/detach pages into common drm
functions, split non-userspace-facing API into omap_priv.h, remove
plugin API
v1: original
Signed-off-by: Rob Clark <rob@ti.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-12 18:09:40 +00:00
|
|
|
{
|
|
|
|
struct omap_encoder *omap_encoder = to_omap_encoder(encoder);
|
2018-08-24 16:38:07 +00:00
|
|
|
struct omap_dss_device *dssdev = omap_encoder->output;
|
2018-09-04 14:22:27 +00:00
|
|
|
struct drm_device *dev = encoder->dev;
|
|
|
|
|
|
|
|
dev_dbg(dev->dev, "disable(%s)\n", dssdev->name);
|
|
|
|
|
2018-12-07 21:08:35 +00:00
|
|
|
/* Disable the panel if present. */
|
|
|
|
if (dssdev->panel) {
|
|
|
|
drm_panel_disable(dssdev->panel);
|
|
|
|
drm_panel_unprepare(dssdev->panel);
|
|
|
|
}
|
|
|
|
|
2018-08-24 16:38:07 +00:00
|
|
|
/*
|
|
|
|
* Disable the chain of external devices, starting at the one at the
|
|
|
|
* internal encoder's output.
|
|
|
|
*/
|
|
|
|
omapdss_device_disable(dssdev->next);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Disable the internal encoder. This will disable the DSS output. The
|
|
|
|
* DSI is treated as an exception as DSI pipelines still use the legacy
|
|
|
|
* flow where the pipeline output controls the encoder.
|
|
|
|
*/
|
2018-12-10 12:00:38 +00:00
|
|
|
if (dssdev->type != OMAP_DISPLAY_TYPE_DSI) {
|
2018-08-24 16:38:07 +00:00
|
|
|
dssdev->ops->disable(dssdev);
|
|
|
|
dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
|
|
|
|
}
|
2018-09-04 14:22:27 +00:00
|
|
|
|
2018-08-24 16:38:07 +00:00
|
|
|
/*
|
|
|
|
* Perform the post-disable operations on the chain of external devices
|
|
|
|
* to complete the display pipeline disable.
|
|
|
|
*/
|
|
|
|
omapdss_device_post_disable(dssdev->next);
|
2012-12-04 19:59:12 +00:00
|
|
|
}
|
|
|
|
|
2015-05-27 23:34:05 +00:00
|
|
|
static void omap_encoder_enable(struct drm_encoder *encoder)
|
|
|
|
{
|
|
|
|
struct omap_encoder *omap_encoder = to_omap_encoder(encoder);
|
2018-08-24 16:38:07 +00:00
|
|
|
struct omap_dss_device *dssdev = omap_encoder->output;
|
2018-09-04 14:22:27 +00:00
|
|
|
struct drm_device *dev = encoder->dev;
|
2015-05-27 23:34:05 +00:00
|
|
|
|
2018-09-04 14:22:27 +00:00
|
|
|
dev_dbg(dev->dev, "enable(%s)\n", dssdev->name);
|
|
|
|
|
2018-08-24 16:38:07 +00:00
|
|
|
/* Prepare the chain of external devices for pipeline enable. */
|
|
|
|
omapdss_device_pre_enable(dssdev->next);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Enable the internal encoder. This will enable the DSS output. The
|
|
|
|
* DSI is treated as an exception as DSI pipelines still use the legacy
|
|
|
|
* flow where the pipeline output controls the encoder.
|
|
|
|
*/
|
2018-12-10 12:00:38 +00:00
|
|
|
if (dssdev->type != OMAP_DISPLAY_TYPE_DSI) {
|
2018-08-24 16:38:07 +00:00
|
|
|
dssdev->ops->enable(dssdev);
|
|
|
|
dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
|
2018-09-04 20:53:34 +00:00
|
|
|
}
|
2018-09-04 14:22:27 +00:00
|
|
|
|
2018-08-24 16:38:07 +00:00
|
|
|
/*
|
|
|
|
* Enable the chain of external devices, starting at the one at the
|
|
|
|
* internal encoder's output.
|
|
|
|
*/
|
|
|
|
omapdss_device_enable(dssdev->next);
|
2018-12-07 21:08:35 +00:00
|
|
|
|
|
|
|
/* Enable the panel if present. */
|
|
|
|
if (dssdev->panel) {
|
|
|
|
drm_panel_prepare(dssdev->panel);
|
|
|
|
drm_panel_enable(dssdev->panel);
|
|
|
|
}
|
2015-05-27 23:34:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int omap_encoder_atomic_check(struct drm_encoder *encoder,
|
|
|
|
struct drm_crtc_state *crtc_state,
|
|
|
|
struct drm_connector_state *conn_state)
|
|
|
|
{
|
2018-06-07 14:58:57 +00:00
|
|
|
struct omap_encoder *omap_encoder = to_omap_encoder(encoder);
|
2018-09-21 13:13:00 +00:00
|
|
|
enum drm_mode_status status;
|
|
|
|
|
|
|
|
status = omap_connector_mode_fixup(omap_encoder->output,
|
|
|
|
&crtc_state->mode,
|
|
|
|
&crtc_state->adjusted_mode);
|
|
|
|
if (status != MODE_OK) {
|
|
|
|
dev_err(encoder->dev->dev, "invalid timings: %d\n", status);
|
|
|
|
return -EINVAL;
|
2018-06-07 14:58:57 +00:00
|
|
|
}
|
|
|
|
|
2018-09-21 13:13:00 +00:00
|
|
|
return 0;
|
2015-05-27 23:34:05 +00: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,
|
|
|
|
};
|
|
|
|
|
staging: add omapdrm DRM/KMS driver for TI OMAP platforms
A DRM display driver for TI OMAP platform. Similar to omapfb (fbdev)
and omap_vout (v4l2 display) drivers in the past, this driver uses the
DSS2 driver to access the display hardware, including support for
HDMI, DVI, and various types of LCD panels. And it implements GEM
support for buffer allocation (for KMS as well as offscreen buffers
used by the xf86-video-omap userspace xorg driver).
The driver maps CRTCs to overlays, encoders to overlay-managers, and
connectors to dssdev's. Note that this arrangement might change slightly
when support for drm_plane overlays is added.
For GEM support, non-scanout buffers are using the shmem backed pages
provided by GEM core (In drm_gem_object_init()). In the case of scanout
buffers, which need to be physically contiguous, those are allocated
with CMA and use drm_gem_private_object_init().
See userspace xorg driver:
git://github.com/robclark/xf86-video-omap.git
Refer to this link for CMA (Continuous Memory Allocator):
http://lkml.org/lkml/2011/8/19/302
Links to previous versions of the patch:
v1: http://lwn.net/Articles/458137/
v2: http://patches.linaro.org/4156/
v3: http://patches.linaro.org/4688/
v4: http://patches.linaro.org/4791/
History:
v5: move headers from include/drm at Greg KH's request, minor rebasing
on 3.2-rc1, pull in private copies of drm_gem_{get,put}_pages()
because "drm/gem: add functions to get/put pages" patch is not
merged yet
v4: bit of rework of encoder/connector _dpms() code, modeset_init()
rework to not use nested functions, update TODO.txt
v3: minor cleanups, improved error handling for dev_load(), some minor
API changes that will be needed later for tiled buffer support
v2: replace omap_vram with CMA for scanout buffer allocation, remove
unneeded functions, use dma_addr_t for physical addresses, error
handling cleanup, refactor attach/detach pages into common drm
functions, split non-userspace-facing API into omap_priv.h, remove
plugin API
v1: original
Signed-off-by: Rob Clark <rob@ti.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-12 18:09:40 +00:00
|
|
|
/* initialize encoder */
|
|
|
|
struct drm_encoder *omap_encoder_init(struct drm_device *dev,
|
2018-09-12 23:23:26 +00:00
|
|
|
struct omap_dss_device *output)
|
staging: add omapdrm DRM/KMS driver for TI OMAP platforms
A DRM display driver for TI OMAP platform. Similar to omapfb (fbdev)
and omap_vout (v4l2 display) drivers in the past, this driver uses the
DSS2 driver to access the display hardware, including support for
HDMI, DVI, and various types of LCD panels. And it implements GEM
support for buffer allocation (for KMS as well as offscreen buffers
used by the xf86-video-omap userspace xorg driver).
The driver maps CRTCs to overlays, encoders to overlay-managers, and
connectors to dssdev's. Note that this arrangement might change slightly
when support for drm_plane overlays is added.
For GEM support, non-scanout buffers are using the shmem backed pages
provided by GEM core (In drm_gem_object_init()). In the case of scanout
buffers, which need to be physically contiguous, those are allocated
with CMA and use drm_gem_private_object_init().
See userspace xorg driver:
git://github.com/robclark/xf86-video-omap.git
Refer to this link for CMA (Continuous Memory Allocator):
http://lkml.org/lkml/2011/8/19/302
Links to previous versions of the patch:
v1: http://lwn.net/Articles/458137/
v2: http://patches.linaro.org/4156/
v3: http://patches.linaro.org/4688/
v4: http://patches.linaro.org/4791/
History:
v5: move headers from include/drm at Greg KH's request, minor rebasing
on 3.2-rc1, pull in private copies of drm_gem_{get,put}_pages()
because "drm/gem: add functions to get/put pages" patch is not
merged yet
v4: bit of rework of encoder/connector _dpms() code, modeset_init()
rework to not use nested functions, update TODO.txt
v3: minor cleanups, improved error handling for dev_load(), some minor
API changes that will be needed later for tiled buffer support
v2: replace omap_vram with CMA for scanout buffer allocation, remove
unneeded functions, use dma_addr_t for physical addresses, error
handling cleanup, refactor attach/detach pages into common drm
functions, split non-userspace-facing API into omap_priv.h, remove
plugin API
v1: original
Signed-off-by: Rob Clark <rob@ti.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-12 18:09:40 +00:00
|
|
|
{
|
|
|
|
struct drm_encoder *encoder = NULL;
|
|
|
|
struct omap_encoder *omap_encoder;
|
|
|
|
|
|
|
|
omap_encoder = kzalloc(sizeof(*omap_encoder), GFP_KERNEL);
|
2013-02-11 17:41:29 +00:00
|
|
|
if (!omap_encoder)
|
staging: add omapdrm DRM/KMS driver for TI OMAP platforms
A DRM display driver for TI OMAP platform. Similar to omapfb (fbdev)
and omap_vout (v4l2 display) drivers in the past, this driver uses the
DSS2 driver to access the display hardware, including support for
HDMI, DVI, and various types of LCD panels. And it implements GEM
support for buffer allocation (for KMS as well as offscreen buffers
used by the xf86-video-omap userspace xorg driver).
The driver maps CRTCs to overlays, encoders to overlay-managers, and
connectors to dssdev's. Note that this arrangement might change slightly
when support for drm_plane overlays is added.
For GEM support, non-scanout buffers are using the shmem backed pages
provided by GEM core (In drm_gem_object_init()). In the case of scanout
buffers, which need to be physically contiguous, those are allocated
with CMA and use drm_gem_private_object_init().
See userspace xorg driver:
git://github.com/robclark/xf86-video-omap.git
Refer to this link for CMA (Continuous Memory Allocator):
http://lkml.org/lkml/2011/8/19/302
Links to previous versions of the patch:
v1: http://lwn.net/Articles/458137/
v2: http://patches.linaro.org/4156/
v3: http://patches.linaro.org/4688/
v4: http://patches.linaro.org/4791/
History:
v5: move headers from include/drm at Greg KH's request, minor rebasing
on 3.2-rc1, pull in private copies of drm_gem_{get,put}_pages()
because "drm/gem: add functions to get/put pages" patch is not
merged yet
v4: bit of rework of encoder/connector _dpms() code, modeset_init()
rework to not use nested functions, update TODO.txt
v3: minor cleanups, improved error handling for dev_load(), some minor
API changes that will be needed later for tiled buffer support
v2: replace omap_vram with CMA for scanout buffer allocation, remove
unneeded functions, use dma_addr_t for physical addresses, error
handling cleanup, refactor attach/detach pages into common drm
functions, split non-userspace-facing API into omap_priv.h, remove
plugin API
v1: original
Signed-off-by: Rob Clark <rob@ti.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-12 18:09:40 +00:00
|
|
|
goto fail;
|
|
|
|
|
2018-05-31 20:14:43 +00:00
|
|
|
omap_encoder->output = output;
|
2012-12-04 19:59:12 +00:00
|
|
|
|
staging: add omapdrm DRM/KMS driver for TI OMAP platforms
A DRM display driver for TI OMAP platform. Similar to omapfb (fbdev)
and omap_vout (v4l2 display) drivers in the past, this driver uses the
DSS2 driver to access the display hardware, including support for
HDMI, DVI, and various types of LCD panels. And it implements GEM
support for buffer allocation (for KMS as well as offscreen buffers
used by the xf86-video-omap userspace xorg driver).
The driver maps CRTCs to overlays, encoders to overlay-managers, and
connectors to dssdev's. Note that this arrangement might change slightly
when support for drm_plane overlays is added.
For GEM support, non-scanout buffers are using the shmem backed pages
provided by GEM core (In drm_gem_object_init()). In the case of scanout
buffers, which need to be physically contiguous, those are allocated
with CMA and use drm_gem_private_object_init().
See userspace xorg driver:
git://github.com/robclark/xf86-video-omap.git
Refer to this link for CMA (Continuous Memory Allocator):
http://lkml.org/lkml/2011/8/19/302
Links to previous versions of the patch:
v1: http://lwn.net/Articles/458137/
v2: http://patches.linaro.org/4156/
v3: http://patches.linaro.org/4688/
v4: http://patches.linaro.org/4791/
History:
v5: move headers from include/drm at Greg KH's request, minor rebasing
on 3.2-rc1, pull in private copies of drm_gem_{get,put}_pages()
because "drm/gem: add functions to get/put pages" patch is not
merged yet
v4: bit of rework of encoder/connector _dpms() code, modeset_init()
rework to not use nested functions, update TODO.txt
v3: minor cleanups, improved error handling for dev_load(), some minor
API changes that will be needed later for tiled buffer support
v2: replace omap_vram with CMA for scanout buffer allocation, remove
unneeded functions, use dma_addr_t for physical addresses, error
handling cleanup, refactor attach/detach pages into common drm
functions, split non-userspace-facing API into omap_priv.h, remove
plugin API
v1: original
Signed-off-by: Rob Clark <rob@ti.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-12 18:09:40 +00:00
|
|
|
encoder = &omap_encoder->base;
|
|
|
|
|
|
|
|
drm_encoder_init(dev, encoder, &omap_encoder_funcs,
|
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 14:20:18 +00:00
|
|
|
DRM_MODE_ENCODER_TMDS, NULL);
|
staging: add omapdrm DRM/KMS driver for TI OMAP platforms
A DRM display driver for TI OMAP platform. Similar to omapfb (fbdev)
and omap_vout (v4l2 display) drivers in the past, this driver uses the
DSS2 driver to access the display hardware, including support for
HDMI, DVI, and various types of LCD panels. And it implements GEM
support for buffer allocation (for KMS as well as offscreen buffers
used by the xf86-video-omap userspace xorg driver).
The driver maps CRTCs to overlays, encoders to overlay-managers, and
connectors to dssdev's. Note that this arrangement might change slightly
when support for drm_plane overlays is added.
For GEM support, non-scanout buffers are using the shmem backed pages
provided by GEM core (In drm_gem_object_init()). In the case of scanout
buffers, which need to be physically contiguous, those are allocated
with CMA and use drm_gem_private_object_init().
See userspace xorg driver:
git://github.com/robclark/xf86-video-omap.git
Refer to this link for CMA (Continuous Memory Allocator):
http://lkml.org/lkml/2011/8/19/302
Links to previous versions of the patch:
v1: http://lwn.net/Articles/458137/
v2: http://patches.linaro.org/4156/
v3: http://patches.linaro.org/4688/
v4: http://patches.linaro.org/4791/
History:
v5: move headers from include/drm at Greg KH's request, minor rebasing
on 3.2-rc1, pull in private copies of drm_gem_{get,put}_pages()
because "drm/gem: add functions to get/put pages" patch is not
merged yet
v4: bit of rework of encoder/connector _dpms() code, modeset_init()
rework to not use nested functions, update TODO.txt
v3: minor cleanups, improved error handling for dev_load(), some minor
API changes that will be needed later for tiled buffer support
v2: replace omap_vram with CMA for scanout buffer allocation, remove
unneeded functions, use dma_addr_t for physical addresses, error
handling cleanup, refactor attach/detach pages into common drm
functions, split non-userspace-facing API into omap_priv.h, remove
plugin API
v1: original
Signed-off-by: Rob Clark <rob@ti.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-12 18:09:40 +00:00
|
|
|
drm_encoder_helper_add(encoder, &omap_encoder_helper_funcs);
|
|
|
|
|
|
|
|
return encoder;
|
|
|
|
|
|
|
|
fail:
|
2012-11-14 10:31:27 +00:00
|
|
|
if (encoder)
|
2011-12-10 05:26:07 +00:00
|
|
|
omap_encoder_destroy(encoder);
|
staging: add omapdrm DRM/KMS driver for TI OMAP platforms
A DRM display driver for TI OMAP platform. Similar to omapfb (fbdev)
and omap_vout (v4l2 display) drivers in the past, this driver uses the
DSS2 driver to access the display hardware, including support for
HDMI, DVI, and various types of LCD panels. And it implements GEM
support for buffer allocation (for KMS as well as offscreen buffers
used by the xf86-video-omap userspace xorg driver).
The driver maps CRTCs to overlays, encoders to overlay-managers, and
connectors to dssdev's. Note that this arrangement might change slightly
when support for drm_plane overlays is added.
For GEM support, non-scanout buffers are using the shmem backed pages
provided by GEM core (In drm_gem_object_init()). In the case of scanout
buffers, which need to be physically contiguous, those are allocated
with CMA and use drm_gem_private_object_init().
See userspace xorg driver:
git://github.com/robclark/xf86-video-omap.git
Refer to this link for CMA (Continuous Memory Allocator):
http://lkml.org/lkml/2011/8/19/302
Links to previous versions of the patch:
v1: http://lwn.net/Articles/458137/
v2: http://patches.linaro.org/4156/
v3: http://patches.linaro.org/4688/
v4: http://patches.linaro.org/4791/
History:
v5: move headers from include/drm at Greg KH's request, minor rebasing
on 3.2-rc1, pull in private copies of drm_gem_{get,put}_pages()
because "drm/gem: add functions to get/put pages" patch is not
merged yet
v4: bit of rework of encoder/connector _dpms() code, modeset_init()
rework to not use nested functions, update TODO.txt
v3: minor cleanups, improved error handling for dev_load(), some minor
API changes that will be needed later for tiled buffer support
v2: replace omap_vram with CMA for scanout buffer allocation, remove
unneeded functions, use dma_addr_t for physical addresses, error
handling cleanup, refactor attach/detach pages into common drm
functions, split non-userspace-facing API into omap_priv.h, remove
plugin API
v1: original
Signed-off-by: Rob Clark <rob@ti.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-12 18:09:40 +00:00
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|