Merge branch 'exynos-drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-next
Feature summary: Add S3C64XX SoC series support - S3C64XX SoC series are previous version chips of Exynos SoC series. With this patch set, KMS driver of Exynos drm supports those chips also. Update device tree support - This patch set corrects compatible strings, and adds Exynos5420 SoC support for hdmi subsystem. Consider CCF (Common Clock Framework) support - With reference to CCF support, it uses clock_prepare_enable/clock_disable_unprepare instead of clk_enable/clk_disable for hdmi subsystem. Big cleanups - This patch just removes unnecessary all debug logs. * 'exynos-drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos: (22 commits) ARM: dts: change compatible strings for EXYNOS5250 hdmi subsystem drm/exynos: add support for exynos5420 mixer drm/exynos: add new compatible strings for hdmi subsystem drm/exynos: fix interlace resolutions for exynos5420 drm/exynos: use of_get_named_gpio to get hdmi hpd gpio drm/exynos: make sure to handle an error case to vm_mmap call drm/exynos: exynos_drm_ipp: Remove redundant break statement drm/exynos: add mout_hdmi clock in hdmi driver to change parent drm/exynos: Prepare/Unprepare HDMI subsystem clocks drm/exynos: Clean up logs for DRM_ERROR / DRM_DEBUG_KMS drm/exynos: Remove tracking log functions drm/exynos: hdmi: use drm_display_mode to check the supported modes drm/exynos: fimd: Add support for S3C64xx SoCs drm/exynos: fimd: Add support for FIMD variants with clock selection drm/exynos: fimd: Add support for FIMD versions without SHADOWCON register drm/exynos: fimd: Hold pointer to driver data in context struct drm/exynos: do not use mode_set_base function directly drm/exynos: Remove redundant use of of_match_ptr macro drm/exynos: remove ignoring return value warning in hdmi drm/exynos: fix WINDOWS_NR checking to vidi driver ...
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
Device-Tree bindings for drm hdmi driver
|
||||
|
||||
Required properties:
|
||||
- compatible: value should be "samsung,exynos5-hdmi".
|
||||
- compatible: value should be one among the following:
|
||||
1) "samsung,exynos5-hdmi" <DEPRECATED>
|
||||
2) "samsung,exynos4210-hdmi"
|
||||
3) "samsung,exynos4212-hdmi"
|
||||
- reg: physical base address of the hdmi and length of memory mapped
|
||||
region.
|
||||
- interrupts: interrupt number to the cpu.
|
||||
@@ -15,7 +18,7 @@ Required properties:
|
||||
Example:
|
||||
|
||||
hdmi {
|
||||
compatible = "samsung,exynos5-hdmi";
|
||||
compatible = "samsung,exynos4212-hdmi";
|
||||
reg = <0x14530000 0x100000>;
|
||||
interrupts = <0 95 0>;
|
||||
hpd-gpio = <&gpx3 7 0xf 1 3>;
|
||||
|
@@ -1,12 +1,15 @@
|
||||
Device-Tree bindings for hdmiddc driver
|
||||
|
||||
Required properties:
|
||||
- compatible: value should be "samsung,exynos5-hdmiddc".
|
||||
- compatible: value should be one of the following
|
||||
1) "samsung,exynos5-hdmiddc" <DEPRECATED>
|
||||
2) "samsung,exynos4210-hdmiddc"
|
||||
|
||||
- reg: I2C address of the hdmiddc device.
|
||||
|
||||
Example:
|
||||
|
||||
hdmiddc {
|
||||
compatible = "samsung,exynos5-hdmiddc";
|
||||
compatible = "samsung,exynos4210-hdmiddc";
|
||||
reg = <0x50>;
|
||||
};
|
||||
|
@@ -1,12 +1,15 @@
|
||||
Device-Tree bindings for hdmiphy driver
|
||||
|
||||
Required properties:
|
||||
- compatible: value should be "samsung,exynos5-hdmiphy".
|
||||
- compatible: value should be one of the following:
|
||||
1) "samsung,exynos5-hdmiphy" <DEPRECATED>
|
||||
2) "samsung,exynos4210-hdmiphy".
|
||||
3) "samsung,exynos4212-hdmiphy".
|
||||
- reg: I2C address of the hdmiphy device.
|
||||
|
||||
Example:
|
||||
|
||||
hdmiphy {
|
||||
compatible = "samsung,exynos5-hdmiphy";
|
||||
compatible = "samsung,exynos4210-hdmiphy";
|
||||
reg = <0x38>;
|
||||
};
|
||||
|
@@ -1,7 +1,12 @@
|
||||
Device-Tree bindings for mixer driver
|
||||
|
||||
Required properties:
|
||||
- compatible: value should be "samsung,exynos5-mixer".
|
||||
- compatible: value should be one of the following:
|
||||
1) "samsung,exynos5-mixer" <DEPRECATED>
|
||||
2) "samsung,exynos4210-mixer"
|
||||
3) "samsung,exynos5250-mixer"
|
||||
4) "samsung,exynos5420-mixer"
|
||||
|
||||
- reg: physical base address of the mixer and length of memory mapped
|
||||
region.
|
||||
- interrupts: interrupt number to the cpu.
|
||||
@@ -9,7 +14,7 @@ Required properties:
|
||||
Example:
|
||||
|
||||
mixer {
|
||||
compatible = "samsung,exynos5-mixer";
|
||||
compatible = "samsung,exynos5250-mixer";
|
||||
reg = <0x14450000 0x10000>;
|
||||
interrupts = <0 94 0>;
|
||||
};
|
||||
|
@@ -190,7 +190,7 @@
|
||||
samsung,i2c-max-bus-freq = <66000>;
|
||||
|
||||
hdmiddc@50 {
|
||||
compatible = "samsung,exynos5-hdmiddc";
|
||||
compatible = "samsung,exynos4210-hdmiddc";
|
||||
reg = <0x50>;
|
||||
};
|
||||
};
|
||||
@@ -224,7 +224,7 @@
|
||||
samsung,i2c-max-bus-freq = <378000>;
|
||||
|
||||
hdmiphy@38 {
|
||||
compatible = "samsung,exynos5-hdmiphy";
|
||||
compatible = "samsung,exynos4212-hdmiphy";
|
||||
reg = <0x38>;
|
||||
};
|
||||
};
|
||||
|
@@ -72,7 +72,7 @@
|
||||
samsung,i2c-max-bus-freq = <66000>;
|
||||
|
||||
hdmiddc@50 {
|
||||
compatible = "samsung,exynos5-hdmiddc";
|
||||
compatible = "samsung,exynos4210-hdmiddc";
|
||||
reg = <0x50>;
|
||||
};
|
||||
};
|
||||
@@ -102,7 +102,7 @@
|
||||
samsung,i2c-max-bus-freq = <66000>;
|
||||
|
||||
hdmiphy@38 {
|
||||
compatible = "samsung,exynos5-hdmiphy";
|
||||
compatible = "samsung,exynos4212-hdmiphy";
|
||||
reg = <0x38>;
|
||||
};
|
||||
};
|
||||
|
@@ -601,7 +601,7 @@
|
||||
};
|
||||
|
||||
hdmi {
|
||||
compatible = "samsung,exynos5-hdmi";
|
||||
compatible = "samsung,exynos4212-hdmi";
|
||||
reg = <0x14530000 0x70000>;
|
||||
interrupts = <0 95 0>;
|
||||
clocks = <&clock 333>, <&clock 136>, <&clock 137>,
|
||||
@@ -611,7 +611,7 @@
|
||||
};
|
||||
|
||||
mixer {
|
||||
compatible = "samsung,exynos5-mixer";
|
||||
compatible = "samsung,exynos5250-mixer";
|
||||
reg = <0x14450000 0x10000>;
|
||||
interrupts = <0 94 0>;
|
||||
};
|
||||
|
@@ -52,6 +52,8 @@ static struct i2c_device_id ddc_idtable[] = {
|
||||
static struct of_device_id hdmiddc_match_types[] = {
|
||||
{
|
||||
.compatible = "samsung,exynos5-hdmiddc",
|
||||
}, {
|
||||
.compatible = "samsung,exynos4210-hdmiddc",
|
||||
}, {
|
||||
/* end node */
|
||||
}
|
||||
|
@@ -24,8 +24,6 @@ static int lowlevel_buffer_allocate(struct drm_device *dev,
|
||||
enum dma_attr attr;
|
||||
unsigned int nr_pages;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
if (buf->dma_addr) {
|
||||
DRM_DEBUG_KMS("already allocated.\n");
|
||||
return 0;
|
||||
@@ -119,8 +117,6 @@ err_free_attrs:
|
||||
static void lowlevel_buffer_deallocate(struct drm_device *dev,
|
||||
unsigned int flags, struct exynos_drm_gem_buf *buf)
|
||||
{
|
||||
DRM_DEBUG_KMS("%s.\n", __FILE__);
|
||||
|
||||
if (!buf->dma_addr) {
|
||||
DRM_DEBUG_KMS("dma_addr is invalid.\n");
|
||||
return;
|
||||
@@ -151,7 +147,6 @@ struct exynos_drm_gem_buf *exynos_drm_init_buf(struct drm_device *dev,
|
||||
{
|
||||
struct exynos_drm_gem_buf *buffer;
|
||||
|
||||
DRM_DEBUG_KMS("%s.\n", __FILE__);
|
||||
DRM_DEBUG_KMS("desired size = 0x%x\n", size);
|
||||
|
||||
buffer = kzalloc(sizeof(*buffer), GFP_KERNEL);
|
||||
@@ -167,8 +162,6 @@ struct exynos_drm_gem_buf *exynos_drm_init_buf(struct drm_device *dev,
|
||||
void exynos_drm_fini_buf(struct drm_device *dev,
|
||||
struct exynos_drm_gem_buf *buffer)
|
||||
{
|
||||
DRM_DEBUG_KMS("%s.\n", __FILE__);
|
||||
|
||||
if (!buffer) {
|
||||
DRM_DEBUG_KMS("buffer is null.\n");
|
||||
return;
|
||||
|
@@ -34,7 +34,6 @@ convert_to_display_mode(struct drm_display_mode *mode,
|
||||
struct exynos_drm_panel_info *panel)
|
||||
{
|
||||
struct fb_videomode *timing = &panel->timing;
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
mode->clock = timing->pixclock / 1000;
|
||||
mode->vrefresh = timing->refresh;
|
||||
@@ -58,37 +57,6 @@ convert_to_display_mode(struct drm_display_mode *mode,
|
||||
mode->flags |= DRM_MODE_FLAG_DBLSCAN;
|
||||
}
|
||||
|
||||
/* convert drm_display_mode to exynos_video_timings */
|
||||
static inline void
|
||||
convert_to_video_timing(struct fb_videomode *timing,
|
||||
struct drm_display_mode *mode)
|
||||
{
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
memset(timing, 0, sizeof(*timing));
|
||||
|
||||
timing->pixclock = mode->clock * 1000;
|
||||
timing->refresh = drm_mode_vrefresh(mode);
|
||||
|
||||
timing->xres = mode->hdisplay;
|
||||
timing->right_margin = mode->hsync_start - mode->hdisplay;
|
||||
timing->hsync_len = mode->hsync_end - mode->hsync_start;
|
||||
timing->left_margin = mode->htotal - mode->hsync_end;
|
||||
|
||||
timing->yres = mode->vdisplay;
|
||||
timing->lower_margin = mode->vsync_start - mode->vdisplay;
|
||||
timing->vsync_len = mode->vsync_end - mode->vsync_start;
|
||||
timing->upper_margin = mode->vtotal - mode->vsync_end;
|
||||
|
||||
if (mode->flags & DRM_MODE_FLAG_INTERLACE)
|
||||
timing->vmode = FB_VMODE_INTERLACED;
|
||||
else
|
||||
timing->vmode = FB_VMODE_NONINTERLACED;
|
||||
|
||||
if (mode->flags & DRM_MODE_FLAG_DBLSCAN)
|
||||
timing->vmode |= FB_VMODE_DOUBLE;
|
||||
}
|
||||
|
||||
static int exynos_drm_connector_get_modes(struct drm_connector *connector)
|
||||
{
|
||||
struct exynos_drm_connector *exynos_connector =
|
||||
@@ -99,8 +67,6 @@ static int exynos_drm_connector_get_modes(struct drm_connector *connector)
|
||||
unsigned int count = 0;
|
||||
int ret;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
if (!display_ops) {
|
||||
DRM_DEBUG_KMS("display_ops is null.\n");
|
||||
return 0;
|
||||
@@ -168,15 +134,12 @@ static int exynos_drm_connector_mode_valid(struct drm_connector *connector,
|
||||
to_exynos_connector(connector);
|
||||
struct exynos_drm_manager *manager = exynos_connector->manager;
|
||||
struct exynos_drm_display_ops *display_ops = manager->display_ops;
|
||||
struct fb_videomode timing;
|
||||
int ret = MODE_BAD;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
convert_to_video_timing(&timing, mode);
|
||||
|
||||
if (display_ops && display_ops->check_timing)
|
||||
if (!display_ops->check_timing(manager->dev, (void *)&timing))
|
||||
if (display_ops && display_ops->check_mode)
|
||||
if (!display_ops->check_mode(manager->dev, mode))
|
||||
ret = MODE_OK;
|
||||
|
||||
return ret;
|
||||
@@ -190,8 +153,6 @@ struct drm_encoder *exynos_drm_best_encoder(struct drm_connector *connector)
|
||||
struct drm_mode_object *obj;
|
||||
struct drm_encoder *encoder;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
obj = drm_mode_object_find(dev, exynos_connector->encoder_id,
|
||||
DRM_MODE_OBJECT_ENCODER);
|
||||
if (!obj) {
|
||||
@@ -234,8 +195,6 @@ void exynos_drm_display_power(struct drm_connector *connector, int mode)
|
||||
static void exynos_drm_connector_dpms(struct drm_connector *connector,
|
||||
int mode)
|
||||
{
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
/*
|
||||
* in case that drm_crtc_helper_set_mode() is called,
|
||||
* encoder/crtc->funcs->dpms() will be just returned
|
||||
@@ -282,8 +241,6 @@ exynos_drm_connector_detect(struct drm_connector *connector, bool force)
|
||||
manager->display_ops;
|
||||
enum drm_connector_status status = connector_status_disconnected;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
if (display_ops && display_ops->is_connected) {
|
||||
if (display_ops->is_connected(manager->dev))
|
||||
status = connector_status_connected;
|
||||
@@ -299,8 +256,6 @@ static void exynos_drm_connector_destroy(struct drm_connector *connector)
|
||||
struct exynos_drm_connector *exynos_connector =
|
||||
to_exynos_connector(connector);
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
drm_sysfs_connector_remove(connector);
|
||||
drm_connector_cleanup(connector);
|
||||
kfree(exynos_connector);
|
||||
@@ -322,8 +277,6 @@ struct drm_connector *exynos_drm_connector_create(struct drm_device *dev,
|
||||
int type;
|
||||
int err;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
exynos_connector = kzalloc(sizeof(*exynos_connector), GFP_KERNEL);
|
||||
if (!exynos_connector) {
|
||||
DRM_ERROR("failed to allocate connector\n");
|
||||
|
@@ -27,8 +27,6 @@ static int exynos_drm_create_enc_conn(struct drm_device *dev,
|
||||
struct drm_connector *connector;
|
||||
int ret;
|
||||
|
||||
DRM_DEBUG_DRIVER("%s\n", __FILE__);
|
||||
|
||||
subdrv->manager->dev = subdrv->dev;
|
||||
|
||||
/* create and initialize a encoder for this sub driver. */
|
||||
@@ -102,8 +100,6 @@ static int exynos_drm_subdrv_probe(struct drm_device *dev,
|
||||
static void exynos_drm_subdrv_remove(struct drm_device *dev,
|
||||
struct exynos_drm_subdrv *subdrv)
|
||||
{
|
||||
DRM_DEBUG_DRIVER("%s\n", __FILE__);
|
||||
|
||||
if (subdrv->remove)
|
||||
subdrv->remove(dev, subdrv->dev);
|
||||
}
|
||||
@@ -114,8 +110,6 @@ int exynos_drm_device_register(struct drm_device *dev)
|
||||
unsigned int fine_cnt = 0;
|
||||
int err;
|
||||
|
||||
DRM_DEBUG_DRIVER("%s\n", __FILE__);
|
||||
|
||||
if (!dev)
|
||||
return -EINVAL;
|
||||
|
||||
@@ -158,8 +152,6 @@ int exynos_drm_device_unregister(struct drm_device *dev)
|
||||
{
|
||||
struct exynos_drm_subdrv *subdrv;
|
||||
|
||||
DRM_DEBUG_DRIVER("%s\n", __FILE__);
|
||||
|
||||
if (!dev) {
|
||||
WARN(1, "Unexpected drm device unregister!\n");
|
||||
return -EINVAL;
|
||||
@@ -176,8 +168,6 @@ EXPORT_SYMBOL_GPL(exynos_drm_device_unregister);
|
||||
|
||||
int exynos_drm_subdrv_register(struct exynos_drm_subdrv *subdrv)
|
||||
{
|
||||
DRM_DEBUG_DRIVER("%s\n", __FILE__);
|
||||
|
||||
if (!subdrv)
|
||||
return -EINVAL;
|
||||
|
||||
@@ -189,8 +179,6 @@ EXPORT_SYMBOL_GPL(exynos_drm_subdrv_register);
|
||||
|
||||
int exynos_drm_subdrv_unregister(struct exynos_drm_subdrv *subdrv)
|
||||
{
|
||||
DRM_DEBUG_DRIVER("%s\n", __FILE__);
|
||||
|
||||
if (!subdrv)
|
||||
return -EINVAL;
|
||||
|
||||
|
@@ -76,8 +76,6 @@ static void exynos_drm_crtc_dpms(struct drm_crtc *crtc, int mode)
|
||||
|
||||
static void exynos_drm_crtc_prepare(struct drm_crtc *crtc)
|
||||
{
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
/* drm framework doesn't check NULL. */
|
||||
}
|
||||
|
||||
@@ -85,8 +83,6 @@ static void exynos_drm_crtc_commit(struct drm_crtc *crtc)
|
||||
{
|
||||
struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
exynos_drm_crtc_dpms(crtc, DRM_MODE_DPMS_ON);
|
||||
exynos_plane_commit(exynos_crtc->plane);
|
||||
exynos_plane_dpms(exynos_crtc->plane, DRM_MODE_DPMS_ON);
|
||||
@@ -97,8 +93,6 @@ exynos_drm_crtc_mode_fixup(struct drm_crtc *crtc,
|
||||
const struct drm_display_mode *mode,
|
||||
struct drm_display_mode *adjusted_mode)
|
||||
{
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
/* drm framework doesn't check NULL */
|
||||
return true;
|
||||
}
|
||||
@@ -115,8 +109,6 @@ exynos_drm_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode,
|
||||
int pipe = exynos_crtc->pipe;
|
||||
int ret;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
/*
|
||||
* copy the mode data adjusted by mode_fixup() into crtc->mode
|
||||
* so that hardware can be seet to proper mode.
|
||||
@@ -139,7 +131,7 @@ exynos_drm_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int exynos_drm_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y,
|
||||
static int exynos_drm_crtc_mode_set_commit(struct drm_crtc *crtc, int x, int y,
|
||||
struct drm_framebuffer *old_fb)
|
||||
{
|
||||
struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
|
||||
@@ -148,8 +140,6 @@ static int exynos_drm_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y,
|
||||
unsigned int crtc_h;
|
||||
int ret;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
/* when framebuffer changing is requested, crtc's dpms should be on */
|
||||
if (exynos_crtc->dpms > DRM_MODE_DPMS_ON) {
|
||||
DRM_ERROR("failed framebuffer changing request.\n");
|
||||
@@ -169,12 +159,16 @@ static int exynos_drm_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int exynos_drm_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y,
|
||||
struct drm_framebuffer *old_fb)
|
||||
{
|
||||
return exynos_drm_crtc_mode_set_commit(crtc, x, y, old_fb);
|
||||
}
|
||||
|
||||
static void exynos_drm_crtc_disable(struct drm_crtc *crtc)
|
||||
{
|
||||
struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
exynos_plane_dpms(exynos_crtc->plane, DRM_MODE_DPMS_OFF);
|
||||
exynos_drm_crtc_dpms(crtc, DRM_MODE_DPMS_OFF);
|
||||
}
|
||||
@@ -199,8 +193,6 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc,
|
||||
struct drm_framebuffer *old_fb = crtc->fb;
|
||||
int ret = -EINVAL;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
/* when the page flip is requested, crtc's dpms should be on */
|
||||
if (exynos_crtc->dpms > DRM_MODE_DPMS_ON) {
|
||||
DRM_ERROR("failed page flip request.\n");
|
||||
@@ -230,7 +222,7 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc,
|
||||
spin_unlock_irq(&dev->event_lock);
|
||||
|
||||
crtc->fb = fb;
|
||||
ret = exynos_drm_crtc_mode_set_base(crtc, crtc->x, crtc->y,
|
||||
ret = exynos_drm_crtc_mode_set_commit(crtc, crtc->x, crtc->y,
|
||||
NULL);
|
||||
if (ret) {
|
||||
crtc->fb = old_fb;
|
||||
@@ -253,8 +245,6 @@ 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;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
private->crtc[exynos_crtc->pipe] = NULL;
|
||||
|
||||
drm_crtc_cleanup(crtc);
|
||||
@@ -269,8 +259,6 @@ static int exynos_drm_crtc_set_property(struct drm_crtc *crtc,
|
||||
struct exynos_drm_private *dev_priv = dev->dev_private;
|
||||
struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
if (property == dev_priv->crtc_mode_property) {
|
||||
enum exynos_crtc_mode mode = val;
|
||||
|
||||
@@ -315,8 +303,6 @@ static void exynos_drm_crtc_attach_mode_property(struct drm_crtc *crtc)
|
||||
struct exynos_drm_private *dev_priv = dev->dev_private;
|
||||
struct drm_property *prop;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
prop = dev_priv->crtc_mode_property;
|
||||
if (!prop) {
|
||||
prop = drm_property_create_enum(dev, 0, "mode", mode_names,
|
||||
@@ -336,8 +322,6 @@ int exynos_drm_crtc_create(struct drm_device *dev, unsigned int nr)
|
||||
struct exynos_drm_private *private = dev->dev_private;
|
||||
struct drm_crtc *crtc;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
exynos_crtc = kzalloc(sizeof(*exynos_crtc), GFP_KERNEL);
|
||||
if (!exynos_crtc) {
|
||||
DRM_ERROR("failed to allocate exynos crtc\n");
|
||||
@@ -372,8 +356,6 @@ int exynos_drm_crtc_enable_vblank(struct drm_device *dev, int crtc)
|
||||
struct exynos_drm_crtc *exynos_crtc =
|
||||
to_exynos_crtc(private->crtc[crtc]);
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
if (exynos_crtc->dpms != DRM_MODE_DPMS_ON)
|
||||
return -EPERM;
|
||||
|
||||
@@ -389,8 +371,6 @@ void exynos_drm_crtc_disable_vblank(struct drm_device *dev, int crtc)
|
||||
struct exynos_drm_crtc *exynos_crtc =
|
||||
to_exynos_crtc(private->crtc[crtc]);
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
if (exynos_crtc->dpms != DRM_MODE_DPMS_ON)
|
||||
return;
|
||||
|
||||
@@ -406,8 +386,6 @@ void exynos_drm_crtc_finish_pageflip(struct drm_device *dev, int crtc)
|
||||
struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(drm_crtc);
|
||||
unsigned long flags;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
spin_lock_irqsave(&dev->event_lock, flags);
|
||||
|
||||
list_for_each_entry_safe(e, t, &dev_priv->pageflip_event_list,
|
||||
|
@@ -71,8 +71,6 @@ static struct sg_table *
|
||||
unsigned int i;
|
||||
int nents, ret;
|
||||
|
||||
DRM_DEBUG_PRIME("%s\n", __FILE__);
|
||||
|
||||
/* just return current sgt if already requested. */
|
||||
if (exynos_attach->dir == dir && exynos_attach->is_mapped)
|
||||
return &exynos_attach->sgt;
|
||||
@@ -133,8 +131,6 @@ static void exynos_dmabuf_release(struct dma_buf *dmabuf)
|
||||
{
|
||||
struct exynos_drm_gem_obj *exynos_gem_obj = dmabuf->priv;
|
||||
|
||||
DRM_DEBUG_PRIME("%s\n", __FILE__);
|
||||
|
||||
/*
|
||||
* exynos_dmabuf_release() call means that file object's
|
||||
* f_count is 0 and it calls drm_gem_object_handle_unreference()
|
||||
@@ -219,8 +215,6 @@ struct drm_gem_object *exynos_dmabuf_prime_import(struct drm_device *drm_dev,
|
||||
struct exynos_drm_gem_buf *buffer;
|
||||
int ret;
|
||||
|
||||
DRM_DEBUG_PRIME("%s\n", __FILE__);
|
||||
|
||||
/* is this one of own objects? */
|
||||
if (dma_buf->ops == &exynos_dmabuf_ops) {
|
||||
struct drm_gem_object *obj;
|
||||
|
@@ -46,8 +46,6 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags)
|
||||
int ret;
|
||||
int nr;
|
||||
|
||||
DRM_DEBUG_DRIVER("%s\n", __FILE__);
|
||||
|
||||
private = kzalloc(sizeof(struct exynos_drm_private), GFP_KERNEL);
|
||||
if (!private) {
|
||||
DRM_ERROR("failed to allocate private\n");
|
||||
@@ -140,8 +138,6 @@ err_crtc:
|
||||
|
||||
static int exynos_drm_unload(struct drm_device *dev)
|
||||
{
|
||||
DRM_DEBUG_DRIVER("%s\n", __FILE__);
|
||||
|
||||
exynos_drm_fbdev_fini(dev);
|
||||
exynos_drm_device_unregister(dev);
|
||||
drm_vblank_cleanup(dev);
|
||||
@@ -160,8 +156,6 @@ static int exynos_drm_open(struct drm_device *dev, struct drm_file *file)
|
||||
{
|
||||
struct drm_exynos_file_private *file_priv;
|
||||
|
||||
DRM_DEBUG_DRIVER("%s\n", __FILE__);
|
||||
|
||||
file_priv = kzalloc(sizeof(*file_priv), GFP_KERNEL);
|
||||
if (!file_priv)
|
||||
return -ENOMEM;
|
||||
@@ -178,8 +172,6 @@ static void exynos_drm_preclose(struct drm_device *dev,
|
||||
struct drm_pending_vblank_event *e, *t;
|
||||
unsigned long flags;
|
||||
|
||||
DRM_DEBUG_DRIVER("%s\n", __FILE__);
|
||||
|
||||
/* release events of current file */
|
||||
spin_lock_irqsave(&dev->event_lock, flags);
|
||||
list_for_each_entry_safe(e, t, &private->pageflip_event_list,
|
||||
@@ -196,8 +188,6 @@ static void exynos_drm_preclose(struct drm_device *dev,
|
||||
|
||||
static void exynos_drm_postclose(struct drm_device *dev, struct drm_file *file)
|
||||
{
|
||||
DRM_DEBUG_DRIVER("%s\n", __FILE__);
|
||||
|
||||
if (!file->driver_priv)
|
||||
return;
|
||||
|
||||
@@ -207,8 +197,6 @@ static void exynos_drm_postclose(struct drm_device *dev, struct drm_file *file)
|
||||
|
||||
static void exynos_drm_lastclose(struct drm_device *dev)
|
||||
{
|
||||
DRM_DEBUG_DRIVER("%s\n", __FILE__);
|
||||
|
||||
exynos_drm_fbdev_restore_mode(dev);
|
||||
}
|
||||
|
||||
@@ -292,8 +280,6 @@ static struct drm_driver exynos_drm_driver = {
|
||||
|
||||
static int exynos_drm_platform_probe(struct platform_device *pdev)
|
||||
{
|
||||
DRM_DEBUG_DRIVER("%s\n", __FILE__);
|
||||
|
||||
pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
|
||||
exynos_drm_driver.num_ioctls = DRM_ARRAY_SIZE(exynos_ioctls);
|
||||
|
||||
@@ -302,8 +288,6 @@ static int exynos_drm_platform_probe(struct platform_device *pdev)
|
||||
|
||||
static int exynos_drm_platform_remove(struct platform_device *pdev)
|
||||
{
|
||||
DRM_DEBUG_DRIVER("%s\n", __FILE__);
|
||||
|
||||
drm_platform_exit(&exynos_drm_driver, pdev);
|
||||
|
||||
return 0;
|
||||
@@ -322,8 +306,6 @@ static int __init exynos_drm_init(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
DRM_DEBUG_DRIVER("%s\n", __FILE__);
|
||||
|
||||
#ifdef CONFIG_DRM_EXYNOS_FIMD
|
||||
ret = platform_driver_register(&fimd_driver);
|
||||
if (ret < 0)
|
||||
@@ -455,8 +437,6 @@ out_fimd:
|
||||
|
||||
static void __exit exynos_drm_exit(void)
|
||||
{
|
||||
DRM_DEBUG_DRIVER("%s\n", __FILE__);
|
||||
|
||||
platform_device_unregister(exynos_drm_pdev);
|
||||
|
||||
platform_driver_unregister(&exynos_drm_platform_driver);
|
||||
|
@@ -142,7 +142,7 @@ struct exynos_drm_overlay {
|
||||
* @is_connected: check for that display is connected or not.
|
||||
* @get_edid: get edid modes from display driver.
|
||||
* @get_panel: get panel object from display driver.
|
||||
* @check_timing: check if timing is valid or not.
|
||||
* @check_mode: check if mode is valid or not.
|
||||
* @power_on: display device on or off.
|
||||
*/
|
||||
struct exynos_drm_display_ops {
|
||||
@@ -151,7 +151,7 @@ struct exynos_drm_display_ops {
|
||||
struct edid *(*get_edid)(struct device *dev,
|
||||
struct drm_connector *connector);
|
||||
void *(*get_panel)(struct device *dev);
|
||||
int (*check_timing)(struct device *dev, void *timing);
|
||||
int (*check_mode)(struct device *dev, struct drm_display_mode *mode);
|
||||
int (*power_on)(struct device *dev, int mode);
|
||||
};
|
||||
|
||||
|
@@ -61,7 +61,7 @@ static void exynos_drm_encoder_dpms(struct drm_encoder *encoder, int mode)
|
||||
struct exynos_drm_manager_ops *manager_ops = manager->ops;
|
||||
struct exynos_drm_encoder *exynos_encoder = to_exynos_encoder(encoder);
|
||||
|
||||
DRM_DEBUG_KMS("%s, encoder dpms: %d\n", __FILE__, mode);
|
||||
DRM_DEBUG_KMS("encoder dpms: %d\n", mode);
|
||||
|
||||
if (exynos_encoder->dpms == mode) {
|
||||
DRM_DEBUG_KMS("desired dpms mode is same as previous one.\n");
|
||||
@@ -104,8 +104,6 @@ exynos_drm_encoder_mode_fixup(struct drm_encoder *encoder,
|
||||
struct exynos_drm_manager *manager = exynos_drm_get_manager(encoder);
|
||||
struct exynos_drm_manager_ops *manager_ops = manager->ops;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
|
||||
if (connector->encoder == encoder)
|
||||
if (manager_ops && manager_ops->mode_fixup)
|
||||
@@ -155,8 +153,6 @@ static void exynos_drm_encoder_mode_set(struct drm_encoder *encoder,
|
||||
struct exynos_drm_manager *manager;
|
||||
struct exynos_drm_manager_ops *manager_ops;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
|
||||
if (connector->encoder == encoder) {
|
||||
struct exynos_drm_encoder *exynos_encoder;
|
||||
@@ -189,8 +185,6 @@ static void exynos_drm_encoder_mode_set(struct drm_encoder *encoder,
|
||||
|
||||
static void exynos_drm_encoder_prepare(struct drm_encoder *encoder)
|
||||
{
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
/* drm framework doesn't check NULL. */
|
||||
}
|
||||
|
||||
@@ -200,8 +194,6 @@ static void exynos_drm_encoder_commit(struct drm_encoder *encoder)
|
||||
struct exynos_drm_manager *manager = exynos_encoder->manager;
|
||||
struct exynos_drm_manager_ops *manager_ops = manager->ops;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
if (manager_ops && manager_ops->commit)
|
||||
manager_ops->commit(manager->dev);
|
||||
|
||||
@@ -274,8 +266,6 @@ static void exynos_drm_encoder_destroy(struct drm_encoder *encoder)
|
||||
struct exynos_drm_encoder *exynos_encoder =
|
||||
to_exynos_encoder(encoder);
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
exynos_encoder->manager->pipe = -1;
|
||||
|
||||
drm_encoder_cleanup(encoder);
|
||||
@@ -315,8 +305,6 @@ void exynos_drm_encoder_setup(struct drm_device *dev)
|
||||
{
|
||||
struct drm_encoder *encoder;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
list_for_each_entry(encoder, &dev->mode_config.encoder_list, head)
|
||||
encoder->possible_clones = exynos_drm_encoder_clones(encoder);
|
||||
}
|
||||
@@ -329,8 +317,6 @@ exynos_drm_encoder_create(struct drm_device *dev,
|
||||
struct drm_encoder *encoder;
|
||||
struct exynos_drm_encoder *exynos_encoder;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
if (!manager || !possible_crtcs)
|
||||
return NULL;
|
||||
|
||||
@@ -427,8 +413,6 @@ void exynos_drm_encoder_crtc_dpms(struct drm_encoder *encoder, void *data)
|
||||
struct exynos_drm_manager_ops *manager_ops = manager->ops;
|
||||
int mode = *(int *)data;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
if (manager_ops && manager_ops->dpms)
|
||||
manager_ops->dpms(manager->dev, mode);
|
||||
|
||||
@@ -449,8 +433,6 @@ void exynos_drm_encoder_crtc_pipe(struct drm_encoder *encoder, void *data)
|
||||
to_exynos_encoder(encoder)->manager;
|
||||
int pipe = *(int *)data;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
/*
|
||||
* when crtc is detached from encoder, this pipe is used
|
||||
* to select manager operation
|
||||
@@ -465,8 +447,6 @@ void exynos_drm_encoder_plane_mode_set(struct drm_encoder *encoder, void *data)
|
||||
struct exynos_drm_overlay_ops *overlay_ops = manager->overlay_ops;
|
||||
struct exynos_drm_overlay *overlay = data;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
if (overlay_ops && overlay_ops->mode_set)
|
||||
overlay_ops->mode_set(manager->dev, overlay);
|
||||
}
|
||||
@@ -478,8 +458,6 @@ void exynos_drm_encoder_plane_commit(struct drm_encoder *encoder, void *data)
|
||||
struct exynos_drm_overlay_ops *overlay_ops = manager->overlay_ops;
|
||||
int zpos = DEFAULT_ZPOS;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
if (data)
|
||||
zpos = *(int *)data;
|
||||
|
||||
@@ -494,8 +472,6 @@ void exynos_drm_encoder_plane_enable(struct drm_encoder *encoder, void *data)
|
||||
struct exynos_drm_overlay_ops *overlay_ops = manager->overlay_ops;
|
||||
int zpos = DEFAULT_ZPOS;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
if (data)
|
||||
zpos = *(int *)data;
|
||||
|
||||
@@ -510,8 +486,6 @@ void exynos_drm_encoder_plane_disable(struct drm_encoder *encoder, void *data)
|
||||
struct exynos_drm_overlay_ops *overlay_ops = manager->overlay_ops;
|
||||
int zpos = DEFAULT_ZPOS;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
if (data)
|
||||
zpos = *(int *)data;
|
||||
|
||||
|
@@ -70,8 +70,6 @@ static void exynos_drm_fb_destroy(struct drm_framebuffer *fb)
|
||||
struct exynos_drm_fb *exynos_fb = to_exynos_fb(fb);
|
||||
unsigned int i;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
/* make sure that overlay data are updated before relesing fb. */
|
||||
exynos_drm_encoder_complete_scanout(fb);
|
||||
|
||||
@@ -97,8 +95,6 @@ static int exynos_drm_fb_create_handle(struct drm_framebuffer *fb,
|
||||
{
|
||||
struct exynos_drm_fb *exynos_fb = to_exynos_fb(fb);
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
/* This fb should have only one gem object. */
|
||||
if (WARN_ON(exynos_fb->buf_cnt != 1))
|
||||
return -EINVAL;
|
||||
@@ -112,8 +108,6 @@ static int exynos_drm_fb_dirty(struct drm_framebuffer *fb,
|
||||
unsigned color, struct drm_clip_rect *clips,
|
||||
unsigned num_clips)
|
||||
{
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
/* TODO */
|
||||
|
||||
return 0;
|
||||
@@ -225,8 +219,6 @@ exynos_user_fb_create(struct drm_device *dev, struct drm_file *file_priv,
|
||||
struct exynos_drm_fb *exynos_fb;
|
||||
int i, ret;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
exynos_fb = kzalloc(sizeof(*exynos_fb), GFP_KERNEL);
|
||||
if (!exynos_fb) {
|
||||
DRM_ERROR("failed to allocate exynos drm framebuffer\n");
|
||||
@@ -293,8 +285,6 @@ struct exynos_drm_gem_buf *exynos_drm_fb_buffer(struct drm_framebuffer *fb,
|
||||
struct exynos_drm_fb *exynos_fb = to_exynos_fb(fb);
|
||||
struct exynos_drm_gem_buf *buffer;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
if (index >= MAX_FB_BUFFER)
|
||||
return NULL;
|
||||
|
||||
|
@@ -43,8 +43,6 @@ static int exynos_drm_fb_mmap(struct fb_info *info,
|
||||
unsigned long vm_size;
|
||||
int ret;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
vma->vm_flags |= VM_IO | VM_DONTEXPAND | VM_DONTDUMP;
|
||||
|
||||
vm_size = vma->vm_end - vma->vm_start;
|
||||
@@ -84,8 +82,6 @@ static int exynos_drm_fbdev_update(struct drm_fb_helper *helper,
|
||||
unsigned int size = fb->width * fb->height * (fb->bits_per_pixel >> 3);
|
||||
unsigned long offset;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
drm_fb_helper_fill_fix(fbi, fb->pitches[0], fb->depth);
|
||||
drm_fb_helper_fill_var(fbi, helper, fb->width, fb->height);
|
||||
|
||||
@@ -148,8 +144,6 @@ static int exynos_drm_fbdev_create(struct drm_fb_helper *helper,
|
||||
unsigned long size;
|
||||
int ret;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
DRM_DEBUG_KMS("surface width(%d), height(%d) and bpp(%d\n",
|
||||
sizes->surface_width, sizes->surface_height,
|
||||
sizes->surface_bpp);
|
||||
@@ -238,8 +232,6 @@ int exynos_drm_fbdev_init(struct drm_device *dev)
|
||||
unsigned int num_crtc;
|
||||
int ret;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
if (!dev->mode_config.num_crtc || !dev->mode_config.num_connector)
|
||||
return 0;
|
||||
|
||||
|
@@ -175,8 +175,6 @@ static void fimc_sw_reset(struct fimc_context *ctx)
|
||||
{
|
||||
u32 cfg;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
/* stop dma operation */
|
||||
cfg = fimc_read(EXYNOS_CISTATUS);
|
||||
if (EXYNOS_CISTATUS_GET_ENVID_STATUS(cfg)) {
|
||||
@@ -210,8 +208,6 @@ static void fimc_sw_reset(struct fimc_context *ctx)
|
||||
|
||||
static int fimc_set_camblk_fimd0_wb(struct fimc_context *ctx)
|
||||
{
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
return regmap_update_bits(ctx->sysreg, SYSREG_CAMERA_BLK,
|
||||
SYSREG_FIMD0WB_DEST_MASK,
|
||||
ctx->id << SYSREG_FIMD0WB_DEST_SHIFT);
|
||||
@@ -221,7 +217,7 @@ static void fimc_set_type_ctrl(struct fimc_context *ctx, enum fimc_wb wb)
|
||||
{
|
||||
u32 cfg;
|
||||
|
||||
DRM_DEBUG_KMS("%s:wb[%d]\n", __func__, wb);
|
||||
DRM_DEBUG_KMS("wb[%d]\n", wb);
|
||||
|
||||
cfg = fimc_read(EXYNOS_CIGCTRL);
|
||||
cfg &= ~(EXYNOS_CIGCTRL_TESTPATTERN_MASK |
|
||||
@@ -257,10 +253,10 @@ static void fimc_set_polarity(struct fimc_context *ctx,
|
||||
{
|
||||
u32 cfg;
|
||||
|
||||
DRM_DEBUG_KMS("%s:inv_pclk[%d]inv_vsync[%d]\n",
|
||||
__func__, pol->inv_pclk, pol->inv_vsync);
|
||||
DRM_DEBUG_KMS("%s:inv_href[%d]inv_hsync[%d]\n",
|
||||
__func__, pol->inv_href, pol->inv_hsync);
|
||||
DRM_DEBUG_KMS("inv_pclk[%d]inv_vsync[%d]\n",
|
||||
pol->inv_pclk, pol->inv_vsync);
|
||||
DRM_DEBUG_KMS("inv_href[%d]inv_hsync[%d]\n",
|
||||
pol->inv_href, pol->inv_hsync);
|
||||
|
||||
cfg = fimc_read(EXYNOS_CIGCTRL);
|
||||
cfg &= ~(EXYNOS_CIGCTRL_INVPOLPCLK | EXYNOS_CIGCTRL_INVPOLVSYNC |
|
||||
@@ -282,7 +278,7 @@ static void fimc_handle_jpeg(struct fimc_context *ctx, bool enable)
|
||||
{
|
||||
u32 cfg;
|
||||
|
||||
DRM_DEBUG_KMS("%s:enable[%d]\n", __func__, enable);
|
||||
DRM_DEBUG_KMS("enable[%d]\n", enable);
|
||||
|
||||
cfg = fimc_read(EXYNOS_CIGCTRL);
|
||||
if (enable)
|
||||
@@ -298,7 +294,7 @@ static void fimc_handle_irq(struct fimc_context *ctx, bool enable,
|
||||
{
|
||||
u32 cfg;
|
||||
|
||||
DRM_DEBUG_KMS("%s:enable[%d]overflow[%d]level[%d]\n", __func__,
|
||||
DRM_DEBUG_KMS("enable[%d]overflow[%d]level[%d]\n",
|
||||
enable, overflow, level);
|
||||
|
||||
cfg = fimc_read(EXYNOS_CIGCTRL);
|
||||
@@ -319,8 +315,6 @@ static void fimc_clear_irq(struct fimc_context *ctx)
|
||||
{
|
||||
u32 cfg;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
cfg = fimc_read(EXYNOS_CIGCTRL);
|
||||
cfg |= EXYNOS_CIGCTRL_IRQ_CLR;
|
||||
fimc_write(cfg, EXYNOS_CIGCTRL);
|
||||
@@ -335,7 +329,7 @@ static bool fimc_check_ovf(struct fimc_context *ctx)
|
||||
flag = EXYNOS_CISTATUS_OVFIY | EXYNOS_CISTATUS_OVFICB |
|
||||
EXYNOS_CISTATUS_OVFICR;
|
||||
|
||||
DRM_DEBUG_KMS("%s:flag[0x%x]\n", __func__, flag);
|
||||
DRM_DEBUG_KMS("flag[0x%x]\n", flag);
|
||||
|
||||
if (status & flag) {
|
||||
cfg = fimc_read(EXYNOS_CIWDOFST);
|
||||
@@ -364,7 +358,7 @@ static bool fimc_check_frame_end(struct fimc_context *ctx)
|
||||
|
||||
cfg = fimc_read(EXYNOS_CISTATUS);
|
||||
|
||||
DRM_DEBUG_KMS("%s:cfg[0x%x]\n", __func__, cfg);
|
||||
DRM_DEBUG_KMS("cfg[0x%x]\n", cfg);
|
||||
|
||||
if (!(cfg & EXYNOS_CISTATUS_FRAMEEND))
|
||||
return false;
|
||||
@@ -380,15 +374,13 @@ static int fimc_get_buf_id(struct fimc_context *ctx)
|
||||
u32 cfg;
|
||||
int frame_cnt, buf_id;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
cfg = fimc_read(EXYNOS_CISTATUS2);
|
||||
frame_cnt = EXYNOS_CISTATUS2_GET_FRAMECOUNT_BEFORE(cfg);
|
||||
|
||||
if (frame_cnt == 0)
|
||||
frame_cnt = EXYNOS_CISTATUS2_GET_FRAMECOUNT_PRESENT(cfg);
|
||||
|
||||
DRM_DEBUG_KMS("%s:present[%d]before[%d]\n", __func__,
|
||||
DRM_DEBUG_KMS("present[%d]before[%d]\n",
|
||||
EXYNOS_CISTATUS2_GET_FRAMECOUNT_PRESENT(cfg),
|
||||
EXYNOS_CISTATUS2_GET_FRAMECOUNT_BEFORE(cfg));
|
||||
|
||||
@@ -398,7 +390,7 @@ static int fimc_get_buf_id(struct fimc_context *ctx)
|
||||
}
|
||||
|
||||
buf_id = frame_cnt - 1;
|
||||
DRM_DEBUG_KMS("%s:buf_id[%d]\n", __func__, buf_id);
|
||||
DRM_DEBUG_KMS("buf_id[%d]\n", buf_id);
|
||||
|
||||
return buf_id;
|
||||
}
|
||||
@@ -407,7 +399,7 @@ static void fimc_handle_lastend(struct fimc_context *ctx, bool enable)
|
||||
{
|
||||
u32 cfg;
|
||||
|
||||
DRM_DEBUG_KMS("%s:enable[%d]\n", __func__, enable);
|
||||
DRM_DEBUG_KMS("enable[%d]\n", enable);
|
||||
|
||||
cfg = fimc_read(EXYNOS_CIOCTRL);
|
||||
if (enable)
|
||||
@@ -424,7 +416,7 @@ static int fimc_src_set_fmt_order(struct fimc_context *ctx, u32 fmt)
|
||||
struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
|
||||
u32 cfg;
|
||||
|
||||
DRM_DEBUG_KMS("%s:fmt[0x%x]\n", __func__, fmt);
|
||||
DRM_DEBUG_KMS("fmt[0x%x]\n", fmt);
|
||||
|
||||
/* RGB */
|
||||
cfg = fimc_read(EXYNOS_CISCCTRL);
|
||||
@@ -497,7 +489,7 @@ static int fimc_src_set_fmt(struct device *dev, u32 fmt)
|
||||
struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
|
||||
u32 cfg;
|
||||
|
||||
DRM_DEBUG_KMS("%s:fmt[0x%x]\n", __func__, fmt);
|
||||
DRM_DEBUG_KMS("fmt[0x%x]\n", fmt);
|
||||
|
||||
cfg = fimc_read(EXYNOS_MSCTRL);
|
||||
cfg &= ~EXYNOS_MSCTRL_INFORMAT_RGB;
|
||||
@@ -557,8 +549,7 @@ static int fimc_src_set_transf(struct device *dev,
|
||||
struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
|
||||
u32 cfg1, cfg2;
|
||||
|
||||
DRM_DEBUG_KMS("%s:degree[%d]flip[0x%x]\n", __func__,
|
||||
degree, flip);
|
||||
DRM_DEBUG_KMS("degree[%d]flip[0x%x]\n", degree, flip);
|
||||
|
||||
cfg1 = fimc_read(EXYNOS_MSCTRL);
|
||||
cfg1 &= ~(EXYNOS_MSCTRL_FLIP_X_MIRROR |
|
||||
@@ -621,10 +612,9 @@ static int fimc_set_window(struct fimc_context *ctx,
|
||||
v1 = pos->y;
|
||||
v2 = sz->vsize - pos->h - pos->y;
|
||||
|
||||
DRM_DEBUG_KMS("%s:x[%d]y[%d]w[%d]h[%d]hsize[%d]vsize[%d]\n",
|
||||
__func__, pos->x, pos->y, pos->w, pos->h, sz->hsize, sz->vsize);
|
||||
DRM_DEBUG_KMS("%s:h1[%d]h2[%d]v1[%d]v2[%d]\n", __func__,
|
||||
h1, h2, v1, v2);
|
||||
DRM_DEBUG_KMS("x[%d]y[%d]w[%d]h[%d]hsize[%d]vsize[%d]\n",
|
||||
pos->x, pos->y, pos->w, pos->h, sz->hsize, sz->vsize);
|
||||
DRM_DEBUG_KMS("h1[%d]h2[%d]v1[%d]v2[%d]\n", h1, h2, v1, v2);
|
||||
|
||||
/*
|
||||
* set window offset 1, 2 size
|
||||
@@ -653,8 +643,8 @@ static int fimc_src_set_size(struct device *dev, int swap,
|
||||
struct drm_exynos_sz img_sz = *sz;
|
||||
u32 cfg;
|
||||
|
||||
DRM_DEBUG_KMS("%s:swap[%d]hsize[%d]vsize[%d]\n",
|
||||
__func__, swap, sz->hsize, sz->vsize);
|
||||
DRM_DEBUG_KMS("swap[%d]hsize[%d]vsize[%d]\n",
|
||||
swap, sz->hsize, sz->vsize);
|
||||
|
||||
/* original size */
|
||||
cfg = (EXYNOS_ORGISIZE_HORIZONTAL(img_sz.hsize) |
|
||||
@@ -662,8 +652,7 @@ static int fimc_src_set_size(struct device *dev, int swap,
|
||||
|
||||
fimc_write(cfg, EXYNOS_ORGISIZE);
|
||||
|
||||
DRM_DEBUG_KMS("%s:x[%d]y[%d]w[%d]h[%d]\n", __func__,
|
||||
pos->x, pos->y, pos->w, pos->h);
|
||||
DRM_DEBUG_KMS("x[%d]y[%d]w[%d]h[%d]\n", pos->x, pos->y, pos->w, pos->h);
|
||||
|
||||
if (swap) {
|
||||
img_pos.w = pos->h;
|
||||
@@ -720,7 +709,7 @@ static int fimc_src_set_addr(struct device *dev,
|
||||
|
||||
property = &c_node->property;
|
||||
|
||||
DRM_DEBUG_KMS("%s:prop_id[%d]buf_id[%d]buf_type[%d]\n", __func__,
|
||||
DRM_DEBUG_KMS("prop_id[%d]buf_id[%d]buf_type[%d]\n",
|
||||
property->prop_id, buf_id, buf_type);
|
||||
|
||||
if (buf_id > FIMC_MAX_SRC) {
|
||||
@@ -772,7 +761,7 @@ static int fimc_dst_set_fmt_order(struct fimc_context *ctx, u32 fmt)
|
||||
struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
|
||||
u32 cfg;
|
||||
|
||||
DRM_DEBUG_KMS("%s:fmt[0x%x]\n", __func__, fmt);
|
||||
DRM_DEBUG_KMS("fmt[0x%x]\n", fmt);
|
||||
|
||||
/* RGB */
|
||||
cfg = fimc_read(EXYNOS_CISCCTRL);
|
||||
@@ -851,7 +840,7 @@ static int fimc_dst_set_fmt(struct device *dev, u32 fmt)
|
||||
struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
|
||||
u32 cfg;
|
||||
|
||||
DRM_DEBUG_KMS("%s:fmt[0x%x]\n", __func__, fmt);
|
||||
DRM_DEBUG_KMS("fmt[0x%x]\n", fmt);
|
||||
|
||||
cfg = fimc_read(EXYNOS_CIEXTEN);
|
||||
|
||||
@@ -919,8 +908,7 @@ static int fimc_dst_set_transf(struct device *dev,
|
||||
struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
|
||||
u32 cfg;
|
||||
|
||||
DRM_DEBUG_KMS("%s:degree[%d]flip[0x%x]\n", __func__,
|
||||
degree, flip);
|
||||
DRM_DEBUG_KMS("degree[%d]flip[0x%x]\n", degree, flip);
|
||||
|
||||
cfg = fimc_read(EXYNOS_CITRGFMT);
|
||||
cfg &= ~EXYNOS_CITRGFMT_FLIP_MASK;
|
||||
@@ -970,7 +958,7 @@ static int fimc_dst_set_transf(struct device *dev,
|
||||
|
||||
static int fimc_get_ratio_shift(u32 src, u32 dst, u32 *ratio, u32 *shift)
|
||||
{
|
||||
DRM_DEBUG_KMS("%s:src[%d]dst[%d]\n", __func__, src, dst);
|
||||
DRM_DEBUG_KMS("src[%d]dst[%d]\n", src, dst);
|
||||
|
||||
if (src >= dst * 64) {
|
||||
DRM_ERROR("failed to make ratio and shift.\n");
|
||||
@@ -1039,20 +1027,20 @@ static int fimc_set_prescaler(struct fimc_context *ctx, struct fimc_scaler *sc,
|
||||
|
||||
pre_dst_width = src_w / pre_hratio;
|
||||
pre_dst_height = src_h / pre_vratio;
|
||||
DRM_DEBUG_KMS("%s:pre_dst_width[%d]pre_dst_height[%d]\n", __func__,
|
||||
DRM_DEBUG_KMS("pre_dst_width[%d]pre_dst_height[%d]\n",
|
||||
pre_dst_width, pre_dst_height);
|
||||
DRM_DEBUG_KMS("%s:pre_hratio[%d]hfactor[%d]pre_vratio[%d]vfactor[%d]\n",
|
||||
__func__, pre_hratio, hfactor, pre_vratio, vfactor);
|
||||
DRM_DEBUG_KMS("pre_hratio[%d]hfactor[%d]pre_vratio[%d]vfactor[%d]\n",
|
||||
pre_hratio, hfactor, pre_vratio, vfactor);
|
||||
|
||||
sc->hratio = (src_w << 14) / (dst_w << hfactor);
|
||||
sc->vratio = (src_h << 14) / (dst_h << vfactor);
|
||||
sc->up_h = (dst_w >= src_w) ? true : false;
|
||||
sc->up_v = (dst_h >= src_h) ? true : false;
|
||||
DRM_DEBUG_KMS("%s:hratio[%d]vratio[%d]up_h[%d]up_v[%d]\n",
|
||||
__func__, sc->hratio, sc->vratio, sc->up_h, sc->up_v);
|
||||
DRM_DEBUG_KMS("hratio[%d]vratio[%d]up_h[%d]up_v[%d]\n",
|
||||
sc->hratio, sc->vratio, sc->up_h, sc->up_v);
|
||||
|
||||
shfactor = FIMC_SHFACTOR - (hfactor + vfactor);
|
||||
DRM_DEBUG_KMS("%s:shfactor[%d]\n", __func__, shfactor);
|
||||
DRM_DEBUG_KMS("shfactor[%d]\n", shfactor);
|
||||
|
||||
cfg = (EXYNOS_CISCPRERATIO_SHFACTOR(shfactor) |
|
||||
EXYNOS_CISCPRERATIO_PREHORRATIO(pre_hratio) |
|
||||
@@ -1070,10 +1058,10 @@ static void fimc_set_scaler(struct fimc_context *ctx, struct fimc_scaler *sc)
|
||||
{
|
||||
u32 cfg, cfg_ext;
|
||||
|
||||
DRM_DEBUG_KMS("%s:range[%d]bypass[%d]up_h[%d]up_v[%d]\n",
|
||||
__func__, sc->range, sc->bypass, sc->up_h, sc->up_v);
|
||||
DRM_DEBUG_KMS("%s:hratio[%d]vratio[%d]\n",
|
||||
__func__, sc->hratio, sc->vratio);
|
||||
DRM_DEBUG_KMS("range[%d]bypass[%d]up_h[%d]up_v[%d]\n",
|
||||
sc->range, sc->bypass, sc->up_h, sc->up_v);
|
||||
DRM_DEBUG_KMS("hratio[%d]vratio[%d]\n",
|
||||
sc->hratio, sc->vratio);
|
||||
|
||||
cfg = fimc_read(EXYNOS_CISCCTRL);
|
||||
cfg &= ~(EXYNOS_CISCCTRL_SCALERBYPASS |
|
||||
@@ -1113,8 +1101,8 @@ static int fimc_dst_set_size(struct device *dev, int swap,
|
||||
struct drm_exynos_sz img_sz = *sz;
|
||||
u32 cfg;
|
||||
|
||||
DRM_DEBUG_KMS("%s:swap[%d]hsize[%d]vsize[%d]\n",
|
||||
__func__, swap, sz->hsize, sz->vsize);
|
||||
DRM_DEBUG_KMS("swap[%d]hsize[%d]vsize[%d]\n",
|
||||
swap, sz->hsize, sz->vsize);
|
||||
|
||||
/* original size */
|
||||
cfg = (EXYNOS_ORGOSIZE_HORIZONTAL(img_sz.hsize) |
|
||||
@@ -1122,8 +1110,7 @@ static int fimc_dst_set_size(struct device *dev, int swap,
|
||||
|
||||
fimc_write(cfg, EXYNOS_ORGOSIZE);
|
||||
|
||||
DRM_DEBUG_KMS("%s:x[%d]y[%d]w[%d]h[%d]\n",
|
||||
__func__, pos->x, pos->y, pos->w, pos->h);
|
||||
DRM_DEBUG_KMS("x[%d]y[%d]w[%d]h[%d]\n", pos->x, pos->y, pos->w, pos->h);
|
||||
|
||||
/* CSC ITU */
|
||||
cfg = fimc_read(EXYNOS_CIGCTRL);
|
||||
@@ -1180,7 +1167,7 @@ static int fimc_dst_get_buf_seq(struct fimc_context *ctx)
|
||||
if (cfg & (mask << i))
|
||||
buf_num++;
|
||||
|
||||
DRM_DEBUG_KMS("%s:buf_num[%d]\n", __func__, buf_num);
|
||||
DRM_DEBUG_KMS("buf_num[%d]\n", buf_num);
|
||||
|
||||
return buf_num;
|
||||
}
|
||||
@@ -1194,8 +1181,7 @@ static int fimc_dst_set_buf_seq(struct fimc_context *ctx, u32 buf_id,
|
||||
u32 mask = 0x00000001 << buf_id;
|
||||
int ret = 0;
|
||||
|
||||
DRM_DEBUG_KMS("%s:buf_id[%d]buf_type[%d]\n", __func__,
|
||||
buf_id, buf_type);
|
||||
DRM_DEBUG_KMS("buf_id[%d]buf_type[%d]\n", buf_id, buf_type);
|
||||
|
||||
mutex_lock(&ctx->lock);
|
||||
|
||||
@@ -1252,7 +1238,7 @@ static int fimc_dst_set_addr(struct device *dev,
|
||||
|
||||
property = &c_node->property;
|
||||
|
||||
DRM_DEBUG_KMS("%s:prop_id[%d]buf_id[%d]buf_type[%d]\n", __func__,
|
||||
DRM_DEBUG_KMS("prop_id[%d]buf_id[%d]buf_type[%d]\n",
|
||||
property->prop_id, buf_id, buf_type);
|
||||
|
||||
if (buf_id > FIMC_MAX_DST) {
|
||||
@@ -1302,7 +1288,7 @@ static struct exynos_drm_ipp_ops fimc_dst_ops = {
|
||||
|
||||
static int fimc_clk_ctrl(struct fimc_context *ctx, bool enable)
|
||||
{
|
||||
DRM_DEBUG_KMS("%s:enable[%d]\n", __func__, enable);
|
||||
DRM_DEBUG_KMS("enable[%d]\n", enable);
|
||||
|
||||
if (enable) {
|
||||
clk_prepare_enable(ctx->clocks[FIMC_CLK_GATE]);
|
||||
@@ -1326,7 +1312,7 @@ static irqreturn_t fimc_irq_handler(int irq, void *dev_id)
|
||||
c_node->event_work;
|
||||
int buf_id;
|
||||
|
||||
DRM_DEBUG_KMS("%s:fimc id[%d]\n", __func__, ctx->id);
|
||||
DRM_DEBUG_KMS("fimc id[%d]\n", ctx->id);
|
||||
|
||||
fimc_clear_irq(ctx);
|
||||
if (fimc_check_ovf(ctx))
|
||||
@@ -1339,7 +1325,7 @@ static irqreturn_t fimc_irq_handler(int irq, void *dev_id)
|
||||
if (buf_id < 0)
|
||||
return IRQ_HANDLED;
|
||||
|
||||
DRM_DEBUG_KMS("%s:buf_id[%d]\n", __func__, buf_id);
|
||||
DRM_DEBUG_KMS("buf_id[%d]\n", buf_id);
|
||||
|
||||
if (fimc_dst_set_buf_seq(ctx, buf_id, IPP_BUF_DEQUEUE) < 0) {
|
||||
DRM_ERROR("failed to dequeue.\n");
|
||||
@@ -1357,8 +1343,6 @@ static int fimc_init_prop_list(struct exynos_drm_ippdrv *ippdrv)
|
||||
{
|
||||
struct drm_exynos_ipp_prop_list *prop_list;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
prop_list = devm_kzalloc(ippdrv->dev, sizeof(*prop_list), GFP_KERNEL);
|
||||
if (!prop_list) {
|
||||
DRM_ERROR("failed to alloc property list.\n");
|
||||
@@ -1402,7 +1386,7 @@ static inline bool fimc_check_drm_flip(enum drm_exynos_flip flip)
|
||||
case EXYNOS_DRM_FLIP_BOTH:
|
||||
return true;
|
||||
default:
|
||||
DRM_DEBUG_KMS("%s:invalid flip\n", __func__);
|
||||
DRM_DEBUG_KMS("invalid flip\n");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1419,8 +1403,6 @@ static int fimc_ippdrv_check_property(struct device *dev,
|
||||
bool swap;
|
||||
int i;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
for_each_ipp_ops(i) {
|
||||
if ((i == EXYNOS_DRM_OPS_SRC) &&
|
||||
(property->cmd == IPP_CMD_WB))
|
||||
@@ -1526,8 +1508,6 @@ static void fimc_clear_addr(struct fimc_context *ctx)
|
||||
{
|
||||
int i;
|
||||
|
||||
DRM_DEBUG_KMS("%s:\n", __func__);
|
||||
|
||||
for (i = 0; i < FIMC_MAX_SRC; i++) {
|
||||
fimc_write(0, EXYNOS_CIIYSA(i));
|
||||
fimc_write(0, EXYNOS_CIICBSA(i));
|
||||
@@ -1545,8 +1525,6 @@ static int fimc_ippdrv_reset(struct device *dev)
|
||||
{
|
||||
struct fimc_context *ctx = get_fimc_context(dev);
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
/* reset h/w block */
|
||||
fimc_sw_reset(ctx);
|
||||
|
||||
@@ -1570,7 +1548,7 @@ static int fimc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd)
|
||||
int ret, i;
|
||||
u32 cfg0, cfg1;
|
||||
|
||||
DRM_DEBUG_KMS("%s:cmd[%d]\n", __func__, cmd);
|
||||
DRM_DEBUG_KMS("cmd[%d]\n", cmd);
|
||||
|
||||
if (!c_node) {
|
||||
DRM_ERROR("failed to get c_node.\n");
|
||||
@@ -1679,7 +1657,7 @@ static void fimc_ippdrv_stop(struct device *dev, enum drm_exynos_ipp_cmd cmd)
|
||||
struct drm_exynos_ipp_set_wb set_wb = {0, 0};
|
||||
u32 cfg;
|
||||
|
||||
DRM_DEBUG_KMS("%s:cmd[%d]\n", __func__, cmd);
|
||||
DRM_DEBUG_KMS("cmd[%d]\n", cmd);
|
||||
|
||||
switch (cmd) {
|
||||
case IPP_CMD_M2M:
|
||||
@@ -1869,8 +1847,7 @@ static int fimc_probe(struct platform_device *pdev)
|
||||
goto err_put_clk;
|
||||
}
|
||||
|
||||
DRM_DEBUG_KMS("%s:id[%d]ippdrv[0x%x]\n", __func__, ctx->id,
|
||||
(int)ippdrv);
|
||||
DRM_DEBUG_KMS("id[%d]ippdrv[0x%x]\n", ctx->id, (int)ippdrv);
|
||||
|
||||
mutex_init(&ctx->lock);
|
||||
platform_set_drvdata(pdev, ctx);
|
||||
@@ -1917,7 +1894,7 @@ static int fimc_suspend(struct device *dev)
|
||||
{
|
||||
struct fimc_context *ctx = get_fimc_context(dev);
|
||||
|
||||
DRM_DEBUG_KMS("%s:id[%d]\n", __func__, ctx->id);
|
||||
DRM_DEBUG_KMS("id[%d]\n", ctx->id);
|
||||
|
||||
if (pm_runtime_suspended(dev))
|
||||
return 0;
|
||||
@@ -1929,7 +1906,7 @@ static int fimc_resume(struct device *dev)
|
||||
{
|
||||
struct fimc_context *ctx = get_fimc_context(dev);
|
||||
|
||||
DRM_DEBUG_KMS("%s:id[%d]\n", __func__, ctx->id);
|
||||
DRM_DEBUG_KMS("id[%d]\n", ctx->id);
|
||||
|
||||
if (!pm_runtime_suspended(dev))
|
||||
return fimc_clk_ctrl(ctx, true);
|
||||
@@ -1943,7 +1920,7 @@ static int fimc_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct fimc_context *ctx = get_fimc_context(dev);
|
||||
|
||||
DRM_DEBUG_KMS("%s:id[%d]\n", __func__, ctx->id);
|
||||
DRM_DEBUG_KMS("id[%d]\n", ctx->id);
|
||||
|
||||
return fimc_clk_ctrl(ctx, false);
|
||||
}
|
||||
@@ -1952,7 +1929,7 @@ static int fimc_runtime_resume(struct device *dev)
|
||||
{
|
||||
struct fimc_context *ctx = get_fimc_context(dev);
|
||||
|
||||
DRM_DEBUG_KMS("%s:id[%d]\n", __func__, ctx->id);
|
||||
DRM_DEBUG_KMS("id[%d]\n", ctx->id);
|
||||
|
||||
return fimc_clk_ctrl(ctx, true);
|
||||
}
|
||||
|
@@ -63,14 +63,24 @@
|
||||
|
||||
struct fimd_driver_data {
|
||||
unsigned int timing_base;
|
||||
|
||||
unsigned int has_shadowcon:1;
|
||||
unsigned int has_clksel:1;
|
||||
};
|
||||
|
||||
static struct fimd_driver_data s3c64xx_fimd_driver_data = {
|
||||
.timing_base = 0x0,
|
||||
.has_clksel = 1,
|
||||
};
|
||||
|
||||
static struct fimd_driver_data exynos4_fimd_driver_data = {
|
||||
.timing_base = 0x0,
|
||||
.has_shadowcon = 1,
|
||||
};
|
||||
|
||||
static struct fimd_driver_data exynos5_fimd_driver_data = {
|
||||
.timing_base = 0x20000,
|
||||
.has_shadowcon = 1,
|
||||
};
|
||||
|
||||
struct fimd_win_data {
|
||||
@@ -107,10 +117,13 @@ struct fimd_context {
|
||||
atomic_t wait_vsync_event;
|
||||
|
||||
struct exynos_drm_panel_info *panel;
|
||||
struct fimd_driver_data *driver_data;
|
||||
};
|
||||
|
||||
#ifdef CONFIG_OF
|
||||
static const struct of_device_id fimd_driver_dt_match[] = {
|
||||
{ .compatible = "samsung,s3c6400-fimd",
|
||||
.data = &s3c64xx_fimd_driver_data },
|
||||
{ .compatible = "samsung,exynos4210-fimd",
|
||||
.data = &exynos4_fimd_driver_data },
|
||||
{ .compatible = "samsung,exynos5250-fimd",
|
||||
@@ -137,8 +150,6 @@ static inline struct fimd_driver_data *drm_fimd_get_driver_data(
|
||||
|
||||
static bool fimd_display_is_connected(struct device *dev)
|
||||
{
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
/* TODO. */
|
||||
|
||||
return true;
|
||||
@@ -148,15 +159,11 @@ static void *fimd_get_panel(struct device *dev)
|
||||
{
|
||||
struct fimd_context *ctx = get_fimd_context(dev);
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
return ctx->panel;
|
||||
}
|
||||
|
||||
static int fimd_check_timing(struct device *dev, void *timing)
|
||||
static int fimd_check_mode(struct device *dev, struct drm_display_mode *mode)
|
||||
{
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
/* TODO. */
|
||||
|
||||
return 0;
|
||||
@@ -164,8 +171,6 @@ static int fimd_check_timing(struct device *dev, void *timing)
|
||||
|
||||
static int fimd_display_power_on(struct device *dev, int mode)
|
||||
{
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
/* TODO */
|
||||
|
||||
return 0;
|
||||
@@ -175,7 +180,7 @@ static struct exynos_drm_display_ops fimd_display_ops = {
|
||||
.type = EXYNOS_DISPLAY_TYPE_LCD,
|
||||
.is_connected = fimd_display_is_connected,
|
||||
.get_panel = fimd_get_panel,
|
||||
.check_timing = fimd_check_timing,
|
||||
.check_mode = fimd_check_mode,
|
||||
.power_on = fimd_display_power_on,
|
||||
};
|
||||
|
||||
@@ -183,7 +188,7 @@ static void fimd_dpms(struct device *subdrv_dev, int mode)
|
||||
{
|
||||
struct fimd_context *ctx = get_fimd_context(subdrv_dev);
|
||||
|
||||
DRM_DEBUG_KMS("%s, %d\n", __FILE__, mode);
|
||||
DRM_DEBUG_KMS("%d\n", mode);
|
||||
|
||||
mutex_lock(&ctx->lock);
|
||||
|
||||
@@ -221,8 +226,6 @@ static void fimd_apply(struct device *subdrv_dev)
|
||||
struct fimd_win_data *win_data;
|
||||
int i;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
for (i = 0; i < WINDOWS_NR; i++) {
|
||||
win_data = &ctx->win_data[i];
|
||||
if (win_data->enabled && (ovl_ops && ovl_ops->commit))
|
||||
@@ -239,15 +242,12 @@ static void fimd_commit(struct device *dev)
|
||||
struct exynos_drm_panel_info *panel = ctx->panel;
|
||||
struct fb_videomode *timing = &panel->timing;
|
||||
struct fimd_driver_data *driver_data;
|
||||
struct platform_device *pdev = to_platform_device(dev);
|
||||
u32 val;
|
||||
|
||||
driver_data = drm_fimd_get_driver_data(pdev);
|
||||
driver_data = ctx->driver_data;
|
||||
if (ctx->suspended)
|
||||
return;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
/* setup polarity values from machine code. */
|
||||
writel(ctx->vidcon1, ctx->regs + driver_data->timing_base + VIDCON1);
|
||||
|
||||
@@ -274,6 +274,11 @@ static void fimd_commit(struct device *dev)
|
||||
val = ctx->vidcon0;
|
||||
val &= ~(VIDCON0_CLKVAL_F_MASK | VIDCON0_CLKDIR);
|
||||
|
||||
if (ctx->driver_data->has_clksel) {
|
||||
val &= ~VIDCON0_CLKSEL_MASK;
|
||||
val |= VIDCON0_CLKSEL_LCD;
|
||||
}
|
||||
|
||||
if (ctx->clkdiv > 1)
|
||||
val |= VIDCON0_CLKVAL_F(ctx->clkdiv - 1) | VIDCON0_CLKDIR;
|
||||
else
|
||||
@@ -292,8 +297,6 @@ static int fimd_enable_vblank(struct device *dev)
|
||||
struct fimd_context *ctx = get_fimd_context(dev);
|
||||
u32 val;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
if (ctx->suspended)
|
||||
return -EPERM;
|
||||
|
||||
@@ -319,8 +322,6 @@ static void fimd_disable_vblank(struct device *dev)
|
||||
struct fimd_context *ctx = get_fimd_context(dev);
|
||||
u32 val;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
if (ctx->suspended)
|
||||
return;
|
||||
|
||||
@@ -370,8 +371,6 @@ static void fimd_win_mode_set(struct device *dev,
|
||||
int win;
|
||||
unsigned long offset;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
if (!overlay) {
|
||||
dev_err(dev, "overlay is NULL\n");
|
||||
return;
|
||||
@@ -381,7 +380,7 @@ static void fimd_win_mode_set(struct device *dev,
|
||||
if (win == DEFAULT_ZPOS)
|
||||
win = ctx->default_win;
|
||||
|
||||
if (win < 0 || win > WINDOWS_NR)
|
||||
if (win < 0 || win >= WINDOWS_NR)
|
||||
return;
|
||||
|
||||
offset = overlay->fb_x * (overlay->bpp >> 3);
|
||||
@@ -418,8 +417,6 @@ static void fimd_win_set_pixfmt(struct device *dev, unsigned int win)
|
||||
struct fimd_win_data *win_data = &ctx->win_data[win];
|
||||
unsigned long val;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
val = WINCONx_ENWIN;
|
||||
|
||||
switch (win_data->bpp) {
|
||||
@@ -478,8 +475,6 @@ static void fimd_win_set_colkey(struct device *dev, unsigned int win)
|
||||
struct fimd_context *ctx = get_fimd_context(dev);
|
||||
unsigned int keycon0 = 0, keycon1 = 0;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
keycon0 = ~(WxKEYCON0_KEYBL_EN | WxKEYCON0_KEYEN_F |
|
||||
WxKEYCON0_DIRCON) | WxKEYCON0_COMPKEY(0);
|
||||
|
||||
@@ -489,6 +484,33 @@ static void fimd_win_set_colkey(struct device *dev, unsigned int win)
|
||||
writel(keycon1, ctx->regs + WKEYCON1_BASE(win));
|
||||
}
|
||||
|
||||
/**
|
||||
* shadow_protect_win() - disable updating values from shadow registers at vsync
|
||||
*
|
||||
* @win: window to protect registers for
|
||||
* @protect: 1 to protect (disable updates)
|
||||
*/
|
||||
static void fimd_shadow_protect_win(struct fimd_context *ctx,
|
||||
int win, bool protect)
|
||||
{
|
||||
u32 reg, bits, val;
|
||||
|
||||
if (ctx->driver_data->has_shadowcon) {
|
||||
reg = SHADOWCON;
|
||||
bits = SHADOWCON_WINx_PROTECT(win);
|
||||
} else {
|
||||
reg = PRTCON;
|
||||
bits = PRTCON_PROTECT;
|
||||
}
|
||||
|
||||
val = readl(ctx->regs + reg);
|
||||
if (protect)
|
||||
val |= bits;
|
||||
else
|
||||
val &= ~bits;
|
||||
writel(val, ctx->regs + reg);
|
||||
}
|
||||
|
||||
static void fimd_win_commit(struct device *dev, int zpos)
|
||||
{
|
||||
struct fimd_context *ctx = get_fimd_context(dev);
|
||||
@@ -498,21 +520,19 @@ static void fimd_win_commit(struct device *dev, int zpos)
|
||||
unsigned int last_x;
|
||||
unsigned int last_y;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
if (ctx->suspended)
|
||||
return;
|
||||
|
||||
if (win == DEFAULT_ZPOS)
|
||||
win = ctx->default_win;
|
||||
|
||||
if (win < 0 || win > WINDOWS_NR)
|
||||
if (win < 0 || win >= WINDOWS_NR)
|
||||
return;
|
||||
|
||||
win_data = &ctx->win_data[win];
|
||||
|
||||
/*
|
||||
* SHADOWCON register is used for enabling timing.
|
||||
* SHADOWCON/PRTCON register is used for enabling timing.
|
||||
*
|
||||
* for example, once only width value of a register is set,
|
||||
* if the dma is started then fimd hardware could malfunction so
|
||||
@@ -522,9 +542,7 @@ static void fimd_win_commit(struct device *dev, int zpos)
|
||||
*/
|
||||
|
||||
/* protect windows */
|
||||
val = readl(ctx->regs + SHADOWCON);
|
||||
val |= SHADOWCON_WINx_PROTECT(win);
|
||||
writel(val, ctx->regs + SHADOWCON);
|
||||
fimd_shadow_protect_win(ctx, win, true);
|
||||
|
||||
/* buffer start address */
|
||||
val = (unsigned long)win_data->dma_addr;
|
||||
@@ -602,10 +620,13 @@ static void fimd_win_commit(struct device *dev, int zpos)
|
||||
writel(val, ctx->regs + WINCON(win));
|
||||
|
||||
/* Enable DMA channel and unprotect windows */
|
||||
val = readl(ctx->regs + SHADOWCON);
|
||||
val |= SHADOWCON_CHx_ENABLE(win);
|
||||
val &= ~SHADOWCON_WINx_PROTECT(win);
|
||||
writel(val, ctx->regs + SHADOWCON);
|
||||
fimd_shadow_protect_win(ctx, win, false);
|
||||
|
||||
if (ctx->driver_data->has_shadowcon) {
|
||||
val = readl(ctx->regs + SHADOWCON);
|
||||
val |= SHADOWCON_CHx_ENABLE(win);
|
||||
writel(val, ctx->regs + SHADOWCON);
|
||||
}
|
||||
|
||||
win_data->enabled = true;
|
||||
}
|
||||
@@ -617,12 +638,10 @@ static void fimd_win_disable(struct device *dev, int zpos)
|
||||
int win = zpos;
|
||||
u32 val;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
if (win == DEFAULT_ZPOS)
|
||||
win = ctx->default_win;
|
||||
|
||||
if (win < 0 || win > WINDOWS_NR)
|
||||
if (win < 0 || win >= WINDOWS_NR)
|
||||
return;
|
||||
|
||||
win_data = &ctx->win_data[win];
|
||||
@@ -634,9 +653,7 @@ static void fimd_win_disable(struct device *dev, int zpos)
|
||||
}
|
||||
|
||||
/* protect windows */
|
||||
val = readl(ctx->regs + SHADOWCON);
|
||||
val |= SHADOWCON_WINx_PROTECT(win);
|
||||
writel(val, ctx->regs + SHADOWCON);
|
||||
fimd_shadow_protect_win(ctx, win, true);
|
||||
|
||||
/* wincon */
|
||||
val = readl(ctx->regs + WINCON(win));
|
||||
@@ -644,10 +661,13 @@ static void fimd_win_disable(struct device *dev, int zpos)
|
||||
writel(val, ctx->regs + WINCON(win));
|
||||
|
||||
/* unprotect windows */
|
||||
val = readl(ctx->regs + SHADOWCON);
|
||||
val &= ~SHADOWCON_CHx_ENABLE(win);
|
||||
val &= ~SHADOWCON_WINx_PROTECT(win);
|
||||
writel(val, ctx->regs + SHADOWCON);
|
||||
if (ctx->driver_data->has_shadowcon) {
|
||||
val = readl(ctx->regs + SHADOWCON);
|
||||
val &= ~SHADOWCON_CHx_ENABLE(win);
|
||||
writel(val, ctx->regs + SHADOWCON);
|
||||
}
|
||||
|
||||
fimd_shadow_protect_win(ctx, win, false);
|
||||
|
||||
win_data->enabled = false;
|
||||
}
|
||||
@@ -697,8 +717,6 @@ out:
|
||||
|
||||
static int fimd_subdrv_probe(struct drm_device *drm_dev, struct device *dev)
|
||||
{
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
/*
|
||||
* enable drm irq mode.
|
||||
* - with irq_enabled = 1, we can use the vblank feature.
|
||||
@@ -725,8 +743,6 @@ static int fimd_subdrv_probe(struct drm_device *drm_dev, struct device *dev)
|
||||
|
||||
static void fimd_subdrv_remove(struct drm_device *drm_dev, struct device *dev)
|
||||
{
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
/* detach this sub driver from iommu mapping if supported. */
|
||||
if (is_drm_iommu_supported(drm_dev))
|
||||
drm_iommu_detach_device(drm_dev, dev);
|
||||
@@ -741,8 +757,6 @@ static int fimd_calc_clkdiv(struct fimd_context *ctx,
|
||||
u32 best_framerate = 0;
|
||||
u32 framerate;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
retrace = timing->left_margin + timing->hsync_len +
|
||||
timing->right_margin + timing->xres;
|
||||
retrace *= timing->upper_margin + timing->vsync_len +
|
||||
@@ -777,10 +791,6 @@ static int fimd_calc_clkdiv(struct fimd_context *ctx,
|
||||
|
||||
static void fimd_clear_win(struct fimd_context *ctx, int win)
|
||||
{
|
||||
u32 val;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
writel(0, ctx->regs + WINCON(win));
|
||||
writel(0, ctx->regs + VIDOSD_A(win));
|
||||
writel(0, ctx->regs + VIDOSD_B(win));
|
||||
@@ -789,15 +799,11 @@ static void fimd_clear_win(struct fimd_context *ctx, int win)
|
||||
if (win == 1 || win == 2)
|
||||
writel(0, ctx->regs + VIDOSD_D(win));
|
||||
|
||||
val = readl(ctx->regs + SHADOWCON);
|
||||
val &= ~SHADOWCON_WINx_PROTECT(win);
|
||||
writel(val, ctx->regs + SHADOWCON);
|
||||
fimd_shadow_protect_win(ctx, win, false);
|
||||
}
|
||||
|
||||
static int fimd_clock(struct fimd_context *ctx, bool enable)
|
||||
{
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
if (enable) {
|
||||
int ret;
|
||||
|
||||
@@ -883,8 +889,6 @@ static int fimd_probe(struct platform_device *pdev)
|
||||
int win;
|
||||
int ret = -EINVAL;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
if (dev->of_node) {
|
||||
pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
|
||||
if (!pdata) {
|
||||
@@ -949,6 +953,7 @@ static int fimd_probe(struct platform_device *pdev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
ctx->driver_data = drm_fimd_get_driver_data(pdev);
|
||||
ctx->vidcon0 = pdata->vidcon0;
|
||||
ctx->vidcon1 = pdata->vidcon1;
|
||||
ctx->default_win = pdata->default_win;
|
||||
@@ -989,8 +994,6 @@ static int fimd_remove(struct platform_device *pdev)
|
||||
struct device *dev = &pdev->dev;
|
||||
struct fimd_context *ctx = platform_get_drvdata(pdev);
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
exynos_drm_subdrv_unregister(&ctx->subdrv);
|
||||
|
||||
if (ctx->suspended)
|
||||
@@ -1055,8 +1058,6 @@ static int fimd_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct fimd_context *ctx = get_fimd_context(dev);
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
return fimd_activate(ctx, false);
|
||||
}
|
||||
|
||||
@@ -1064,14 +1065,15 @@ static int fimd_runtime_resume(struct device *dev)
|
||||
{
|
||||
struct fimd_context *ctx = get_fimd_context(dev);
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
return fimd_activate(ctx, true);
|
||||
}
|
||||
#endif
|
||||
|
||||
static struct platform_device_id fimd_driver_ids[] = {
|
||||
{
|
||||
.name = "s3c64xx-fb",
|
||||
.driver_data = (unsigned long)&s3c64xx_fimd_driver_data,
|
||||
}, {
|
||||
.name = "exynos4-fb",
|
||||
.driver_data = (unsigned long)&exynos4_fimd_driver_data,
|
||||
}, {
|
||||
|
@@ -132,8 +132,6 @@ void exynos_drm_gem_destroy(struct exynos_drm_gem_obj *exynos_gem_obj)
|
||||
struct drm_gem_object *obj;
|
||||
struct exynos_drm_gem_buf *buf;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
obj = &exynos_gem_obj->base;
|
||||
buf = exynos_gem_obj->buffer;
|
||||
|
||||
@@ -227,7 +225,6 @@ struct exynos_drm_gem_obj *exynos_drm_gem_create(struct drm_device *dev,
|
||||
}
|
||||
|
||||
size = roundup_gem_size(size, flags);
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
ret = check_gem_flags(flags);
|
||||
if (ret)
|
||||
@@ -268,8 +265,6 @@ int exynos_drm_gem_create_ioctl(struct drm_device *dev, void *data,
|
||||
struct exynos_drm_gem_obj *exynos_gem_obj;
|
||||
int ret;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
exynos_gem_obj = exynos_drm_gem_create(dev, args->flags, args->size);
|
||||
if (IS_ERR(exynos_gem_obj))
|
||||
return PTR_ERR(exynos_gem_obj);
|
||||
@@ -331,8 +326,6 @@ int exynos_drm_gem_map_offset_ioctl(struct drm_device *dev, void *data,
|
||||
{
|
||||
struct drm_exynos_gem_map_off *args = data;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
DRM_DEBUG_KMS("handle = 0x%x, offset = 0x%lx\n",
|
||||
args->handle, (unsigned long)args->offset);
|
||||
|
||||
@@ -371,8 +364,6 @@ static int exynos_drm_gem_mmap_buffer(struct file *filp,
|
||||
unsigned long vm_size;
|
||||
int ret;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
vma->vm_flags |= VM_IO | VM_DONTEXPAND | VM_DONTDUMP;
|
||||
vma->vm_private_data = obj;
|
||||
vma->vm_ops = drm_dev->driver->gem_vm_ops;
|
||||
@@ -429,9 +420,7 @@ int exynos_drm_gem_mmap_ioctl(struct drm_device *dev, void *data,
|
||||
{
|
||||
struct drm_exynos_gem_mmap *args = data;
|
||||
struct drm_gem_object *obj;
|
||||
unsigned int addr;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
unsigned long addr;
|
||||
|
||||
if (!(dev->driver->driver_features & DRIVER_GEM)) {
|
||||
DRM_ERROR("does not support GEM.\n");
|
||||
@@ -473,14 +462,14 @@ int exynos_drm_gem_mmap_ioctl(struct drm_device *dev, void *data,
|
||||
|
||||
drm_gem_object_unreference(obj);
|
||||
|
||||
if (IS_ERR((void *)addr)) {
|
||||
if (IS_ERR_VALUE(addr)) {
|
||||
/* check filp->f_op, filp->private_data are restored */
|
||||
if (file_priv->filp->f_op == &exynos_drm_gem_fops) {
|
||||
file_priv->filp->f_op = fops_get(dev->driver->fops);
|
||||
file_priv->filp->private_data = file_priv;
|
||||
}
|
||||
mutex_unlock(&dev->struct_mutex);
|
||||
return PTR_ERR((void *)addr);
|
||||
return (int)addr;
|
||||
}
|
||||
|
||||
mutex_unlock(&dev->struct_mutex);
|
||||
@@ -643,8 +632,6 @@ void exynos_gem_unmap_sgt_from_dma(struct drm_device *drm_dev,
|
||||
|
||||
int exynos_drm_gem_init_object(struct drm_gem_object *obj)
|
||||
{
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -653,8 +640,6 @@ void exynos_drm_gem_free_object(struct drm_gem_object *obj)
|
||||
struct exynos_drm_gem_obj *exynos_gem_obj;
|
||||
struct exynos_drm_gem_buf *buf;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
exynos_gem_obj = to_exynos_gem_obj(obj);
|
||||
buf = exynos_gem_obj->buffer;
|
||||
|
||||
@@ -671,8 +656,6 @@ int exynos_drm_gem_dumb_create(struct drm_file *file_priv,
|
||||
struct exynos_drm_gem_obj *exynos_gem_obj;
|
||||
int ret;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
/*
|
||||
* alocate memory to be used for framebuffer.
|
||||
* - this callback would be called by user application
|
||||
@@ -704,8 +687,6 @@ int exynos_drm_gem_dumb_map_offset(struct drm_file *file_priv,
|
||||
struct drm_gem_object *obj;
|
||||
int ret = 0;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
mutex_lock(&dev->struct_mutex);
|
||||
|
||||
/*
|
||||
@@ -743,8 +724,6 @@ int exynos_drm_gem_dumb_destroy(struct drm_file *file_priv,
|
||||
{
|
||||
int ret;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
/*
|
||||
* obj->refcount and obj->handle_count are decreased and
|
||||
* if both them are 0 then exynos_drm_gem_free_object()
|
||||
@@ -788,8 +767,6 @@ int exynos_drm_gem_mmap(struct file *filp, struct vm_area_struct *vma)
|
||||
struct drm_gem_object *obj;
|
||||
int ret;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
/* set vm_area_struct. */
|
||||
ret = drm_gem_mmap(filp, vma);
|
||||
if (ret < 0) {
|
||||
|
@@ -400,8 +400,6 @@ static int gsc_sw_reset(struct gsc_context *ctx)
|
||||
u32 cfg;
|
||||
int count = GSC_RESET_TIMEOUT;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
/* s/w reset */
|
||||
cfg = (GSC_SW_RESET_SRESET);
|
||||
gsc_write(cfg, GSC_SW_RESET);
|
||||
@@ -441,8 +439,6 @@ static void gsc_set_gscblk_fimd_wb(struct gsc_context *ctx, bool enable)
|
||||
{
|
||||
u32 gscblk_cfg;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
gscblk_cfg = readl(SYSREG_GSCBLK_CFG1);
|
||||
|
||||
if (enable)
|
||||
@@ -460,7 +456,7 @@ static void gsc_handle_irq(struct gsc_context *ctx, bool enable,
|
||||
{
|
||||
u32 cfg;
|
||||
|
||||
DRM_DEBUG_KMS("%s:enable[%d]overflow[%d]level[%d]\n", __func__,
|
||||
DRM_DEBUG_KMS("enable[%d]overflow[%d]level[%d]\n",
|
||||
enable, overflow, done);
|
||||
|
||||
cfg = gsc_read(GSC_IRQ);
|
||||
@@ -491,7 +487,7 @@ static int gsc_src_set_fmt(struct device *dev, u32 fmt)
|
||||
struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
|
||||
u32 cfg;
|
||||
|
||||
DRM_DEBUG_KMS("%s:fmt[0x%x]\n", __func__, fmt);
|
||||
DRM_DEBUG_KMS("fmt[0x%x]\n", fmt);
|
||||
|
||||
cfg = gsc_read(GSC_IN_CON);
|
||||
cfg &= ~(GSC_IN_RGB_TYPE_MASK | GSC_IN_YUV422_1P_ORDER_MASK |
|
||||
@@ -567,8 +563,7 @@ static int gsc_src_set_transf(struct device *dev,
|
||||
struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
|
||||
u32 cfg;
|
||||
|
||||
DRM_DEBUG_KMS("%s:degree[%d]flip[0x%x]\n", __func__,
|
||||
degree, flip);
|
||||
DRM_DEBUG_KMS("degree[%d]flip[0x%x]\n", degree, flip);
|
||||
|
||||
cfg = gsc_read(GSC_IN_CON);
|
||||
cfg &= ~GSC_IN_ROT_MASK;
|
||||
@@ -616,8 +611,8 @@ static int gsc_src_set_size(struct device *dev, int swap,
|
||||
struct gsc_scaler *sc = &ctx->sc;
|
||||
u32 cfg;
|
||||
|
||||
DRM_DEBUG_KMS("%s:swap[%d]x[%d]y[%d]w[%d]h[%d]\n",
|
||||
__func__, swap, pos->x, pos->y, pos->w, pos->h);
|
||||
DRM_DEBUG_KMS("swap[%d]x[%d]y[%d]w[%d]h[%d]\n",
|
||||
swap, pos->x, pos->y, pos->w, pos->h);
|
||||
|
||||
if (swap) {
|
||||
img_pos.w = pos->h;
|
||||
@@ -634,8 +629,7 @@ static int gsc_src_set_size(struct device *dev, int swap,
|
||||
GSC_CROPPED_HEIGHT(img_pos.h));
|
||||
gsc_write(cfg, GSC_CROPPED_SIZE);
|
||||
|
||||
DRM_DEBUG_KMS("%s:hsize[%d]vsize[%d]\n",
|
||||
__func__, sz->hsize, sz->vsize);
|
||||
DRM_DEBUG_KMS("hsize[%d]vsize[%d]\n", sz->hsize, sz->vsize);
|
||||
|
||||
/* original size */
|
||||
cfg = gsc_read(GSC_SRCIMG_SIZE);
|
||||
@@ -650,8 +644,7 @@ static int gsc_src_set_size(struct device *dev, int swap,
|
||||
cfg = gsc_read(GSC_IN_CON);
|
||||
cfg &= ~GSC_IN_RGB_TYPE_MASK;
|
||||
|
||||
DRM_DEBUG_KMS("%s:width[%d]range[%d]\n",
|
||||
__func__, pos->w, sc->range);
|
||||
DRM_DEBUG_KMS("width[%d]range[%d]\n", pos->w, sc->range);
|
||||
|
||||
if (pos->w >= GSC_WIDTH_ITU_709)
|
||||
if (sc->range)
|
||||
@@ -677,8 +670,7 @@ static int gsc_src_set_buf_seq(struct gsc_context *ctx, u32 buf_id,
|
||||
u32 cfg;
|
||||
u32 mask = 0x00000001 << buf_id;
|
||||
|
||||
DRM_DEBUG_KMS("%s:buf_id[%d]buf_type[%d]\n", __func__,
|
||||
buf_id, buf_type);
|
||||
DRM_DEBUG_KMS("buf_id[%d]buf_type[%d]\n", buf_id, buf_type);
|
||||
|
||||
/* mask register set */
|
||||
cfg = gsc_read(GSC_IN_BASE_ADDR_Y_MASK);
|
||||
@@ -721,7 +713,7 @@ static int gsc_src_set_addr(struct device *dev,
|
||||
|
||||
property = &c_node->property;
|
||||
|
||||
DRM_DEBUG_KMS("%s:prop_id[%d]buf_id[%d]buf_type[%d]\n", __func__,
|
||||
DRM_DEBUG_KMS("prop_id[%d]buf_id[%d]buf_type[%d]\n",
|
||||
property->prop_id, buf_id, buf_type);
|
||||
|
||||
if (buf_id > GSC_MAX_SRC) {
|
||||
@@ -765,7 +757,7 @@ static int gsc_dst_set_fmt(struct device *dev, u32 fmt)
|
||||
struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
|
||||
u32 cfg;
|
||||
|
||||
DRM_DEBUG_KMS("%s:fmt[0x%x]\n", __func__, fmt);
|
||||
DRM_DEBUG_KMS("fmt[0x%x]\n", fmt);
|
||||
|
||||
cfg = gsc_read(GSC_OUT_CON);
|
||||
cfg &= ~(GSC_OUT_RGB_TYPE_MASK | GSC_OUT_YUV422_1P_ORDER_MASK |
|
||||
@@ -838,8 +830,7 @@ static int gsc_dst_set_transf(struct device *dev,
|
||||
struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
|
||||
u32 cfg;
|
||||
|
||||
DRM_DEBUG_KMS("%s:degree[%d]flip[0x%x]\n", __func__,
|
||||
degree, flip);
|
||||
DRM_DEBUG_KMS("degree[%d]flip[0x%x]\n", degree, flip);
|
||||
|
||||
cfg = gsc_read(GSC_IN_CON);
|
||||
cfg &= ~GSC_IN_ROT_MASK;
|
||||
@@ -881,7 +872,7 @@ static int gsc_dst_set_transf(struct device *dev,
|
||||
|
||||
static int gsc_get_ratio_shift(u32 src, u32 dst, u32 *ratio)
|
||||
{
|
||||
DRM_DEBUG_KMS("%s:src[%d]dst[%d]\n", __func__, src, dst);
|
||||
DRM_DEBUG_KMS("src[%d]dst[%d]\n", src, dst);
|
||||
|
||||
if (src >= dst * 8) {
|
||||
DRM_ERROR("failed to make ratio and shift.\n");
|
||||
@@ -944,20 +935,19 @@ static int gsc_set_prescaler(struct gsc_context *ctx, struct gsc_scaler *sc,
|
||||
return ret;
|
||||
}
|
||||
|
||||
DRM_DEBUG_KMS("%s:pre_hratio[%d]pre_vratio[%d]\n",
|
||||
__func__, sc->pre_hratio, sc->pre_vratio);
|
||||
DRM_DEBUG_KMS("pre_hratio[%d]pre_vratio[%d]\n",
|
||||
sc->pre_hratio, sc->pre_vratio);
|
||||
|
||||
sc->main_hratio = (src_w << 16) / dst_w;
|
||||
sc->main_vratio = (src_h << 16) / dst_h;
|
||||
|
||||
DRM_DEBUG_KMS("%s:main_hratio[%ld]main_vratio[%ld]\n",
|
||||
__func__, sc->main_hratio, sc->main_vratio);
|
||||
DRM_DEBUG_KMS("main_hratio[%ld]main_vratio[%ld]\n",
|
||||
sc->main_hratio, sc->main_vratio);
|
||||
|
||||
gsc_get_prescaler_shfactor(sc->pre_hratio, sc->pre_vratio,
|
||||
&sc->pre_shfactor);
|
||||
|
||||
DRM_DEBUG_KMS("%s:pre_shfactor[%d]\n", __func__,
|
||||
sc->pre_shfactor);
|
||||
DRM_DEBUG_KMS("pre_shfactor[%d]\n", sc->pre_shfactor);
|
||||
|
||||
cfg = (GSC_PRESC_SHFACTOR(sc->pre_shfactor) |
|
||||
GSC_PRESC_H_RATIO(sc->pre_hratio) |
|
||||
@@ -1023,8 +1013,8 @@ static void gsc_set_scaler(struct gsc_context *ctx, struct gsc_scaler *sc)
|
||||
{
|
||||
u32 cfg;
|
||||
|
||||
DRM_DEBUG_KMS("%s:main_hratio[%ld]main_vratio[%ld]\n",
|
||||
__func__, sc->main_hratio, sc->main_vratio);
|
||||
DRM_DEBUG_KMS("main_hratio[%ld]main_vratio[%ld]\n",
|
||||
sc->main_hratio, sc->main_vratio);
|
||||
|
||||
gsc_set_h_coef(ctx, sc->main_hratio);
|
||||
cfg = GSC_MAIN_H_RATIO_VALUE(sc->main_hratio);
|
||||
@@ -1043,8 +1033,8 @@ static int gsc_dst_set_size(struct device *dev, int swap,
|
||||
struct gsc_scaler *sc = &ctx->sc;
|
||||
u32 cfg;
|
||||
|
||||
DRM_DEBUG_KMS("%s:swap[%d]x[%d]y[%d]w[%d]h[%d]\n",
|
||||
__func__, swap, pos->x, pos->y, pos->w, pos->h);
|
||||
DRM_DEBUG_KMS("swap[%d]x[%d]y[%d]w[%d]h[%d]\n",
|
||||
swap, pos->x, pos->y, pos->w, pos->h);
|
||||
|
||||
if (swap) {
|
||||
img_pos.w = pos->h;
|
||||
@@ -1060,8 +1050,7 @@ static int gsc_dst_set_size(struct device *dev, int swap,
|
||||
cfg = (GSC_SCALED_WIDTH(img_pos.w) | GSC_SCALED_HEIGHT(img_pos.h));
|
||||
gsc_write(cfg, GSC_SCALED_SIZE);
|
||||
|
||||
DRM_DEBUG_KMS("%s:hsize[%d]vsize[%d]\n",
|
||||
__func__, sz->hsize, sz->vsize);
|
||||
DRM_DEBUG_KMS("hsize[%d]vsize[%d]\n", sz->hsize, sz->vsize);
|
||||
|
||||
/* original size */
|
||||
cfg = gsc_read(GSC_DSTIMG_SIZE);
|
||||
@@ -1074,8 +1063,7 @@ static int gsc_dst_set_size(struct device *dev, int swap,
|
||||
cfg = gsc_read(GSC_OUT_CON);
|
||||
cfg &= ~GSC_OUT_RGB_TYPE_MASK;
|
||||
|
||||
DRM_DEBUG_KMS("%s:width[%d]range[%d]\n",
|
||||
__func__, pos->w, sc->range);
|
||||
DRM_DEBUG_KMS("width[%d]range[%d]\n", pos->w, sc->range);
|
||||
|
||||
if (pos->w >= GSC_WIDTH_ITU_709)
|
||||
if (sc->range)
|
||||
@@ -1104,7 +1092,7 @@ static int gsc_dst_get_buf_seq(struct gsc_context *ctx)
|
||||
if (cfg & (mask << i))
|
||||
buf_num--;
|
||||
|
||||
DRM_DEBUG_KMS("%s:buf_num[%d]\n", __func__, buf_num);
|
||||
DRM_DEBUG_KMS("buf_num[%d]\n", buf_num);
|
||||
|
||||
return buf_num;
|
||||
}
|
||||
@@ -1118,8 +1106,7 @@ static int gsc_dst_set_buf_seq(struct gsc_context *ctx, u32 buf_id,
|
||||
u32 mask = 0x00000001 << buf_id;
|
||||
int ret = 0;
|
||||
|
||||
DRM_DEBUG_KMS("%s:buf_id[%d]buf_type[%d]\n", __func__,
|
||||
buf_id, buf_type);
|
||||
DRM_DEBUG_KMS("buf_id[%d]buf_type[%d]\n", buf_id, buf_type);
|
||||
|
||||
mutex_lock(&ctx->lock);
|
||||
|
||||
@@ -1177,7 +1164,7 @@ static int gsc_dst_set_addr(struct device *dev,
|
||||
|
||||
property = &c_node->property;
|
||||
|
||||
DRM_DEBUG_KMS("%s:prop_id[%d]buf_id[%d]buf_type[%d]\n", __func__,
|
||||
DRM_DEBUG_KMS("prop_id[%d]buf_id[%d]buf_type[%d]\n",
|
||||
property->prop_id, buf_id, buf_type);
|
||||
|
||||
if (buf_id > GSC_MAX_DST) {
|
||||
@@ -1217,7 +1204,7 @@ static struct exynos_drm_ipp_ops gsc_dst_ops = {
|
||||
|
||||
static int gsc_clk_ctrl(struct gsc_context *ctx, bool enable)
|
||||
{
|
||||
DRM_DEBUG_KMS("%s:enable[%d]\n", __func__, enable);
|
||||
DRM_DEBUG_KMS("enable[%d]\n", enable);
|
||||
|
||||
if (enable) {
|
||||
clk_enable(ctx->gsc_clk);
|
||||
@@ -1236,7 +1223,7 @@ static int gsc_get_src_buf_index(struct gsc_context *ctx)
|
||||
u32 buf_id = GSC_MAX_SRC;
|
||||
int ret;
|
||||
|
||||
DRM_DEBUG_KMS("%s:gsc id[%d]\n", __func__, ctx->id);
|
||||
DRM_DEBUG_KMS("gsc id[%d]\n", ctx->id);
|
||||
|
||||
cfg = gsc_read(GSC_IN_BASE_ADDR_Y_MASK);
|
||||
curr_index = GSC_IN_CURR_GET_INDEX(cfg);
|
||||
@@ -1259,7 +1246,7 @@ static int gsc_get_src_buf_index(struct gsc_context *ctx)
|
||||
return ret;
|
||||
}
|
||||
|
||||
DRM_DEBUG_KMS("%s:cfg[0x%x]curr_index[%d]buf_id[%d]\n", __func__, cfg,
|
||||
DRM_DEBUG_KMS("cfg[0x%x]curr_index[%d]buf_id[%d]\n", cfg,
|
||||
curr_index, buf_id);
|
||||
|
||||
return buf_id;
|
||||
@@ -1271,7 +1258,7 @@ static int gsc_get_dst_buf_index(struct gsc_context *ctx)
|
||||
u32 buf_id = GSC_MAX_DST;
|
||||
int ret;
|
||||
|
||||
DRM_DEBUG_KMS("%s:gsc id[%d]\n", __func__, ctx->id);
|
||||
DRM_DEBUG_KMS("gsc id[%d]\n", ctx->id);
|
||||
|
||||
cfg = gsc_read(GSC_OUT_BASE_ADDR_Y_MASK);
|
||||
curr_index = GSC_OUT_CURR_GET_INDEX(cfg);
|
||||
@@ -1294,7 +1281,7 @@ static int gsc_get_dst_buf_index(struct gsc_context *ctx)
|
||||
return ret;
|
||||
}
|
||||
|
||||
DRM_DEBUG_KMS("%s:cfg[0x%x]curr_index[%d]buf_id[%d]\n", __func__, cfg,
|
||||
DRM_DEBUG_KMS("cfg[0x%x]curr_index[%d]buf_id[%d]\n", cfg,
|
||||
curr_index, buf_id);
|
||||
|
||||
return buf_id;
|
||||
@@ -1310,7 +1297,7 @@ static irqreturn_t gsc_irq_handler(int irq, void *dev_id)
|
||||
u32 status;
|
||||
int buf_id[EXYNOS_DRM_OPS_MAX];
|
||||
|
||||
DRM_DEBUG_KMS("%s:gsc id[%d]\n", __func__, ctx->id);
|
||||
DRM_DEBUG_KMS("gsc id[%d]\n", ctx->id);
|
||||
|
||||
status = gsc_read(GSC_IRQ);
|
||||
if (status & GSC_IRQ_STATUS_OR_IRQ) {
|
||||
@@ -1331,7 +1318,7 @@ static irqreturn_t gsc_irq_handler(int irq, void *dev_id)
|
||||
if (buf_id[EXYNOS_DRM_OPS_DST] < 0)
|
||||
return IRQ_HANDLED;
|
||||
|
||||
DRM_DEBUG_KMS("%s:buf_id_src[%d]buf_id_dst[%d]\n", __func__,
|
||||
DRM_DEBUG_KMS("buf_id_src[%d]buf_id_dst[%d]\n",
|
||||
buf_id[EXYNOS_DRM_OPS_SRC], buf_id[EXYNOS_DRM_OPS_DST]);
|
||||
|
||||
event_work->ippdrv = ippdrv;
|
||||
@@ -1350,8 +1337,6 @@ static int gsc_init_prop_list(struct exynos_drm_ippdrv *ippdrv)
|
||||
{
|
||||
struct drm_exynos_ipp_prop_list *prop_list;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
prop_list = devm_kzalloc(ippdrv->dev, sizeof(*prop_list), GFP_KERNEL);
|
||||
if (!prop_list) {
|
||||
DRM_ERROR("failed to alloc property list.\n");
|
||||
@@ -1394,7 +1379,7 @@ static inline bool gsc_check_drm_flip(enum drm_exynos_flip flip)
|
||||
case EXYNOS_DRM_FLIP_BOTH:
|
||||
return true;
|
||||
default:
|
||||
DRM_DEBUG_KMS("%s:invalid flip\n", __func__);
|
||||
DRM_DEBUG_KMS("invalid flip\n");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1411,8 +1396,6 @@ static int gsc_ippdrv_check_property(struct device *dev,
|
||||
bool swap;
|
||||
int i;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
for_each_ipp_ops(i) {
|
||||
if ((i == EXYNOS_DRM_OPS_SRC) &&
|
||||
(property->cmd == IPP_CMD_WB))
|
||||
@@ -1521,8 +1504,6 @@ static int gsc_ippdrv_reset(struct device *dev)
|
||||
struct gsc_scaler *sc = &ctx->sc;
|
||||
int ret;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
/* reset h/w block */
|
||||
ret = gsc_sw_reset(ctx);
|
||||
if (ret < 0) {
|
||||
@@ -1549,7 +1530,7 @@ static int gsc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd)
|
||||
u32 cfg;
|
||||
int ret, i;
|
||||
|
||||
DRM_DEBUG_KMS("%s:cmd[%d]\n", __func__, cmd);
|
||||
DRM_DEBUG_KMS("cmd[%d]\n", cmd);
|
||||
|
||||
if (!c_node) {
|
||||
DRM_ERROR("failed to get c_node.\n");
|
||||
@@ -1643,7 +1624,7 @@ static void gsc_ippdrv_stop(struct device *dev, enum drm_exynos_ipp_cmd cmd)
|
||||
struct drm_exynos_ipp_set_wb set_wb = {0, 0};
|
||||
u32 cfg;
|
||||
|
||||
DRM_DEBUG_KMS("%s:cmd[%d]\n", __func__, cmd);
|
||||
DRM_DEBUG_KMS("cmd[%d]\n", cmd);
|
||||
|
||||
switch (cmd) {
|
||||
case IPP_CMD_M2M:
|
||||
@@ -1728,8 +1709,7 @@ static int gsc_probe(struct platform_device *pdev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
DRM_DEBUG_KMS("%s:id[%d]ippdrv[0x%x]\n", __func__, ctx->id,
|
||||
(int)ippdrv);
|
||||
DRM_DEBUG_KMS("id[%d]ippdrv[0x%x]\n", ctx->id, (int)ippdrv);
|
||||
|
||||
mutex_init(&ctx->lock);
|
||||
platform_set_drvdata(pdev, ctx);
|
||||
@@ -1772,7 +1752,7 @@ static int gsc_suspend(struct device *dev)
|
||||
{
|
||||
struct gsc_context *ctx = get_gsc_context(dev);
|
||||
|
||||
DRM_DEBUG_KMS("%s:id[%d]\n", __func__, ctx->id);
|
||||
DRM_DEBUG_KMS("id[%d]\n", ctx->id);
|
||||
|
||||
if (pm_runtime_suspended(dev))
|
||||
return 0;
|
||||
@@ -1784,7 +1764,7 @@ static int gsc_resume(struct device *dev)
|
||||
{
|
||||
struct gsc_context *ctx = get_gsc_context(dev);
|
||||
|
||||
DRM_DEBUG_KMS("%s:id[%d]\n", __func__, ctx->id);
|
||||
DRM_DEBUG_KMS("id[%d]\n", ctx->id);
|
||||
|
||||
if (!pm_runtime_suspended(dev))
|
||||
return gsc_clk_ctrl(ctx, true);
|
||||
@@ -1798,7 +1778,7 @@ static int gsc_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct gsc_context *ctx = get_gsc_context(dev);
|
||||
|
||||
DRM_DEBUG_KMS("%s:id[%d]\n", __func__, ctx->id);
|
||||
DRM_DEBUG_KMS("id[%d]\n", ctx->id);
|
||||
|
||||
return gsc_clk_ctrl(ctx, false);
|
||||
}
|
||||
@@ -1807,7 +1787,7 @@ static int gsc_runtime_resume(struct device *dev)
|
||||
{
|
||||
struct gsc_context *ctx = get_gsc_context(dev);
|
||||
|
||||
DRM_DEBUG_KMS("%s:id[%d]\n", __FILE__, ctx->id);
|
||||
DRM_DEBUG_KMS("id[%d]\n", ctx->id);
|
||||
|
||||
return gsc_clk_ctrl(ctx, true);
|
||||
}
|
||||
|
@@ -88,16 +88,12 @@ void exynos_mixer_drv_attach(struct exynos_drm_hdmi_context *ctx)
|
||||
|
||||
void exynos_hdmi_ops_register(struct exynos_hdmi_ops *ops)
|
||||
{
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
if (ops)
|
||||
hdmi_ops = ops;
|
||||
}
|
||||
|
||||
void exynos_mixer_ops_register(struct exynos_mixer_ops *ops)
|
||||
{
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
if (ops)
|
||||
mixer_ops = ops;
|
||||
}
|
||||
@@ -106,8 +102,6 @@ static bool drm_hdmi_is_connected(struct device *dev)
|
||||
{
|
||||
struct drm_hdmi_context *ctx = to_context(dev);
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
if (hdmi_ops && hdmi_ops->is_connected)
|
||||
return hdmi_ops->is_connected(ctx->hdmi_ctx->ctx);
|
||||
|
||||
@@ -119,34 +113,31 @@ static struct edid *drm_hdmi_get_edid(struct device *dev,
|
||||
{
|
||||
struct drm_hdmi_context *ctx = to_context(dev);
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
if (hdmi_ops && hdmi_ops->get_edid)
|
||||
return hdmi_ops->get_edid(ctx->hdmi_ctx->ctx, connector);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int drm_hdmi_check_timing(struct device *dev, void *timing)
|
||||
static int drm_hdmi_check_mode(struct device *dev,
|
||||
struct drm_display_mode *mode)
|
||||
{
|
||||
struct drm_hdmi_context *ctx = to_context(dev);
|
||||
int ret = 0;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
/*
|
||||
* Both, mixer and hdmi should be able to handle the requested mode.
|
||||
* If any of the two fails, return mode as BAD.
|
||||
*/
|
||||
|
||||
if (mixer_ops && mixer_ops->check_timing)
|
||||
ret = mixer_ops->check_timing(ctx->mixer_ctx->ctx, timing);
|
||||
if (mixer_ops && mixer_ops->check_mode)
|
||||
ret = mixer_ops->check_mode(ctx->mixer_ctx->ctx, mode);
|
||||
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (hdmi_ops && hdmi_ops->check_timing)
|
||||
return hdmi_ops->check_timing(ctx->hdmi_ctx->ctx, timing);
|
||||
if (hdmi_ops && hdmi_ops->check_mode)
|
||||
return hdmi_ops->check_mode(ctx->hdmi_ctx->ctx, mode);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -155,8 +146,6 @@ static int drm_hdmi_power_on(struct device *dev, int mode)
|
||||
{
|
||||
struct drm_hdmi_context *ctx = to_context(dev);
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
if (hdmi_ops && hdmi_ops->power_on)
|
||||
return hdmi_ops->power_on(ctx->hdmi_ctx->ctx, mode);
|
||||
|
||||
@@ -167,7 +156,7 @@ static struct exynos_drm_display_ops drm_hdmi_display_ops = {
|
||||
.type = EXYNOS_DISPLAY_TYPE_HDMI,
|
||||
.is_connected = drm_hdmi_is_connected,
|
||||
.get_edid = drm_hdmi_get_edid,
|
||||
.check_timing = drm_hdmi_check_timing,
|
||||
.check_mode = drm_hdmi_check_mode,
|
||||
.power_on = drm_hdmi_power_on,
|
||||
};
|
||||
|
||||
@@ -177,8 +166,6 @@ static int drm_hdmi_enable_vblank(struct device *subdrv_dev)
|
||||
struct exynos_drm_subdrv *subdrv = &ctx->subdrv;
|
||||
struct exynos_drm_manager *manager = subdrv->manager;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
if (mixer_ops && mixer_ops->enable_vblank)
|
||||
return mixer_ops->enable_vblank(ctx->mixer_ctx->ctx,
|
||||
manager->pipe);
|
||||
@@ -190,8 +177,6 @@ static void drm_hdmi_disable_vblank(struct device *subdrv_dev)
|
||||
{
|
||||
struct drm_hdmi_context *ctx = to_context(subdrv_dev);
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
if (mixer_ops && mixer_ops->disable_vblank)
|
||||
return mixer_ops->disable_vblank(ctx->mixer_ctx->ctx);
|
||||
}
|
||||
@@ -200,8 +185,6 @@ static void drm_hdmi_wait_for_vblank(struct device *subdrv_dev)
|
||||
{
|
||||
struct drm_hdmi_context *ctx = to_context(subdrv_dev);
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
if (mixer_ops && mixer_ops->wait_for_vblank)
|
||||
mixer_ops->wait_for_vblank(ctx->mixer_ctx->ctx);
|
||||
}
|
||||
@@ -214,11 +197,9 @@ static void drm_hdmi_mode_fixup(struct device *subdrv_dev,
|
||||
struct drm_display_mode *m;
|
||||
int mode_ok;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
drm_mode_set_crtcinfo(adjusted_mode, 0);
|
||||
|
||||
mode_ok = drm_hdmi_check_timing(subdrv_dev, adjusted_mode);
|
||||
mode_ok = drm_hdmi_check_mode(subdrv_dev, adjusted_mode);
|
||||
|
||||
/* just return if user desired mode exists. */
|
||||
if (mode_ok == 0)
|
||||
@@ -229,7 +210,7 @@ static void drm_hdmi_mode_fixup(struct device *subdrv_dev,
|
||||
* to adjusted_mode.
|
||||
*/
|
||||
list_for_each_entry(m, &connector->modes, head) {
|
||||
mode_ok = drm_hdmi_check_timing(subdrv_dev, m);
|
||||
mode_ok = drm_hdmi_check_mode(subdrv_dev, m);
|
||||
|
||||
if (mode_ok == 0) {
|
||||
struct drm_mode_object base;
|
||||
@@ -256,8 +237,6 @@ static void drm_hdmi_mode_set(struct device *subdrv_dev, void *mode)
|
||||
{
|
||||
struct drm_hdmi_context *ctx = to_context(subdrv_dev);
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
if (hdmi_ops && hdmi_ops->mode_set)
|
||||
hdmi_ops->mode_set(ctx->hdmi_ctx->ctx, mode);
|
||||
}
|
||||
@@ -267,8 +246,6 @@ static void drm_hdmi_get_max_resol(struct device *subdrv_dev,
|
||||
{
|
||||
struct drm_hdmi_context *ctx = to_context(subdrv_dev);
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
if (hdmi_ops && hdmi_ops->get_max_resol)
|
||||
hdmi_ops->get_max_resol(ctx->hdmi_ctx->ctx, width, height);
|
||||
}
|
||||
@@ -277,8 +254,6 @@ static void drm_hdmi_commit(struct device *subdrv_dev)
|
||||
{
|
||||
struct drm_hdmi_context *ctx = to_context(subdrv_dev);
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
if (hdmi_ops && hdmi_ops->commit)
|
||||
hdmi_ops->commit(ctx->hdmi_ctx->ctx);
|
||||
}
|
||||
@@ -287,8 +262,6 @@ static void drm_hdmi_dpms(struct device *subdrv_dev, int mode)
|
||||
{
|
||||
struct drm_hdmi_context *ctx = to_context(subdrv_dev);
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
if (mixer_ops && mixer_ops->dpms)
|
||||
mixer_ops->dpms(ctx->mixer_ctx->ctx, mode);
|
||||
|
||||
@@ -301,8 +274,6 @@ static void drm_hdmi_apply(struct device *subdrv_dev)
|
||||
struct drm_hdmi_context *ctx = to_context(subdrv_dev);
|
||||
int i;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
for (i = 0; i < MIXER_WIN_NR; i++) {
|
||||
if (!ctx->enabled[i])
|
||||
continue;
|
||||
@@ -331,8 +302,6 @@ static void drm_mixer_mode_set(struct device *subdrv_dev,
|
||||
{
|
||||
struct drm_hdmi_context *ctx = to_context(subdrv_dev);
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
if (mixer_ops && mixer_ops->win_mode_set)
|
||||
mixer_ops->win_mode_set(ctx->mixer_ctx->ctx, overlay);
|
||||
}
|
||||
@@ -342,9 +311,7 @@ static void drm_mixer_commit(struct device *subdrv_dev, int zpos)
|
||||
struct drm_hdmi_context *ctx = to_context(subdrv_dev);
|
||||
int win = (zpos == DEFAULT_ZPOS) ? MIXER_DEFAULT_WIN : zpos;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
if (win < 0 || win > MIXER_WIN_NR) {
|
||||
if (win < 0 || win >= MIXER_WIN_NR) {
|
||||
DRM_ERROR("mixer window[%d] is wrong\n", win);
|
||||
return;
|
||||
}
|
||||
@@ -360,9 +327,7 @@ static void drm_mixer_disable(struct device *subdrv_dev, int zpos)
|
||||
struct drm_hdmi_context *ctx = to_context(subdrv_dev);
|
||||
int win = (zpos == DEFAULT_ZPOS) ? MIXER_DEFAULT_WIN : zpos;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
if (win < 0 || win > MIXER_WIN_NR) {
|
||||
if (win < 0 || win >= MIXER_WIN_NR) {
|
||||
DRM_ERROR("mixer window[%d] is wrong\n", win);
|
||||
return;
|
||||
}
|
||||
@@ -392,8 +357,6 @@ static int hdmi_subdrv_probe(struct drm_device *drm_dev,
|
||||
struct exynos_drm_subdrv *subdrv = to_subdrv(dev);
|
||||
struct drm_hdmi_context *ctx;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
if (!hdmi_ctx) {
|
||||
DRM_ERROR("hdmi context not initialized.\n");
|
||||
return -EFAULT;
|
||||
@@ -440,8 +403,6 @@ static int exynos_drm_hdmi_probe(struct platform_device *pdev)
|
||||
struct exynos_drm_subdrv *subdrv;
|
||||
struct drm_hdmi_context *ctx;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
|
||||
if (!ctx) {
|
||||
DRM_LOG_KMS("failed to alloc common hdmi context.\n");
|
||||
@@ -466,8 +427,6 @@ static int exynos_drm_hdmi_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct drm_hdmi_context *ctx = platform_get_drvdata(pdev);
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
exynos_drm_subdrv_unregister(&ctx->subdrv);
|
||||
|
||||
return 0;
|
||||
|
@@ -32,11 +32,11 @@ struct exynos_hdmi_ops {
|
||||
bool (*is_connected)(void *ctx);
|
||||
struct edid *(*get_edid)(void *ctx,
|
||||
struct drm_connector *connector);
|
||||
int (*check_timing)(void *ctx, struct fb_videomode *timing);
|
||||
int (*check_mode)(void *ctx, struct drm_display_mode *mode);
|
||||
int (*power_on)(void *ctx, int mode);
|
||||
|
||||
/* manager */
|
||||
void (*mode_set)(void *ctx, void *mode);
|
||||
void (*mode_set)(void *ctx, struct drm_display_mode *mode);
|
||||
void (*get_max_resol)(void *ctx, unsigned int *width,
|
||||
unsigned int *height);
|
||||
void (*commit)(void *ctx);
|
||||
@@ -57,7 +57,7 @@ struct exynos_mixer_ops {
|
||||
void (*win_disable)(void *ctx, int zpos);
|
||||
|
||||
/* display */
|
||||
int (*check_timing)(void *ctx, struct fb_videomode *timing);
|
||||
int (*check_mode)(void *ctx, struct drm_display_mode *mode);
|
||||
};
|
||||
|
||||
void exynos_hdmi_drv_attach(struct exynos_drm_hdmi_context *ctx);
|
||||
|
@@ -131,8 +131,6 @@ void exynos_platform_device_ipp_unregister(void)
|
||||
|
||||
int exynos_drm_ippdrv_register(struct exynos_drm_ippdrv *ippdrv)
|
||||
{
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
if (!ippdrv)
|
||||
return -EINVAL;
|
||||
|
||||
@@ -145,8 +143,6 @@ int exynos_drm_ippdrv_register(struct exynos_drm_ippdrv *ippdrv)
|
||||
|
||||
int exynos_drm_ippdrv_unregister(struct exynos_drm_ippdrv *ippdrv)
|
||||
{
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
if (!ippdrv)
|
||||
return -EINVAL;
|
||||
|
||||
@@ -162,8 +158,6 @@ static int ipp_create_id(struct idr *id_idr, struct mutex *lock, void *obj,
|
||||
{
|
||||
int ret;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
/* do the allocation under our mutexlock */
|
||||
mutex_lock(lock);
|
||||
ret = idr_alloc(id_idr, obj, 1, 0, GFP_KERNEL);
|
||||
@@ -179,7 +173,7 @@ static void *ipp_find_obj(struct idr *id_idr, struct mutex *lock, u32 id)
|
||||
{
|
||||
void *obj;
|
||||
|
||||
DRM_DEBUG_KMS("%s:id[%d]\n", __func__, id);
|
||||
DRM_DEBUG_KMS("id[%d]\n", id);
|
||||
|
||||
mutex_lock(lock);
|
||||
|
||||
@@ -216,7 +210,7 @@ static struct exynos_drm_ippdrv *ipp_find_driver(struct ipp_context *ctx,
|
||||
struct exynos_drm_ippdrv *ippdrv;
|
||||
u32 ipp_id = property->ipp_id;
|
||||
|
||||
DRM_DEBUG_KMS("%s:ipp_id[%d]\n", __func__, ipp_id);
|
||||
DRM_DEBUG_KMS("ipp_id[%d]\n", ipp_id);
|
||||
|
||||
if (ipp_id) {
|
||||
/* find ipp driver using idr */
|
||||
@@ -257,14 +251,13 @@ static struct exynos_drm_ippdrv *ipp_find_driver(struct ipp_context *ctx,
|
||||
*/
|
||||
list_for_each_entry(ippdrv, &exynos_drm_ippdrv_list, drv_list) {
|
||||
if (ipp_check_dedicated(ippdrv, property->cmd)) {
|
||||
DRM_DEBUG_KMS("%s:used device.\n", __func__);
|
||||
DRM_DEBUG_KMS("used device.\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ippdrv->check_property &&
|
||||
ippdrv->check_property(ippdrv->dev, property)) {
|
||||
DRM_DEBUG_KMS("%s:not support property.\n",
|
||||
__func__);
|
||||
DRM_DEBUG_KMS("not support property.\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -283,10 +276,10 @@ static struct exynos_drm_ippdrv *ipp_find_drv_by_handle(u32 prop_id)
|
||||
struct drm_exynos_ipp_cmd_node *c_node;
|
||||
int count = 0;
|
||||
|
||||
DRM_DEBUG_KMS("%s:prop_id[%d]\n", __func__, prop_id);
|
||||
DRM_DEBUG_KMS("prop_id[%d]\n", prop_id);
|
||||
|
||||
if (list_empty(&exynos_drm_ippdrv_list)) {
|
||||
DRM_DEBUG_KMS("%s:ippdrv_list is empty.\n", __func__);
|
||||
DRM_DEBUG_KMS("ippdrv_list is empty.\n");
|
||||
return ERR_PTR(-ENODEV);
|
||||
}
|
||||
|
||||
@@ -296,8 +289,7 @@ static struct exynos_drm_ippdrv *ipp_find_drv_by_handle(u32 prop_id)
|
||||
* e.g PAUSE state, queue buf, command contro.
|
||||
*/
|
||||
list_for_each_entry(ippdrv, &exynos_drm_ippdrv_list, drv_list) {
|
||||
DRM_DEBUG_KMS("%s:count[%d]ippdrv[0x%x]\n", __func__,
|
||||
count++, (int)ippdrv);
|
||||
DRM_DEBUG_KMS("count[%d]ippdrv[0x%x]\n", count++, (int)ippdrv);
|
||||
|
||||
if (!list_empty(&ippdrv->cmd_list)) {
|
||||
list_for_each_entry(c_node, &ippdrv->cmd_list, list)
|
||||
@@ -320,8 +312,6 @@ int exynos_drm_ipp_get_property(struct drm_device *drm_dev, void *data,
|
||||
struct exynos_drm_ippdrv *ippdrv;
|
||||
int count = 0;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
if (!ctx) {
|
||||
DRM_ERROR("invalid context.\n");
|
||||
return -EINVAL;
|
||||
@@ -332,7 +322,7 @@ int exynos_drm_ipp_get_property(struct drm_device *drm_dev, void *data,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
DRM_DEBUG_KMS("%s:ipp_id[%d]\n", __func__, prop_list->ipp_id);
|
||||
DRM_DEBUG_KMS("ipp_id[%d]\n", prop_list->ipp_id);
|
||||
|
||||
if (!prop_list->ipp_id) {
|
||||
list_for_each_entry(ippdrv, &exynos_drm_ippdrv_list, drv_list)
|
||||
@@ -371,11 +361,11 @@ static void ipp_print_property(struct drm_exynos_ipp_property *property,
|
||||
struct drm_exynos_pos *pos = &config->pos;
|
||||
struct drm_exynos_sz *sz = &config->sz;
|
||||
|
||||
DRM_DEBUG_KMS("%s:prop_id[%d]ops[%s]fmt[0x%x]\n",
|
||||
__func__, property->prop_id, idx ? "dst" : "src", config->fmt);
|
||||
DRM_DEBUG_KMS("prop_id[%d]ops[%s]fmt[0x%x]\n",
|
||||
property->prop_id, idx ? "dst" : "src", config->fmt);
|
||||
|
||||
DRM_DEBUG_KMS("%s:pos[%d %d %d %d]sz[%d %d]f[%d]r[%d]\n",
|
||||
__func__, pos->x, pos->y, pos->w, pos->h,
|
||||
DRM_DEBUG_KMS("pos[%d %d %d %d]sz[%d %d]f[%d]r[%d]\n",
|
||||
pos->x, pos->y, pos->w, pos->h,
|
||||
sz->hsize, sz->vsize, config->flip, config->degree);
|
||||
}
|
||||
|
||||
@@ -385,7 +375,7 @@ static int ipp_find_and_set_property(struct drm_exynos_ipp_property *property)
|
||||
struct drm_exynos_ipp_cmd_node *c_node;
|
||||
u32 prop_id = property->prop_id;
|
||||
|
||||
DRM_DEBUG_KMS("%s:prop_id[%d]\n", __func__, prop_id);
|
||||
DRM_DEBUG_KMS("prop_id[%d]\n", prop_id);
|
||||
|
||||
ippdrv = ipp_find_drv_by_handle(prop_id);
|
||||
if (IS_ERR(ippdrv)) {
|
||||
@@ -401,8 +391,8 @@ static int ipp_find_and_set_property(struct drm_exynos_ipp_property *property)
|
||||
list_for_each_entry(c_node, &ippdrv->cmd_list, list) {
|
||||
if ((c_node->property.prop_id == prop_id) &&
|
||||
(c_node->state == IPP_STATE_STOP)) {
|
||||
DRM_DEBUG_KMS("%s:found cmd[%d]ippdrv[0x%x]\n",
|
||||
__func__, property->cmd, (int)ippdrv);
|
||||
DRM_DEBUG_KMS("found cmd[%d]ippdrv[0x%x]\n",
|
||||
property->cmd, (int)ippdrv);
|
||||
|
||||
c_node->property = *property;
|
||||
return 0;
|
||||
@@ -418,8 +408,6 @@ static struct drm_exynos_ipp_cmd_work *ipp_create_cmd_work(void)
|
||||
{
|
||||
struct drm_exynos_ipp_cmd_work *cmd_work;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
cmd_work = kzalloc(sizeof(*cmd_work), GFP_KERNEL);
|
||||
if (!cmd_work) {
|
||||
DRM_ERROR("failed to alloc cmd_work.\n");
|
||||
@@ -435,8 +423,6 @@ static struct drm_exynos_ipp_event_work *ipp_create_event_work(void)
|
||||
{
|
||||
struct drm_exynos_ipp_event_work *event_work;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
event_work = kzalloc(sizeof(*event_work), GFP_KERNEL);
|
||||
if (!event_work) {
|
||||
DRM_ERROR("failed to alloc event_work.\n");
|
||||
@@ -460,8 +446,6 @@ int exynos_drm_ipp_set_property(struct drm_device *drm_dev, void *data,
|
||||
struct drm_exynos_ipp_cmd_node *c_node;
|
||||
int ret, i;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
if (!ctx) {
|
||||
DRM_ERROR("invalid context.\n");
|
||||
return -EINVAL;
|
||||
@@ -486,7 +470,7 @@ int exynos_drm_ipp_set_property(struct drm_device *drm_dev, void *data,
|
||||
* instead of allocation.
|
||||
*/
|
||||
if (property->prop_id) {
|
||||
DRM_DEBUG_KMS("%s:prop_id[%d]\n", __func__, property->prop_id);
|
||||
DRM_DEBUG_KMS("prop_id[%d]\n", property->prop_id);
|
||||
return ipp_find_and_set_property(property);
|
||||
}
|
||||
|
||||
@@ -512,8 +496,8 @@ int exynos_drm_ipp_set_property(struct drm_device *drm_dev, void *data,
|
||||
goto err_clear;
|
||||
}
|
||||
|
||||
DRM_DEBUG_KMS("%s:created prop_id[%d]cmd[%d]ippdrv[0x%x]\n",
|
||||
__func__, property->prop_id, property->cmd, (int)ippdrv);
|
||||
DRM_DEBUG_KMS("created prop_id[%d]cmd[%d]ippdrv[0x%x]\n",
|
||||
property->prop_id, property->cmd, (int)ippdrv);
|
||||
|
||||
/* stored property information and ippdrv in private data */
|
||||
c_node->priv = priv;
|
||||
@@ -569,8 +553,6 @@ err_clear:
|
||||
|
||||
static void ipp_clean_cmd_node(struct drm_exynos_ipp_cmd_node *c_node)
|
||||
{
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
/* delete list */
|
||||
list_del(&c_node->list);
|
||||
|
||||
@@ -593,8 +575,6 @@ static int ipp_check_mem_list(struct drm_exynos_ipp_cmd_node *c_node)
|
||||
struct list_head *head;
|
||||
int ret, i, count[EXYNOS_DRM_OPS_MAX] = { 0, };
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
mutex_lock(&c_node->mem_lock);
|
||||
|
||||
for_each_ipp_ops(i) {
|
||||
@@ -602,20 +582,19 @@ static int ipp_check_mem_list(struct drm_exynos_ipp_cmd_node *c_node)
|
||||
head = &c_node->mem_list[i];
|
||||
|
||||
if (list_empty(head)) {
|
||||
DRM_DEBUG_KMS("%s:%s memory empty.\n", __func__,
|
||||
i ? "dst" : "src");
|
||||
DRM_DEBUG_KMS("%s memory empty.\n", i ? "dst" : "src");
|
||||
continue;
|
||||
}
|
||||
|
||||
/* find memory node entry */
|
||||
list_for_each_entry(m_node, head, list) {
|
||||
DRM_DEBUG_KMS("%s:%s,count[%d]m_node[0x%x]\n", __func__,
|
||||
DRM_DEBUG_KMS("%s,count[%d]m_node[0x%x]\n",
|
||||
i ? "dst" : "src", count[i], (int)m_node);
|
||||
count[i]++;
|
||||
}
|
||||
}
|
||||
|
||||
DRM_DEBUG_KMS("%s:min[%d]max[%d]\n", __func__,
|
||||
DRM_DEBUG_KMS("min[%d]max[%d]\n",
|
||||
min(count[EXYNOS_DRM_OPS_SRC], count[EXYNOS_DRM_OPS_DST]),
|
||||
max(count[EXYNOS_DRM_OPS_SRC], count[EXYNOS_DRM_OPS_DST]));
|
||||
|
||||
@@ -644,15 +623,14 @@ static struct drm_exynos_ipp_mem_node
|
||||
struct list_head *head;
|
||||
int count = 0;
|
||||
|
||||
DRM_DEBUG_KMS("%s:buf_id[%d]\n", __func__, qbuf->buf_id);
|
||||
DRM_DEBUG_KMS("buf_id[%d]\n", qbuf->buf_id);
|
||||
|
||||
/* source/destination memory list */
|
||||
head = &c_node->mem_list[qbuf->ops_id];
|
||||
|
||||
/* find memory node from memory list */
|
||||
list_for_each_entry(m_node, head, list) {
|
||||
DRM_DEBUG_KMS("%s:count[%d]m_node[0x%x]\n",
|
||||
__func__, count++, (int)m_node);
|
||||
DRM_DEBUG_KMS("count[%d]m_node[0x%x]\n", count++, (int)m_node);
|
||||
|
||||
/* compare buffer id */
|
||||
if (m_node->buf_id == qbuf->buf_id)
|
||||
@@ -669,7 +647,7 @@ static int ipp_set_mem_node(struct exynos_drm_ippdrv *ippdrv,
|
||||
struct exynos_drm_ipp_ops *ops = NULL;
|
||||
int ret = 0;
|
||||
|
||||
DRM_DEBUG_KMS("%s:node[0x%x]\n", __func__, (int)m_node);
|
||||
DRM_DEBUG_KMS("node[0x%x]\n", (int)m_node);
|
||||
|
||||
if (!m_node) {
|
||||
DRM_ERROR("invalid queue node.\n");
|
||||
@@ -678,7 +656,7 @@ static int ipp_set_mem_node(struct exynos_drm_ippdrv *ippdrv,
|
||||
|
||||
mutex_lock(&c_node->mem_lock);
|
||||
|
||||
DRM_DEBUG_KMS("%s:ops_id[%d]\n", __func__, m_node->ops_id);
|
||||
DRM_DEBUG_KMS("ops_id[%d]\n", m_node->ops_id);
|
||||
|
||||
/* get operations callback */
|
||||
ops = ippdrv->ops[m_node->ops_id];
|
||||
@@ -714,8 +692,6 @@ static struct drm_exynos_ipp_mem_node
|
||||
void *addr;
|
||||
int i;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
mutex_lock(&c_node->mem_lock);
|
||||
|
||||
m_node = kzalloc(sizeof(*m_node), GFP_KERNEL);
|
||||
@@ -732,14 +708,11 @@ static struct drm_exynos_ipp_mem_node
|
||||
m_node->prop_id = qbuf->prop_id;
|
||||
m_node->buf_id = qbuf->buf_id;
|
||||
|
||||
DRM_DEBUG_KMS("%s:m_node[0x%x]ops_id[%d]\n", __func__,
|
||||
(int)m_node, qbuf->ops_id);
|
||||
DRM_DEBUG_KMS("%s:prop_id[%d]buf_id[%d]\n", __func__,
|
||||
qbuf->prop_id, m_node->buf_id);
|
||||
DRM_DEBUG_KMS("m_node[0x%x]ops_id[%d]\n", (int)m_node, qbuf->ops_id);
|
||||
DRM_DEBUG_KMS("prop_id[%d]buf_id[%d]\n", qbuf->prop_id, m_node->buf_id);
|
||||
|
||||
for_each_ipp_planar(i) {
|
||||
DRM_DEBUG_KMS("%s:i[%d]handle[0x%x]\n", __func__,
|
||||
i, qbuf->handle[i]);
|
||||
DRM_DEBUG_KMS("i[%d]handle[0x%x]\n", i, qbuf->handle[i]);
|
||||
|
||||
/* get dma address by handle */
|
||||
if (qbuf->handle[i]) {
|
||||
@@ -752,9 +725,8 @@ static struct drm_exynos_ipp_mem_node
|
||||
|
||||
buf_info.handles[i] = qbuf->handle[i];
|
||||
buf_info.base[i] = *(dma_addr_t *) addr;
|
||||
DRM_DEBUG_KMS("%s:i[%d]base[0x%x]hd[0x%x]\n",
|
||||
__func__, i, buf_info.base[i],
|
||||
(int)buf_info.handles[i]);
|
||||
DRM_DEBUG_KMS("i[%d]base[0x%x]hd[0x%x]\n",
|
||||
i, buf_info.base[i], (int)buf_info.handles[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -778,7 +750,7 @@ static int ipp_put_mem_node(struct drm_device *drm_dev,
|
||||
{
|
||||
int i;
|
||||
|
||||
DRM_DEBUG_KMS("%s:node[0x%x]\n", __func__, (int)m_node);
|
||||
DRM_DEBUG_KMS("node[0x%x]\n", (int)m_node);
|
||||
|
||||
if (!m_node) {
|
||||
DRM_ERROR("invalid dequeue node.\n");
|
||||
@@ -792,7 +764,7 @@ static int ipp_put_mem_node(struct drm_device *drm_dev,
|
||||
|
||||
mutex_lock(&c_node->mem_lock);
|
||||
|
||||
DRM_DEBUG_KMS("%s:ops_id[%d]\n", __func__, m_node->ops_id);
|
||||
DRM_DEBUG_KMS("ops_id[%d]\n", m_node->ops_id);
|
||||
|
||||
/* put gem buffer */
|
||||
for_each_ipp_planar(i) {
|
||||
@@ -824,8 +796,7 @@ static int ipp_get_event(struct drm_device *drm_dev,
|
||||
struct drm_exynos_ipp_send_event *e;
|
||||
unsigned long flags;
|
||||
|
||||
DRM_DEBUG_KMS("%s:ops_id[%d]buf_id[%d]\n", __func__,
|
||||
qbuf->ops_id, qbuf->buf_id);
|
||||
DRM_DEBUG_KMS("ops_id[%d]buf_id[%d]\n", qbuf->ops_id, qbuf->buf_id);
|
||||
|
||||
e = kzalloc(sizeof(*e), GFP_KERNEL);
|
||||
|
||||
@@ -857,16 +828,13 @@ static void ipp_put_event(struct drm_exynos_ipp_cmd_node *c_node,
|
||||
struct drm_exynos_ipp_send_event *e, *te;
|
||||
int count = 0;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
if (list_empty(&c_node->event_list)) {
|
||||
DRM_DEBUG_KMS("%s:event_list is empty.\n", __func__);
|
||||
DRM_DEBUG_KMS("event_list is empty.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
list_for_each_entry_safe(e, te, &c_node->event_list, base.link) {
|
||||
DRM_DEBUG_KMS("%s:count[%d]e[0x%x]\n",
|
||||
__func__, count++, (int)e);
|
||||
DRM_DEBUG_KMS("count[%d]e[0x%x]\n", count++, (int)e);
|
||||
|
||||
/*
|
||||
* quf == NULL condition means all event deletion.
|
||||
@@ -912,8 +880,6 @@ static int ipp_queue_buf_with_run(struct device *dev,
|
||||
struct exynos_drm_ipp_ops *ops;
|
||||
int ret;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
ippdrv = ipp_find_drv_by_handle(qbuf->prop_id);
|
||||
if (IS_ERR(ippdrv)) {
|
||||
DRM_ERROR("failed to get ipp driver.\n");
|
||||
@@ -929,12 +895,12 @@ static int ipp_queue_buf_with_run(struct device *dev,
|
||||
property = &c_node->property;
|
||||
|
||||
if (c_node->state != IPP_STATE_START) {
|
||||
DRM_DEBUG_KMS("%s:bypass for invalid state.\n" , __func__);
|
||||
DRM_DEBUG_KMS("bypass for invalid state.\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!ipp_check_mem_list(c_node)) {
|
||||
DRM_DEBUG_KMS("%s:empty memory.\n", __func__);
|
||||
DRM_DEBUG_KMS("empty memory.\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -964,8 +930,6 @@ static void ipp_clean_queue_buf(struct drm_device *drm_dev,
|
||||
{
|
||||
struct drm_exynos_ipp_mem_node *m_node, *tm_node;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
if (!list_empty(&c_node->mem_list[qbuf->ops_id])) {
|
||||
/* delete list */
|
||||
list_for_each_entry_safe(m_node, tm_node,
|
||||
@@ -989,8 +953,6 @@ int exynos_drm_ipp_queue_buf(struct drm_device *drm_dev, void *data,
|
||||
struct drm_exynos_ipp_mem_node *m_node;
|
||||
int ret;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
if (!qbuf) {
|
||||
DRM_ERROR("invalid buf parameter.\n");
|
||||
return -EINVAL;
|
||||
@@ -1001,8 +963,8 @@ int exynos_drm_ipp_queue_buf(struct drm_device *drm_dev, void *data,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
DRM_DEBUG_KMS("%s:prop_id[%d]ops_id[%s]buf_id[%d]buf_type[%d]\n",
|
||||
__func__, qbuf->prop_id, qbuf->ops_id ? "dst" : "src",
|
||||
DRM_DEBUG_KMS("prop_id[%d]ops_id[%s]buf_id[%d]buf_type[%d]\n",
|
||||
qbuf->prop_id, qbuf->ops_id ? "dst" : "src",
|
||||
qbuf->buf_id, qbuf->buf_type);
|
||||
|
||||
/* find command node */
|
||||
@@ -1075,8 +1037,6 @@ err_clean_node:
|
||||
static bool exynos_drm_ipp_check_valid(struct device *dev,
|
||||
enum drm_exynos_ipp_ctrl ctrl, enum drm_exynos_ipp_state state)
|
||||
{
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
if (ctrl != IPP_CTRL_PLAY) {
|
||||
if (pm_runtime_suspended(dev)) {
|
||||
DRM_ERROR("pm:runtime_suspended.\n");
|
||||
@@ -1104,7 +1064,6 @@ static bool exynos_drm_ipp_check_valid(struct device *dev,
|
||||
default:
|
||||
DRM_ERROR("invalid state.\n");
|
||||
goto err_status;
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -1126,8 +1085,6 @@ int exynos_drm_ipp_cmd_ctrl(struct drm_device *drm_dev, void *data,
|
||||
struct drm_exynos_ipp_cmd_work *cmd_work;
|
||||
struct drm_exynos_ipp_cmd_node *c_node;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
if (!ctx) {
|
||||
DRM_ERROR("invalid context.\n");
|
||||
return -EINVAL;
|
||||
@@ -1138,7 +1095,7 @@ int exynos_drm_ipp_cmd_ctrl(struct drm_device *drm_dev, void *data,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
DRM_DEBUG_KMS("%s:ctrl[%d]prop_id[%d]\n", __func__,
|
||||
DRM_DEBUG_KMS("ctrl[%d]prop_id[%d]\n",
|
||||
cmd_ctrl->ctrl, cmd_ctrl->prop_id);
|
||||
|
||||
ippdrv = ipp_find_drv_by_handle(cmd_ctrl->prop_id);
|
||||
@@ -1213,7 +1170,7 @@ int exynos_drm_ipp_cmd_ctrl(struct drm_device *drm_dev, void *data,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
DRM_DEBUG_KMS("%s:done ctrl[%d]prop_id[%d]\n", __func__,
|
||||
DRM_DEBUG_KMS("done ctrl[%d]prop_id[%d]\n",
|
||||
cmd_ctrl->ctrl, cmd_ctrl->prop_id);
|
||||
|
||||
return 0;
|
||||
@@ -1249,7 +1206,7 @@ static int ipp_set_property(struct exynos_drm_ippdrv *ippdrv,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
DRM_DEBUG_KMS("%s:prop_id[%d]\n", __func__, property->prop_id);
|
||||
DRM_DEBUG_KMS("prop_id[%d]\n", property->prop_id);
|
||||
|
||||
/* reset h/w block */
|
||||
if (ippdrv->reset &&
|
||||
@@ -1310,13 +1267,13 @@ static int ipp_start_property(struct exynos_drm_ippdrv *ippdrv,
|
||||
struct list_head *head;
|
||||
int ret, i;
|
||||
|
||||
DRM_DEBUG_KMS("%s:prop_id[%d]\n", __func__, property->prop_id);
|
||||
DRM_DEBUG_KMS("prop_id[%d]\n", property->prop_id);
|
||||
|
||||
/* store command info in ippdrv */
|
||||
ippdrv->c_node = c_node;
|
||||
|
||||
if (!ipp_check_mem_list(c_node)) {
|
||||
DRM_DEBUG_KMS("%s:empty memory.\n", __func__);
|
||||
DRM_DEBUG_KMS("empty memory.\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
@@ -1343,8 +1300,7 @@ static int ipp_start_property(struct exynos_drm_ippdrv *ippdrv,
|
||||
return ret;
|
||||
}
|
||||
|
||||
DRM_DEBUG_KMS("%s:m_node[0x%x]\n",
|
||||
__func__, (int)m_node);
|
||||
DRM_DEBUG_KMS("m_node[0x%x]\n", (int)m_node);
|
||||
|
||||
ret = ipp_set_mem_node(ippdrv, c_node, m_node);
|
||||
if (ret) {
|
||||
@@ -1382,7 +1338,7 @@ static int ipp_start_property(struct exynos_drm_ippdrv *ippdrv,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
DRM_DEBUG_KMS("%s:cmd[%d]\n", __func__, property->cmd);
|
||||
DRM_DEBUG_KMS("cmd[%d]\n", property->cmd);
|
||||
|
||||
/* start operations */
|
||||
if (ippdrv->start) {
|
||||
@@ -1405,7 +1361,7 @@ static int ipp_stop_property(struct drm_device *drm_dev,
|
||||
struct list_head *head;
|
||||
int ret = 0, i;
|
||||
|
||||
DRM_DEBUG_KMS("%s:prop_id[%d]\n", __func__, property->prop_id);
|
||||
DRM_DEBUG_KMS("prop_id[%d]\n", property->prop_id);
|
||||
|
||||
/* put event */
|
||||
ipp_put_event(c_node, NULL);
|
||||
@@ -1418,8 +1374,7 @@ static int ipp_stop_property(struct drm_device *drm_dev,
|
||||
head = &c_node->mem_list[i];
|
||||
|
||||
if (list_empty(head)) {
|
||||
DRM_DEBUG_KMS("%s:mem_list is empty.\n",
|
||||
__func__);
|
||||
DRM_DEBUG_KMS("mem_list is empty.\n");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1439,7 +1394,7 @@ static int ipp_stop_property(struct drm_device *drm_dev,
|
||||
head = &c_node->mem_list[EXYNOS_DRM_OPS_DST];
|
||||
|
||||
if (list_empty(head)) {
|
||||
DRM_DEBUG_KMS("%s:mem_list is empty.\n", __func__);
|
||||
DRM_DEBUG_KMS("mem_list is empty.\n");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1456,7 +1411,7 @@ static int ipp_stop_property(struct drm_device *drm_dev,
|
||||
head = &c_node->mem_list[EXYNOS_DRM_OPS_SRC];
|
||||
|
||||
if (list_empty(head)) {
|
||||
DRM_DEBUG_KMS("%s:mem_list is empty.\n", __func__);
|
||||
DRM_DEBUG_KMS("mem_list is empty.\n");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1491,8 +1446,6 @@ void ipp_sched_cmd(struct work_struct *work)
|
||||
struct drm_exynos_ipp_property *property;
|
||||
int ret;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
ippdrv = cmd_work->ippdrv;
|
||||
if (!ippdrv) {
|
||||
DRM_ERROR("invalid ippdrv list.\n");
|
||||
@@ -1550,7 +1503,7 @@ void ipp_sched_cmd(struct work_struct *work)
|
||||
break;
|
||||
}
|
||||
|
||||
DRM_DEBUG_KMS("%s:ctrl[%d] done.\n", __func__, cmd_work->ctrl);
|
||||
DRM_DEBUG_KMS("ctrl[%d] done.\n", cmd_work->ctrl);
|
||||
|
||||
err_unlock:
|
||||
mutex_unlock(&c_node->cmd_lock);
|
||||
@@ -1571,8 +1524,7 @@ static int ipp_send_event(struct exynos_drm_ippdrv *ippdrv,
|
||||
int ret, i;
|
||||
|
||||
for_each_ipp_ops(i)
|
||||
DRM_DEBUG_KMS("%s:%s buf_id[%d]\n", __func__,
|
||||
i ? "dst" : "src", buf_id[i]);
|
||||
DRM_DEBUG_KMS("%s buf_id[%d]\n", i ? "dst" : "src", buf_id[i]);
|
||||
|
||||
if (!drm_dev) {
|
||||
DRM_ERROR("failed to get drm_dev.\n");
|
||||
@@ -1585,12 +1537,12 @@ static int ipp_send_event(struct exynos_drm_ippdrv *ippdrv,
|
||||
}
|
||||
|
||||
if (list_empty(&c_node->event_list)) {
|
||||
DRM_DEBUG_KMS("%s:event list is empty.\n", __func__);
|
||||
DRM_DEBUG_KMS("event list is empty.\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!ipp_check_mem_list(c_node)) {
|
||||
DRM_DEBUG_KMS("%s:empty memory.\n", __func__);
|
||||
DRM_DEBUG_KMS("empty memory.\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1609,7 +1561,7 @@ static int ipp_send_event(struct exynos_drm_ippdrv *ippdrv,
|
||||
}
|
||||
|
||||
tbuf_id[i] = m_node->buf_id;
|
||||
DRM_DEBUG_KMS("%s:%s buf_id[%d]\n", __func__,
|
||||
DRM_DEBUG_KMS("%s buf_id[%d]\n",
|
||||
i ? "dst" : "src", tbuf_id[i]);
|
||||
|
||||
ret = ipp_put_mem_node(drm_dev, c_node, m_node);
|
||||
@@ -1677,8 +1629,7 @@ static int ipp_send_event(struct exynos_drm_ippdrv *ippdrv,
|
||||
}
|
||||
|
||||
do_gettimeofday(&now);
|
||||
DRM_DEBUG_KMS("%s:tv_sec[%ld]tv_usec[%ld]\n"
|
||||
, __func__, now.tv_sec, now.tv_usec);
|
||||
DRM_DEBUG_KMS("tv_sec[%ld]tv_usec[%ld]\n", now.tv_sec, now.tv_usec);
|
||||
e->event.tv_sec = now.tv_sec;
|
||||
e->event.tv_usec = now.tv_usec;
|
||||
e->event.prop_id = property->prop_id;
|
||||
@@ -1692,7 +1643,7 @@ static int ipp_send_event(struct exynos_drm_ippdrv *ippdrv,
|
||||
wake_up_interruptible(&e->base.file_priv->event_wait);
|
||||
spin_unlock_irqrestore(&drm_dev->event_lock, flags);
|
||||
|
||||
DRM_DEBUG_KMS("%s:done cmd[%d]prop_id[%d]buf_id[%d]\n", __func__,
|
||||
DRM_DEBUG_KMS("done cmd[%d]prop_id[%d]buf_id[%d]\n",
|
||||
property->cmd, property->prop_id, tbuf_id[EXYNOS_DRM_OPS_DST]);
|
||||
|
||||
return 0;
|
||||
@@ -1711,8 +1662,7 @@ void ipp_sched_event(struct work_struct *work)
|
||||
return;
|
||||
}
|
||||
|
||||
DRM_DEBUG_KMS("%s:buf_id[%d]\n", __func__,
|
||||
event_work->buf_id[EXYNOS_DRM_OPS_DST]);
|
||||
DRM_DEBUG_KMS("buf_id[%d]\n", event_work->buf_id[EXYNOS_DRM_OPS_DST]);
|
||||
|
||||
ippdrv = event_work->ippdrv;
|
||||
if (!ippdrv) {
|
||||
@@ -1733,8 +1683,8 @@ void ipp_sched_event(struct work_struct *work)
|
||||
* or going out operations.
|
||||
*/
|
||||
if (c_node->state != IPP_STATE_START) {
|
||||
DRM_DEBUG_KMS("%s:bypass state[%d]prop_id[%d]\n",
|
||||
__func__, c_node->state, c_node->property.prop_id);
|
||||
DRM_DEBUG_KMS("bypass state[%d]prop_id[%d]\n",
|
||||
c_node->state, c_node->property.prop_id);
|
||||
goto err_completion;
|
||||
}
|
||||
|
||||
@@ -1759,8 +1709,6 @@ static int ipp_subdrv_probe(struct drm_device *drm_dev, struct device *dev)
|
||||
struct exynos_drm_ippdrv *ippdrv;
|
||||
int ret, count = 0;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
/* get ipp driver entry */
|
||||
list_for_each_entry(ippdrv, &exynos_drm_ippdrv_list, drv_list) {
|
||||
ippdrv->drm_dev = drm_dev;
|
||||
@@ -1772,7 +1720,7 @@ static int ipp_subdrv_probe(struct drm_device *drm_dev, struct device *dev)
|
||||
goto err_idr;
|
||||
}
|
||||
|
||||
DRM_DEBUG_KMS("%s:count[%d]ippdrv[0x%x]ipp_id[%d]\n", __func__,
|
||||
DRM_DEBUG_KMS("count[%d]ippdrv[0x%x]ipp_id[%d]\n",
|
||||
count++, (int)ippdrv, ippdrv->ipp_id);
|
||||
|
||||
if (ippdrv->ipp_id == 0) {
|
||||
@@ -1816,8 +1764,6 @@ static void ipp_subdrv_remove(struct drm_device *drm_dev, struct device *dev)
|
||||
{
|
||||
struct exynos_drm_ippdrv *ippdrv;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
/* get ipp driver entry */
|
||||
list_for_each_entry(ippdrv, &exynos_drm_ippdrv_list, drv_list) {
|
||||
if (is_drm_iommu_supported(drm_dev))
|
||||
@@ -1834,8 +1780,6 @@ static int ipp_subdrv_open(struct drm_device *drm_dev, struct device *dev,
|
||||
struct drm_exynos_file_private *file_priv = file->driver_priv;
|
||||
struct exynos_drm_ipp_private *priv;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
priv = kzalloc(sizeof(*priv), GFP_KERNEL);
|
||||
if (!priv) {
|
||||
DRM_ERROR("failed to allocate priv.\n");
|
||||
@@ -1846,7 +1790,7 @@ static int ipp_subdrv_open(struct drm_device *drm_dev, struct device *dev,
|
||||
|
||||
INIT_LIST_HEAD(&priv->event_list);
|
||||
|
||||
DRM_DEBUG_KMS("%s:done priv[0x%x]\n", __func__, (int)priv);
|
||||
DRM_DEBUG_KMS("done priv[0x%x]\n", (int)priv);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1860,10 +1804,10 @@ static void ipp_subdrv_close(struct drm_device *drm_dev, struct device *dev,
|
||||
struct drm_exynos_ipp_cmd_node *c_node, *tc_node;
|
||||
int count = 0;
|
||||
|
||||
DRM_DEBUG_KMS("%s:for priv[0x%x]\n", __func__, (int)priv);
|
||||
DRM_DEBUG_KMS("for priv[0x%x]\n", (int)priv);
|
||||
|
||||
if (list_empty(&exynos_drm_ippdrv_list)) {
|
||||
DRM_DEBUG_KMS("%s:ippdrv_list is empty.\n", __func__);
|
||||
DRM_DEBUG_KMS("ippdrv_list is empty.\n");
|
||||
goto err_clear;
|
||||
}
|
||||
|
||||
@@ -1873,8 +1817,8 @@ static void ipp_subdrv_close(struct drm_device *drm_dev, struct device *dev,
|
||||
|
||||
list_for_each_entry_safe(c_node, tc_node,
|
||||
&ippdrv->cmd_list, list) {
|
||||
DRM_DEBUG_KMS("%s:count[%d]ippdrv[0x%x]\n",
|
||||
__func__, count++, (int)ippdrv);
|
||||
DRM_DEBUG_KMS("count[%d]ippdrv[0x%x]\n",
|
||||
count++, (int)ippdrv);
|
||||
|
||||
if (c_node->priv == priv) {
|
||||
/*
|
||||
@@ -1913,8 +1857,6 @@ static int ipp_probe(struct platform_device *pdev)
|
||||
if (!ctx)
|
||||
return -ENOMEM;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
mutex_init(&ctx->ipp_lock);
|
||||
mutex_init(&ctx->prop_lock);
|
||||
|
||||
@@ -1978,8 +1920,6 @@ static int ipp_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct ipp_context *ctx = platform_get_drvdata(pdev);
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
/* unregister sub driver */
|
||||
exynos_drm_subdrv_unregister(&ctx->subdrv);
|
||||
|
||||
@@ -1999,7 +1939,7 @@ static int ipp_remove(struct platform_device *pdev)
|
||||
|
||||
static int ipp_power_ctrl(struct ipp_context *ctx, bool enable)
|
||||
{
|
||||
DRM_DEBUG_KMS("%s:enable[%d]\n", __func__, enable);
|
||||
DRM_DEBUG_KMS("enable[%d]\n", enable);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -2009,8 +1949,6 @@ static int ipp_suspend(struct device *dev)
|
||||
{
|
||||
struct ipp_context *ctx = get_ipp_context(dev);
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
if (pm_runtime_suspended(dev))
|
||||
return 0;
|
||||
|
||||
@@ -2021,8 +1959,6 @@ static int ipp_resume(struct device *dev)
|
||||
{
|
||||
struct ipp_context *ctx = get_ipp_context(dev);
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
if (!pm_runtime_suspended(dev))
|
||||
return ipp_power_ctrl(ctx, true);
|
||||
|
||||
@@ -2035,8 +1971,6 @@ static int ipp_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct ipp_context *ctx = get_ipp_context(dev);
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
return ipp_power_ctrl(ctx, false);
|
||||
}
|
||||
|
||||
@@ -2044,8 +1978,6 @@ static int ipp_runtime_resume(struct device *dev)
|
||||
{
|
||||
struct ipp_context *ctx = get_ipp_context(dev);
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
return ipp_power_ctrl(ctx, true);
|
||||
}
|
||||
#endif
|
||||
|
@@ -81,8 +81,6 @@ int exynos_plane_mode_set(struct drm_plane *plane, struct drm_crtc *crtc,
|
||||
int nr;
|
||||
int i;
|
||||
|
||||
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
|
||||
|
||||
nr = exynos_drm_fb_get_buf_cnt(fb);
|
||||
for (i = 0; i < nr; i++) {
|
||||
struct exynos_drm_gem_buf *buffer = exynos_drm_fb_buffer(fb, i);
|
||||
@@ -159,8 +157,6 @@ void exynos_plane_dpms(struct drm_plane *plane, int mode)
|
||||
struct exynos_plane *exynos_plane = to_exynos_plane(plane);
|
||||
struct exynos_drm_overlay *overlay = &exynos_plane->overlay;
|
||||
|
||||
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
|
||||
|
||||
if (mode == DRM_MODE_DPMS_ON) {
|
||||
if (exynos_plane->enabled)
|
||||
return;
|
||||
@@ -189,8 +185,6 @@ exynos_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
|
||||
{
|
||||
int ret;
|
||||
|
||||
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
|
||||
|
||||
ret = exynos_plane_mode_set(plane, crtc, fb, crtc_x, crtc_y,
|
||||
crtc_w, crtc_h, src_x >> 16, src_y >> 16,
|
||||
src_w >> 16, src_h >> 16);
|
||||
@@ -207,8 +201,6 @@ exynos_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
|
||||
|
||||
static int exynos_disable_plane(struct drm_plane *plane)
|
||||
{
|
||||
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
|
||||
|
||||
exynos_plane_dpms(plane, DRM_MODE_DPMS_OFF);
|
||||
|
||||
return 0;
|
||||
@@ -218,8 +210,6 @@ static void exynos_plane_destroy(struct drm_plane *plane)
|
||||
{
|
||||
struct exynos_plane *exynos_plane = to_exynos_plane(plane);
|
||||
|
||||
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
|
||||
|
||||
exynos_disable_plane(plane);
|
||||
drm_plane_cleanup(plane);
|
||||
kfree(exynos_plane);
|
||||
@@ -233,8 +223,6 @@ static int exynos_plane_set_property(struct drm_plane *plane,
|
||||
struct exynos_plane *exynos_plane = to_exynos_plane(plane);
|
||||
struct exynos_drm_private *dev_priv = dev->dev_private;
|
||||
|
||||
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
|
||||
|
||||
if (property == dev_priv->plane_zpos_property) {
|
||||
exynos_plane->overlay.zpos = val;
|
||||
return 0;
|
||||
@@ -256,8 +244,6 @@ static void exynos_plane_attach_zpos_property(struct drm_plane *plane)
|
||||
struct exynos_drm_private *dev_priv = dev->dev_private;
|
||||
struct drm_property *prop;
|
||||
|
||||
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
|
||||
|
||||
prop = dev_priv->plane_zpos_property;
|
||||
if (!prop) {
|
||||
prop = drm_property_create_range(dev, 0, "zpos", 0,
|
||||
@@ -277,8 +263,6 @@ struct drm_plane *exynos_plane_init(struct drm_device *dev,
|
||||
struct exynos_plane *exynos_plane;
|
||||
int err;
|
||||
|
||||
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
|
||||
|
||||
exynos_plane = kzalloc(sizeof(struct exynos_plane), GFP_KERNEL);
|
||||
if (!exynos_plane) {
|
||||
DRM_ERROR("failed to allocate plane\n");
|
||||
|
@@ -244,7 +244,7 @@ static int rotator_src_set_size(struct device *dev, int swap,
|
||||
/* Get format */
|
||||
fmt = rotator_reg_get_fmt(rot);
|
||||
if (!rotator_check_reg_fmt(fmt)) {
|
||||
DRM_ERROR("%s:invalid format.\n", __func__);
|
||||
DRM_ERROR("invalid format.\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -287,7 +287,7 @@ static int rotator_src_set_addr(struct device *dev,
|
||||
/* Get format */
|
||||
fmt = rotator_reg_get_fmt(rot);
|
||||
if (!rotator_check_reg_fmt(fmt)) {
|
||||
DRM_ERROR("%s:invalid format.\n", __func__);
|
||||
DRM_ERROR("invalid format.\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -381,7 +381,7 @@ static int rotator_dst_set_size(struct device *dev, int swap,
|
||||
/* Get format */
|
||||
fmt = rotator_reg_get_fmt(rot);
|
||||
if (!rotator_check_reg_fmt(fmt)) {
|
||||
DRM_ERROR("%s:invalid format.\n", __func__);
|
||||
DRM_ERROR("invalid format.\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -422,7 +422,7 @@ static int rotator_dst_set_addr(struct device *dev,
|
||||
/* Get format */
|
||||
fmt = rotator_reg_get_fmt(rot);
|
||||
if (!rotator_check_reg_fmt(fmt)) {
|
||||
DRM_ERROR("%s:invalid format.\n", __func__);
|
||||
DRM_ERROR("invalid format.\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -471,8 +471,6 @@ static int rotator_init_prop_list(struct exynos_drm_ippdrv *ippdrv)
|
||||
{
|
||||
struct drm_exynos_ipp_prop_list *prop_list;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
prop_list = devm_kzalloc(ippdrv->dev, sizeof(*prop_list), GFP_KERNEL);
|
||||
if (!prop_list) {
|
||||
DRM_ERROR("failed to alloc property list.\n");
|
||||
@@ -502,7 +500,7 @@ static inline bool rotator_check_drm_fmt(u32 fmt)
|
||||
case DRM_FORMAT_NV12:
|
||||
return true;
|
||||
default:
|
||||
DRM_DEBUG_KMS("%s:not support format\n", __func__);
|
||||
DRM_DEBUG_KMS("not support format\n");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -516,7 +514,7 @@ static inline bool rotator_check_drm_flip(enum drm_exynos_flip flip)
|
||||
case EXYNOS_DRM_FLIP_BOTH:
|
||||
return true;
|
||||
default:
|
||||
DRM_DEBUG_KMS("%s:invalid flip\n", __func__);
|
||||
DRM_DEBUG_KMS("invalid flip\n");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -536,19 +534,18 @@ static int rotator_ippdrv_check_property(struct device *dev,
|
||||
|
||||
/* Check format configuration */
|
||||
if (src_config->fmt != dst_config->fmt) {
|
||||
DRM_DEBUG_KMS("%s:not support csc feature\n", __func__);
|
||||
DRM_DEBUG_KMS("not support csc feature\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!rotator_check_drm_fmt(dst_config->fmt)) {
|
||||
DRM_DEBUG_KMS("%s:invalid format\n", __func__);
|
||||
DRM_DEBUG_KMS("invalid format\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Check transform configuration */
|
||||
if (src_config->degree != EXYNOS_DRM_DEGREE_0) {
|
||||
DRM_DEBUG_KMS("%s:not support source-side rotation\n",
|
||||
__func__);
|
||||
DRM_DEBUG_KMS("not support source-side rotation\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -561,51 +558,47 @@ static int rotator_ippdrv_check_property(struct device *dev,
|
||||
/* No problem */
|
||||
break;
|
||||
default:
|
||||
DRM_DEBUG_KMS("%s:invalid degree\n", __func__);
|
||||
DRM_DEBUG_KMS("invalid degree\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (src_config->flip != EXYNOS_DRM_FLIP_NONE) {
|
||||
DRM_DEBUG_KMS("%s:not support source-side flip\n", __func__);
|
||||
DRM_DEBUG_KMS("not support source-side flip\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!rotator_check_drm_flip(dst_config->flip)) {
|
||||
DRM_DEBUG_KMS("%s:invalid flip\n", __func__);
|
||||
DRM_DEBUG_KMS("invalid flip\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Check size configuration */
|
||||
if ((src_pos->x + src_pos->w > src_sz->hsize) ||
|
||||
(src_pos->y + src_pos->h > src_sz->vsize)) {
|
||||
DRM_DEBUG_KMS("%s:out of source buffer bound\n", __func__);
|
||||
DRM_DEBUG_KMS("out of source buffer bound\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (swap) {
|
||||
if ((dst_pos->x + dst_pos->h > dst_sz->vsize) ||
|
||||
(dst_pos->y + dst_pos->w > dst_sz->hsize)) {
|
||||
DRM_DEBUG_KMS("%s:out of destination buffer bound\n",
|
||||
__func__);
|
||||
DRM_DEBUG_KMS("out of destination buffer bound\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if ((src_pos->w != dst_pos->h) || (src_pos->h != dst_pos->w)) {
|
||||
DRM_DEBUG_KMS("%s:not support scale feature\n",
|
||||
__func__);
|
||||
DRM_DEBUG_KMS("not support scale feature\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
} else {
|
||||
if ((dst_pos->x + dst_pos->w > dst_sz->hsize) ||
|
||||
(dst_pos->y + dst_pos->h > dst_sz->vsize)) {
|
||||
DRM_DEBUG_KMS("%s:out of destination buffer bound\n",
|
||||
__func__);
|
||||
DRM_DEBUG_KMS("out of destination buffer bound\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if ((src_pos->w != dst_pos->w) || (src_pos->h != dst_pos->h)) {
|
||||
DRM_DEBUG_KMS("%s:not support scale feature\n",
|
||||
__func__);
|
||||
DRM_DEBUG_KMS("not support scale feature\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
@@ -693,7 +686,7 @@ static int rotator_probe(struct platform_device *pdev)
|
||||
goto err_ippdrv_register;
|
||||
}
|
||||
|
||||
DRM_DEBUG_KMS("%s:ippdrv[0x%x]\n", __func__, (int)ippdrv);
|
||||
DRM_DEBUG_KMS("ippdrv[0x%x]\n", (int)ippdrv);
|
||||
|
||||
platform_set_drvdata(pdev, rot);
|
||||
|
||||
@@ -752,8 +745,6 @@ static struct platform_device_id rotator_driver_ids[] = {
|
||||
|
||||
static int rotator_clk_crtl(struct rot_context *rot, bool enable)
|
||||
{
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
if (enable) {
|
||||
clk_enable(rot->clock);
|
||||
rot->suspended = false;
|
||||
@@ -771,8 +762,6 @@ static int rotator_suspend(struct device *dev)
|
||||
{
|
||||
struct rot_context *rot = dev_get_drvdata(dev);
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
if (pm_runtime_suspended(dev))
|
||||
return 0;
|
||||
|
||||
@@ -783,8 +772,6 @@ static int rotator_resume(struct device *dev)
|
||||
{
|
||||
struct rot_context *rot = dev_get_drvdata(dev);
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
if (!pm_runtime_suspended(dev))
|
||||
return rotator_clk_crtl(rot, true);
|
||||
|
||||
@@ -797,8 +784,6 @@ static int rotator_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct rot_context *rot = dev_get_drvdata(dev);
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
return rotator_clk_crtl(rot, false);
|
||||
}
|
||||
|
||||
@@ -806,8 +791,6 @@ static int rotator_runtime_resume(struct device *dev)
|
||||
{
|
||||
struct rot_context *rot = dev_get_drvdata(dev);
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __func__);
|
||||
|
||||
return rotator_clk_crtl(rot, true);
|
||||
}
|
||||
#endif
|
||||
|
@@ -89,8 +89,6 @@ static bool vidi_display_is_connected(struct device *dev)
|
||||
{
|
||||
struct vidi_context *ctx = get_vidi_context(dev);
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
/*
|
||||
* connection request would come from user side
|
||||
* to do hotplug through specific ioctl.
|
||||
@@ -105,8 +103,6 @@ static struct edid *vidi_get_edid(struct device *dev,
|
||||
struct edid *edid;
|
||||
int edid_len;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
/*
|
||||
* the edid data comes from user side and it would be set
|
||||
* to ctx->raw_edid through specific ioctl.
|
||||
@@ -128,17 +124,13 @@ static struct edid *vidi_get_edid(struct device *dev,
|
||||
|
||||
static void *vidi_get_panel(struct device *dev)
|
||||
{
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
/* TODO. */
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int vidi_check_timing(struct device *dev, void *timing)
|
||||
static int vidi_check_mode(struct device *dev, struct drm_display_mode *mode)
|
||||
{
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
/* TODO. */
|
||||
|
||||
return 0;
|
||||
@@ -146,8 +138,6 @@ static int vidi_check_timing(struct device *dev, void *timing)
|
||||
|
||||
static int vidi_display_power_on(struct device *dev, int mode)
|
||||
{
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
/* TODO */
|
||||
|
||||
return 0;
|
||||
@@ -158,7 +148,7 @@ static struct exynos_drm_display_ops vidi_display_ops = {
|
||||
.is_connected = vidi_display_is_connected,
|
||||
.get_edid = vidi_get_edid,
|
||||
.get_panel = vidi_get_panel,
|
||||
.check_timing = vidi_check_timing,
|
||||
.check_mode = vidi_check_mode,
|
||||
.power_on = vidi_display_power_on,
|
||||
};
|
||||
|
||||
@@ -166,7 +156,7 @@ static void vidi_dpms(struct device *subdrv_dev, int mode)
|
||||
{
|
||||
struct vidi_context *ctx = get_vidi_context(subdrv_dev);
|
||||
|
||||
DRM_DEBUG_KMS("%s, %d\n", __FILE__, mode);
|
||||
DRM_DEBUG_KMS("%d\n", mode);
|
||||
|
||||
mutex_lock(&ctx->lock);
|
||||
|
||||
@@ -196,8 +186,6 @@ static void vidi_apply(struct device *subdrv_dev)
|
||||
struct vidi_win_data *win_data;
|
||||
int i;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
for (i = 0; i < WINDOWS_NR; i++) {
|
||||
win_data = &ctx->win_data[i];
|
||||
if (win_data->enabled && (ovl_ops && ovl_ops->commit))
|
||||
@@ -212,8 +200,6 @@ static void vidi_commit(struct device *dev)
|
||||
{
|
||||
struct vidi_context *ctx = get_vidi_context(dev);
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
if (ctx->suspended)
|
||||
return;
|
||||
}
|
||||
@@ -222,8 +208,6 @@ static int vidi_enable_vblank(struct device *dev)
|
||||
{
|
||||
struct vidi_context *ctx = get_vidi_context(dev);
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
if (ctx->suspended)
|
||||
return -EPERM;
|
||||
|
||||
@@ -246,8 +230,6 @@ static void vidi_disable_vblank(struct device *dev)
|
||||
{
|
||||
struct vidi_context *ctx = get_vidi_context(dev);
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
if (ctx->suspended)
|
||||
return;
|
||||
|
||||
@@ -271,8 +253,6 @@ static void vidi_win_mode_set(struct device *dev,
|
||||
int win;
|
||||
unsigned long offset;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
if (!overlay) {
|
||||
dev_err(dev, "overlay is NULL\n");
|
||||
return;
|
||||
@@ -282,7 +262,7 @@ static void vidi_win_mode_set(struct device *dev,
|
||||
if (win == DEFAULT_ZPOS)
|
||||
win = ctx->default_win;
|
||||
|
||||
if (win < 0 || win > WINDOWS_NR)
|
||||
if (win < 0 || win >= WINDOWS_NR)
|
||||
return;
|
||||
|
||||
offset = overlay->fb_x * (overlay->bpp >> 3);
|
||||
@@ -324,15 +304,13 @@ static void vidi_win_commit(struct device *dev, int zpos)
|
||||
struct vidi_win_data *win_data;
|
||||
int win = zpos;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
if (ctx->suspended)
|
||||
return;
|
||||
|
||||
if (win == DEFAULT_ZPOS)
|
||||
win = ctx->default_win;
|
||||
|
||||
if (win < 0 || win > WINDOWS_NR)
|
||||
if (win < 0 || win >= WINDOWS_NR)
|
||||
return;
|
||||
|
||||
win_data = &ctx->win_data[win];
|
||||
@@ -351,12 +329,10 @@ static void vidi_win_disable(struct device *dev, int zpos)
|
||||
struct vidi_win_data *win_data;
|
||||
int win = zpos;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
if (win == DEFAULT_ZPOS)
|
||||
win = ctx->default_win;
|
||||
|
||||
if (win < 0 || win > WINDOWS_NR)
|
||||
if (win < 0 || win >= WINDOWS_NR)
|
||||
return;
|
||||
|
||||
win_data = &ctx->win_data[win];
|
||||
@@ -407,8 +383,6 @@ static void vidi_fake_vblank_handler(struct work_struct *work)
|
||||
|
||||
static int vidi_subdrv_probe(struct drm_device *drm_dev, struct device *dev)
|
||||
{
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
/*
|
||||
* enable drm irq mode.
|
||||
* - with irq_enabled = 1, we can use the vblank feature.
|
||||
@@ -431,8 +405,6 @@ static int vidi_subdrv_probe(struct drm_device *drm_dev, struct device *dev)
|
||||
|
||||
static void vidi_subdrv_remove(struct drm_device *drm_dev, struct device *dev)
|
||||
{
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
/* TODO. */
|
||||
}
|
||||
|
||||
@@ -441,8 +413,6 @@ static int vidi_power_on(struct vidi_context *ctx, bool enable)
|
||||
struct exynos_drm_subdrv *subdrv = &ctx->subdrv;
|
||||
struct device *dev = subdrv->dev;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
if (enable != false && enable != true)
|
||||
return -EINVAL;
|
||||
|
||||
@@ -483,8 +453,6 @@ static int vidi_store_connection(struct device *dev,
|
||||
struct vidi_context *ctx = get_vidi_context(dev);
|
||||
int ret;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
ret = kstrtoint(buf, 0, &ctx->connected);
|
||||
if (ret)
|
||||
return ret;
|
||||
@@ -522,8 +490,6 @@ int vidi_connection_ioctl(struct drm_device *drm_dev, void *data,
|
||||
struct drm_exynos_vidi_connection *vidi = data;
|
||||
int edid_len;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
if (!vidi) {
|
||||
DRM_DEBUG_KMS("user data for vidi is null.\n");
|
||||
return -EINVAL;
|
||||
@@ -592,8 +558,6 @@ static int vidi_probe(struct platform_device *pdev)
|
||||
struct exynos_drm_subdrv *subdrv;
|
||||
int ret;
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
|
||||
if (!ctx)
|
||||
return -ENOMEM;
|
||||
@@ -625,8 +589,6 @@ static int vidi_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct vidi_context *ctx = platform_get_drvdata(pdev);
|
||||
|
||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||
|
||||
exynos_drm_subdrv_unregister(&ctx->subdrv);
|
||||
|
||||
if (ctx->raw_edid != (struct edid *)fake_edid_info) {
|
||||
|
@@ -83,6 +83,7 @@ struct hdmi_resources {
|
||||
struct clk *sclk_pixel;
|
||||
struct clk *sclk_hdmiphy;
|
||||
struct clk *hdmiphy;
|
||||
struct clk *mout_hdmi;
|
||||
struct regulator_bulk_data *regul_bulk;
|
||||
int regul_count;
|
||||
};
|
||||
@@ -689,8 +690,6 @@ static void hdmi_reg_infoframe(struct hdmi_context *hdata,
|
||||
u32 mod;
|
||||
u32 vic;
|
||||
|
||||
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
|
||||
|
||||
mod = hdmi_reg_read(hdata, HDMI_MODE_SEL);
|
||||
if (hdata->dvi_mode) {
|
||||
hdmi_reg_writeb(hdata, HDMI_VSI_CON,
|
||||
@@ -755,8 +754,6 @@ static struct edid *hdmi_get_edid(void *ctx, struct drm_connector *connector)
|
||||
struct edid *raw_edid;
|
||||
struct hdmi_context *hdata = ctx;
|
||||
|
||||
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
|
||||
|
||||
if (!hdata->ddc_port)
|
||||
return ERR_PTR(-ENODEV);
|
||||
|
||||
@@ -777,8 +774,6 @@ static int hdmi_find_phy_conf(struct hdmi_context *hdata, u32 pixel_clock)
|
||||
const struct hdmiphy_config *confs;
|
||||
int count, i;
|
||||
|
||||
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
|
||||
|
||||
if (hdata->type == HDMI_TYPE13) {
|
||||
confs = hdmiphy_v13_configs;
|
||||
count = ARRAY_SIZE(hdmiphy_v13_configs);
|
||||
@@ -796,18 +791,17 @@ static int hdmi_find_phy_conf(struct hdmi_context *hdata, u32 pixel_clock)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static int hdmi_check_timing(void *ctx, struct fb_videomode *timing)
|
||||
static int hdmi_check_mode(void *ctx, struct drm_display_mode *mode)
|
||||
{
|
||||
struct hdmi_context *hdata = ctx;
|
||||
int ret;
|
||||
|
||||
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
|
||||
DRM_DEBUG_KMS("xres=%d, yres=%d, refresh=%d, intl=%d clock=%d\n",
|
||||
mode->hdisplay, mode->vdisplay, mode->vrefresh,
|
||||
(mode->flags & DRM_MODE_FLAG_INTERLACE) ? true :
|
||||
false, mode->clock * 1000);
|
||||
|
||||
DRM_DEBUG_KMS("[%d]x[%d] [%d]Hz [%x]\n", timing->xres,
|
||||
timing->yres, timing->refresh,
|
||||
timing->vmode);
|
||||
|
||||
ret = hdmi_find_phy_conf(hdata, timing->pixclock);
|
||||
ret = hdmi_find_phy_conf(hdata, mode->clock * 1000);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
return 0;
|
||||
@@ -1042,7 +1036,7 @@ static void hdmi_conf_init(struct hdmi_context *hdata)
|
||||
}
|
||||
}
|
||||
|
||||
static void hdmi_v13_timing_apply(struct hdmi_context *hdata)
|
||||
static void hdmi_v13_mode_apply(struct hdmi_context *hdata)
|
||||
{
|
||||
const struct hdmi_tg_regs *tg = &hdata->mode_conf.conf.v13_conf.tg;
|
||||
const struct hdmi_v13_core_regs *core =
|
||||
@@ -1118,9 +1112,9 @@ static void hdmi_v13_timing_apply(struct hdmi_context *hdata)
|
||||
hdmi_regs_dump(hdata, "timing apply");
|
||||
}
|
||||
|
||||
clk_disable(hdata->res.sclk_hdmi);
|
||||
clk_set_parent(hdata->res.sclk_hdmi, hdata->res.sclk_hdmiphy);
|
||||
clk_enable(hdata->res.sclk_hdmi);
|
||||
clk_disable_unprepare(hdata->res.sclk_hdmi);
|
||||
clk_set_parent(hdata->res.mout_hdmi, hdata->res.sclk_hdmiphy);
|
||||
clk_prepare_enable(hdata->res.sclk_hdmi);
|
||||
|
||||
/* enable HDMI and timing generator */
|
||||
hdmi_reg_writemask(hdata, HDMI_CON_0, ~0, HDMI_EN);
|
||||
@@ -1131,7 +1125,7 @@ static void hdmi_v13_timing_apply(struct hdmi_context *hdata)
|
||||
hdmi_reg_writemask(hdata, HDMI_TG_CMD, ~0, HDMI_TG_EN);
|
||||
}
|
||||
|
||||
static void hdmi_v14_timing_apply(struct hdmi_context *hdata)
|
||||
static void hdmi_v14_mode_apply(struct hdmi_context *hdata)
|
||||
{
|
||||
const struct hdmi_tg_regs *tg = &hdata->mode_conf.conf.v14_conf.tg;
|
||||
const struct hdmi_v14_core_regs *core =
|
||||
@@ -1285,9 +1279,9 @@ static void hdmi_v14_timing_apply(struct hdmi_context *hdata)
|
||||
hdmi_regs_dump(hdata, "timing apply");
|
||||
}
|
||||
|
||||
clk_disable(hdata->res.sclk_hdmi);
|
||||
clk_set_parent(hdata->res.sclk_hdmi, hdata->res.sclk_hdmiphy);
|
||||
clk_enable(hdata->res.sclk_hdmi);
|
||||
clk_disable_unprepare(hdata->res.sclk_hdmi);
|
||||
clk_set_parent(hdata->res.mout_hdmi, hdata->res.sclk_hdmiphy);
|
||||
clk_prepare_enable(hdata->res.sclk_hdmi);
|
||||
|
||||
/* enable HDMI and timing generator */
|
||||
hdmi_reg_writemask(hdata, HDMI_CON_0, ~0, HDMI_EN);
|
||||
@@ -1298,12 +1292,12 @@ static void hdmi_v14_timing_apply(struct hdmi_context *hdata)
|
||||
hdmi_reg_writemask(hdata, HDMI_TG_CMD, ~0, HDMI_TG_EN);
|
||||
}
|
||||
|
||||
static void hdmi_timing_apply(struct hdmi_context *hdata)
|
||||
static void hdmi_mode_apply(struct hdmi_context *hdata)
|
||||
{
|
||||
if (hdata->type == HDMI_TYPE13)
|
||||
hdmi_v13_timing_apply(hdata);
|
||||
hdmi_v13_mode_apply(hdata);
|
||||
else
|
||||
hdmi_v14_timing_apply(hdata);
|
||||
hdmi_v14_mode_apply(hdata);
|
||||
}
|
||||
|
||||
static void hdmiphy_conf_reset(struct hdmi_context *hdata)
|
||||
@@ -1311,9 +1305,9 @@ static void hdmiphy_conf_reset(struct hdmi_context *hdata)
|
||||
u8 buffer[2];
|
||||
u32 reg;
|
||||
|
||||
clk_disable(hdata->res.sclk_hdmi);
|
||||
clk_set_parent(hdata->res.sclk_hdmi, hdata->res.sclk_pixel);
|
||||
clk_enable(hdata->res.sclk_hdmi);
|
||||
clk_disable_unprepare(hdata->res.sclk_hdmi);
|
||||
clk_set_parent(hdata->res.mout_hdmi, hdata->res.sclk_pixel);
|
||||
clk_prepare_enable(hdata->res.sclk_hdmi);
|
||||
|
||||
/* operation mode */
|
||||
buffer[0] = 0x1f;
|
||||
@@ -1336,8 +1330,6 @@ static void hdmiphy_conf_reset(struct hdmi_context *hdata)
|
||||
|
||||
static void hdmiphy_poweron(struct hdmi_context *hdata)
|
||||
{
|
||||
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
|
||||
|
||||
if (hdata->type == HDMI_TYPE14)
|
||||
hdmi_reg_writemask(hdata, HDMI_PHY_CON_0, 0,
|
||||
HDMI_PHY_POWER_OFF_EN);
|
||||
@@ -1345,8 +1337,6 @@ static void hdmiphy_poweron(struct hdmi_context *hdata)
|
||||
|
||||
static void hdmiphy_poweroff(struct hdmi_context *hdata)
|
||||
{
|
||||
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
|
||||
|
||||
if (hdata->type == HDMI_TYPE14)
|
||||
hdmi_reg_writemask(hdata, HDMI_PHY_CON_0, ~0,
|
||||
HDMI_PHY_POWER_OFF_EN);
|
||||
@@ -1410,8 +1400,6 @@ static void hdmiphy_conf_apply(struct hdmi_context *hdata)
|
||||
|
||||
static void hdmi_conf_apply(struct hdmi_context *hdata)
|
||||
{
|
||||
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
|
||||
|
||||
hdmiphy_conf_reset(hdata);
|
||||
hdmiphy_conf_apply(hdata);
|
||||
|
||||
@@ -1423,7 +1411,7 @@ static void hdmi_conf_apply(struct hdmi_context *hdata)
|
||||
hdmi_audio_init(hdata);
|
||||
|
||||
/* setting core registers */
|
||||
hdmi_timing_apply(hdata);
|
||||
hdmi_mode_apply(hdata);
|
||||
hdmi_audio_control(hdata, true);
|
||||
|
||||
hdmi_regs_dump(hdata, "start");
|
||||
@@ -1569,8 +1557,7 @@ static void hdmi_v14_mode_set(struct hdmi_context *hdata,
|
||||
(m->vsync_start - m->vdisplay) / 2);
|
||||
hdmi_set_reg(core->v2_blank, 2, m->vtotal / 2);
|
||||
hdmi_set_reg(core->v1_blank, 2, (m->vtotal - m->vdisplay) / 2);
|
||||
hdmi_set_reg(core->v_blank_f0, 2, (m->vtotal +
|
||||
((m->vsync_end - m->vsync_start) * 4) + 5) / 2);
|
||||
hdmi_set_reg(core->v_blank_f0, 2, m->vtotal - m->vdisplay / 2);
|
||||
hdmi_set_reg(core->v_blank_f1, 2, m->vtotal);
|
||||
hdmi_set_reg(core->v_sync_line_aft_2, 2, (m->vtotal / 2) + 7);
|
||||
hdmi_set_reg(core->v_sync_line_aft_1, 2, (m->vtotal / 2) + 2);
|
||||
@@ -1580,7 +1567,10 @@ static void hdmi_v14_mode_set(struct hdmi_context *hdata,
|
||||
(m->htotal / 2) + (m->hsync_start - m->hdisplay));
|
||||
hdmi_set_reg(tg->vact_st, 2, (m->vtotal - m->vdisplay) / 2);
|
||||
hdmi_set_reg(tg->vact_sz, 2, m->vdisplay / 2);
|
||||
hdmi_set_reg(tg->vact_st2, 2, 0x249);/* Reset value + 1*/
|
||||
hdmi_set_reg(tg->vact_st2, 2, m->vtotal - m->vdisplay / 2);
|
||||
hdmi_set_reg(tg->vsync2, 2, (m->vtotal / 2) + 1);
|
||||
hdmi_set_reg(tg->vsync_bot_hdmi, 2, (m->vtotal / 2) + 1);
|
||||
hdmi_set_reg(tg->field_bot_hdmi, 2, (m->vtotal / 2) + 1);
|
||||
hdmi_set_reg(tg->vact_st3, 2, 0x0);
|
||||
hdmi_set_reg(tg->vact_st4, 2, 0x0);
|
||||
} else {
|
||||
@@ -1602,6 +1592,9 @@ static void hdmi_v14_mode_set(struct hdmi_context *hdata,
|
||||
hdmi_set_reg(tg->vact_st2, 2, 0x248); /* Reset value */
|
||||
hdmi_set_reg(tg->vact_st3, 2, 0x47b); /* Reset value */
|
||||
hdmi_set_reg(tg->vact_st4, 2, 0x6ae); /* Reset value */
|
||||
hdmi_set_reg(tg->vsync2, 2, 0x233); /* Reset value */
|
||||
hdmi_set_reg(tg->vsync_bot_hdmi, 2, 0x233); /* Reset value */
|
||||
hdmi_set_reg(tg->field_bot_hdmi, 2, 0x233); /* Reset value */
|
||||
}
|
||||
|
||||
/* Following values & calculations are same irrespective of mode type */
|
||||
@@ -1633,22 +1626,19 @@ static void hdmi_v14_mode_set(struct hdmi_context *hdata,
|
||||
hdmi_set_reg(tg->hact_sz, 2, m->hdisplay);
|
||||
hdmi_set_reg(tg->v_fsz, 2, m->vtotal);
|
||||
hdmi_set_reg(tg->vsync, 2, 0x1);
|
||||
hdmi_set_reg(tg->vsync2, 2, 0x233); /* Reset value */
|
||||
hdmi_set_reg(tg->field_chg, 2, 0x233); /* Reset value */
|
||||
hdmi_set_reg(tg->vsync_top_hdmi, 2, 0x1); /* Reset value */
|
||||
hdmi_set_reg(tg->vsync_bot_hdmi, 2, 0x233); /* Reset value */
|
||||
hdmi_set_reg(tg->field_top_hdmi, 2, 0x1); /* Reset value */
|
||||
hdmi_set_reg(tg->field_bot_hdmi, 2, 0x233); /* Reset value */
|
||||
hdmi_set_reg(tg->tg_3d, 1, 0x0);
|
||||
}
|
||||
|
||||
static void hdmi_mode_set(void *ctx, void *mode)
|
||||
static void hdmi_mode_set(void *ctx, struct drm_display_mode *mode)
|
||||
{
|
||||
struct hdmi_context *hdata = ctx;
|
||||
struct drm_display_mode *m = mode;
|
||||
|
||||
DRM_DEBUG_KMS("[%s]: xres=%d, yres=%d, refresh=%d, intl=%s\n",
|
||||
__func__, m->hdisplay, m->vdisplay,
|
||||
DRM_DEBUG_KMS("xres=%d, yres=%d, refresh=%d, intl=%s\n",
|
||||
m->hdisplay, m->vdisplay,
|
||||
m->vrefresh, (m->flags & DRM_MODE_FLAG_INTERLACE) ?
|
||||
"INTERLACED" : "PROGERESSIVE");
|
||||
|
||||
@@ -1661,8 +1651,6 @@ static void hdmi_mode_set(void *ctx, void *mode)
|
||||
static void hdmi_get_max_resol(void *ctx, unsigned int *width,
|
||||
unsigned int *height)
|
||||
{
|
||||
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
|
||||
|
||||
*width = MAX_WIDTH;
|
||||
*height = MAX_HEIGHT;
|
||||
}
|
||||
@@ -1671,8 +1659,6 @@ static void hdmi_commit(void *ctx)
|
||||
{
|
||||
struct hdmi_context *hdata = ctx;
|
||||
|
||||
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
|
||||
|
||||
mutex_lock(&hdata->hdmi_mutex);
|
||||
if (!hdata->powered) {
|
||||
mutex_unlock(&hdata->hdmi_mutex);
|
||||
@@ -1687,8 +1673,6 @@ static void hdmi_poweron(struct hdmi_context *hdata)
|
||||
{
|
||||
struct hdmi_resources *res = &hdata->res;
|
||||
|
||||
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
|
||||
|
||||
mutex_lock(&hdata->hdmi_mutex);
|
||||
if (hdata->powered) {
|
||||
mutex_unlock(&hdata->hdmi_mutex);
|
||||
@@ -1699,10 +1683,12 @@ static void hdmi_poweron(struct hdmi_context *hdata)
|
||||
|
||||
mutex_unlock(&hdata->hdmi_mutex);
|
||||
|
||||
regulator_bulk_enable(res->regul_count, res->regul_bulk);
|
||||
clk_enable(res->hdmiphy);
|
||||
clk_enable(res->hdmi);
|
||||
clk_enable(res->sclk_hdmi);
|
||||
if (regulator_bulk_enable(res->regul_count, res->regul_bulk))
|
||||
DRM_DEBUG_KMS("failed to enable regulator bulk\n");
|
||||
|
||||
clk_prepare_enable(res->hdmiphy);
|
||||
clk_prepare_enable(res->hdmi);
|
||||
clk_prepare_enable(res->sclk_hdmi);
|
||||
|
||||
hdmiphy_poweron(hdata);
|
||||
}
|
||||
@@ -1711,8 +1697,6 @@ static void hdmi_poweroff(struct hdmi_context *hdata)
|
||||
{
|
||||
struct hdmi_resources *res = &hdata->res;
|
||||
|
||||
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
|
||||
|
||||
mutex_lock(&hdata->hdmi_mutex);
|
||||
if (!hdata->powered)
|
||||
goto out;
|
||||
@@ -1725,9 +1709,9 @@ static void hdmi_poweroff(struct hdmi_context *hdata)
|
||||
hdmiphy_conf_reset(hdata);
|
||||
hdmiphy_poweroff(hdata);
|
||||
|
||||
clk_disable(res->sclk_hdmi);
|
||||
clk_disable(res->hdmi);
|
||||
clk_disable(res->hdmiphy);
|
||||
clk_disable_unprepare(res->sclk_hdmi);
|
||||
clk_disable_unprepare(res->hdmi);
|
||||
clk_disable_unprepare(res->hdmiphy);
|
||||
regulator_bulk_disable(res->regul_count, res->regul_bulk);
|
||||
|
||||
mutex_lock(&hdata->hdmi_mutex);
|
||||
@@ -1742,7 +1726,7 @@ static void hdmi_dpms(void *ctx, int mode)
|
||||
{
|
||||
struct hdmi_context *hdata = ctx;
|
||||
|
||||
DRM_DEBUG_KMS("[%d] %s mode %d\n", __LINE__, __func__, mode);
|
||||
DRM_DEBUG_KMS("mode %d\n", mode);
|
||||
|
||||
switch (mode) {
|
||||
case DRM_MODE_DPMS_ON:
|
||||
@@ -1765,7 +1749,7 @@ static struct exynos_hdmi_ops hdmi_ops = {
|
||||
/* display */
|
||||
.is_connected = hdmi_is_connected,
|
||||
.get_edid = hdmi_get_edid,
|
||||
.check_timing = hdmi_check_timing,
|
||||
.check_mode = hdmi_check_mode,
|
||||
|
||||
/* manager */
|
||||
.mode_set = hdmi_mode_set,
|
||||
@@ -1831,8 +1815,13 @@ static int hdmi_resources_init(struct hdmi_context *hdata)
|
||||
DRM_ERROR("failed to get clock 'hdmiphy'\n");
|
||||
goto fail;
|
||||
}
|
||||
res->mout_hdmi = devm_clk_get(dev, "mout_hdmi");
|
||||
if (IS_ERR(res->mout_hdmi)) {
|
||||
DRM_ERROR("failed to get clock 'mout_hdmi'\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
clk_set_parent(res->sclk_hdmi, res->sclk_pixel);
|
||||
clk_set_parent(res->mout_hdmi, res->sclk_pixel);
|
||||
|
||||
res->regul_bulk = devm_kzalloc(dev, ARRAY_SIZE(supply) *
|
||||
sizeof(res->regul_bulk[0]), GFP_KERNEL);
|
||||
@@ -1877,7 +1866,6 @@ static struct s5p_hdmi_platform_data *drm_hdmi_dt_parse_pdata
|
||||
{
|
||||
struct device_node *np = dev->of_node;
|
||||
struct s5p_hdmi_platform_data *pd;
|
||||
enum of_gpio_flags flags;
|
||||
u32 value;
|
||||
|
||||
pd = devm_kzalloc(dev, sizeof(*pd), GFP_KERNEL);
|
||||
@@ -1891,7 +1879,7 @@ static struct s5p_hdmi_platform_data *drm_hdmi_dt_parse_pdata
|
||||
goto err_data;
|
||||
}
|
||||
|
||||
pd->hpd_gpio = of_get_named_gpio_flags(np, "hpd-gpio", 0, &flags);
|
||||
pd->hpd_gpio = of_get_named_gpio(np, "hpd-gpio", 0);
|
||||
|
||||
return pd;
|
||||
|
||||
@@ -1929,6 +1917,9 @@ static struct of_device_id hdmi_match_types[] = {
|
||||
{
|
||||
.compatible = "samsung,exynos5-hdmi",
|
||||
.data = (void *)HDMI_TYPE14,
|
||||
}, {
|
||||
.compatible = "samsung,exynos4212-hdmi",
|
||||
.data = (void *)HDMI_TYPE14,
|
||||
}, {
|
||||
/* end node */
|
||||
}
|
||||
@@ -1944,8 +1935,6 @@ static int hdmi_probe(struct platform_device *pdev)
|
||||
struct resource *res;
|
||||
int ret;
|
||||
|
||||
DRM_DEBUG_KMS("[%d]\n", __LINE__);
|
||||
|
||||
if (dev->of_node) {
|
||||
pdata = drm_hdmi_dt_parse_pdata(dev);
|
||||
if (IS_ERR(pdata)) {
|
||||
@@ -2071,8 +2060,6 @@ static int hdmi_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct device *dev = &pdev->dev;
|
||||
|
||||
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
|
||||
|
||||
pm_runtime_disable(dev);
|
||||
|
||||
/* hdmiphy i2c driver */
|
||||
@@ -2089,8 +2076,6 @@ static int hdmi_suspend(struct device *dev)
|
||||
struct exynos_drm_hdmi_context *ctx = get_hdmi_context(dev);
|
||||
struct hdmi_context *hdata = ctx->ctx;
|
||||
|
||||
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
|
||||
|
||||
disable_irq(hdata->irq);
|
||||
|
||||
hdata->hpd = false;
|
||||
@@ -2098,7 +2083,7 @@ static int hdmi_suspend(struct device *dev)
|
||||
drm_helper_hpd_irq_event(ctx->drm_dev);
|
||||
|
||||
if (pm_runtime_suspended(dev)) {
|
||||
DRM_DEBUG_KMS("%s : Already suspended\n", __func__);
|
||||
DRM_DEBUG_KMS("Already suspended\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2112,14 +2097,12 @@ static int hdmi_resume(struct device *dev)
|
||||
struct exynos_drm_hdmi_context *ctx = get_hdmi_context(dev);
|
||||
struct hdmi_context *hdata = ctx->ctx;
|
||||
|
||||
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
|
||||
|
||||
hdata->hpd = gpio_get_value(hdata->hpd_gpio);
|
||||
|
||||
enable_irq(hdata->irq);
|
||||
|
||||
if (!pm_runtime_suspended(dev)) {
|
||||
DRM_DEBUG_KMS("%s : Already resumed\n", __func__);
|
||||
DRM_DEBUG_KMS("Already resumed\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2134,7 +2117,6 @@ static int hdmi_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct exynos_drm_hdmi_context *ctx = get_hdmi_context(dev);
|
||||
struct hdmi_context *hdata = ctx->ctx;
|
||||
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
|
||||
|
||||
hdmi_poweroff(hdata);
|
||||
|
||||
@@ -2145,7 +2127,6 @@ static int hdmi_runtime_resume(struct device *dev)
|
||||
{
|
||||
struct exynos_drm_hdmi_context *ctx = get_hdmi_context(dev);
|
||||
struct hdmi_context *hdata = ctx->ctx;
|
||||
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
|
||||
|
||||
hdmi_poweron(hdata);
|
||||
|
||||
|
@@ -50,6 +50,10 @@ static const struct i2c_device_id hdmiphy_id[] = {
|
||||
static struct of_device_id hdmiphy_match_types[] = {
|
||||
{
|
||||
.compatible = "samsung,exynos5-hdmiphy",
|
||||
}, {
|
||||
.compatible = "samsung,exynos4210-hdmiphy",
|
||||
}, {
|
||||
.compatible = "samsung,exynos4212-hdmiphy",
|
||||
}, {
|
||||
/* end node */
|
||||
}
|
||||
|
@@ -78,6 +78,7 @@ struct mixer_resources {
|
||||
enum mixer_version_id {
|
||||
MXR_VER_0_0_0_16,
|
||||
MXR_VER_16_0_33_0,
|
||||
MXR_VER_128_0_0_184,
|
||||
};
|
||||
|
||||
struct mixer_context {
|
||||
@@ -283,17 +284,19 @@ static void mixer_cfg_scan(struct mixer_context *ctx, unsigned int height)
|
||||
val = (ctx->interlace ? MXR_CFG_SCAN_INTERLACE :
|
||||
MXR_CFG_SCAN_PROGRASSIVE);
|
||||
|
||||
/* choosing between porper HD and SD mode */
|
||||
if (height <= 480)
|
||||
val |= MXR_CFG_SCAN_NTSC | MXR_CFG_SCAN_SD;
|
||||
else if (height <= 576)
|
||||
val |= MXR_CFG_SCAN_PAL | MXR_CFG_SCAN_SD;
|
||||
else if (height <= 720)
|
||||
val |= MXR_CFG_SCAN_HD_720 | MXR_CFG_SCAN_HD;
|
||||
else if (height <= 1080)
|
||||
val |= MXR_CFG_SCAN_HD_1080 | MXR_CFG_SCAN_HD;
|
||||
else
|
||||
val |= MXR_CFG_SCAN_HD_720 | MXR_CFG_SCAN_HD;
|
||||
if (ctx->mxr_ver != MXR_VER_128_0_0_184) {
|
||||
/* choosing between proper HD and SD mode */
|
||||
if (height <= 480)
|
||||
val |= MXR_CFG_SCAN_NTSC | MXR_CFG_SCAN_SD;
|
||||
else if (height <= 576)
|
||||
val |= MXR_CFG_SCAN_PAL | MXR_CFG_SCAN_SD;
|
||||
else if (height <= 720)
|
||||
val |= MXR_CFG_SCAN_HD_720 | MXR_CFG_SCAN_HD;
|
||||
else if (height <= 1080)
|
||||
val |= MXR_CFG_SCAN_HD_1080 | MXR_CFG_SCAN_HD;
|
||||
else
|
||||
val |= MXR_CFG_SCAN_HD_720 | MXR_CFG_SCAN_HD;
|
||||
}
|
||||
|
||||
mixer_reg_writemask(res, MXR_CFG, val, MXR_CFG_SCAN_MASK);
|
||||
}
|
||||
@@ -557,6 +560,14 @@ static void mixer_graph_buffer(struct mixer_context *ctx, int win)
|
||||
/* setup geometry */
|
||||
mixer_reg_write(res, MXR_GRAPHIC_SPAN(win), win_data->fb_width);
|
||||
|
||||
/* setup display size */
|
||||
if (ctx->mxr_ver == MXR_VER_128_0_0_184 &&
|
||||
win == MIXER_DEFAULT_WIN) {
|
||||
val = MXR_MXR_RES_HEIGHT(win_data->fb_height);
|
||||
val |= MXR_MXR_RES_WIDTH(win_data->fb_width);
|
||||
mixer_reg_write(res, MXR_RESOLUTION, val);
|
||||
}
|
||||
|
||||
val = MXR_GRP_WH_WIDTH(win_data->crtc_width);
|
||||
val |= MXR_GRP_WH_HEIGHT(win_data->crtc_height);
|
||||
val |= MXR_GRP_WH_H_SCALE(x_ratio);
|
||||
@@ -581,7 +592,8 @@ static void mixer_graph_buffer(struct mixer_context *ctx, int win)
|
||||
mixer_cfg_layer(ctx, win, true);
|
||||
|
||||
/* layer update mandatory for mixer 16.0.33.0 */
|
||||
if (ctx->mxr_ver == MXR_VER_16_0_33_0)
|
||||
if (ctx->mxr_ver == MXR_VER_16_0_33_0 ||
|
||||
ctx->mxr_ver == MXR_VER_128_0_0_184)
|
||||
mixer_layer_update(ctx);
|
||||
|
||||
mixer_run(ctx);
|
||||
@@ -696,8 +708,6 @@ static int mixer_enable_vblank(void *ctx, int pipe)
|
||||
struct mixer_context *mixer_ctx = ctx;
|
||||
struct mixer_resources *res = &mixer_ctx->mixer_res;
|
||||
|
||||
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
|
||||
|
||||
mixer_ctx->pipe = pipe;
|
||||
|
||||
/* enable vsync interrupt */
|
||||
@@ -712,8 +722,6 @@ static void mixer_disable_vblank(void *ctx)
|
||||
struct mixer_context *mixer_ctx = ctx;
|
||||
struct mixer_resources *res = &mixer_ctx->mixer_res;
|
||||
|
||||
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
|
||||
|
||||
/* disable vsync interrupt */
|
||||
mixer_reg_writemask(res, MXR_INT_EN, 0, MXR_INT_EN_VSYNC);
|
||||
}
|
||||
@@ -725,8 +733,6 @@ static void mixer_win_mode_set(void *ctx,
|
||||
struct hdmi_win_data *win_data;
|
||||
int win;
|
||||
|
||||
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
|
||||
|
||||
if (!overlay) {
|
||||
DRM_ERROR("overlay is NULL\n");
|
||||
return;
|
||||
@@ -742,7 +748,7 @@ static void mixer_win_mode_set(void *ctx,
|
||||
if (win == DEFAULT_ZPOS)
|
||||
win = MIXER_DEFAULT_WIN;
|
||||
|
||||
if (win < 0 || win > MIXER_WIN_NR) {
|
||||
if (win < 0 || win >= MIXER_WIN_NR) {
|
||||
DRM_ERROR("mixer window[%d] is wrong\n", win);
|
||||
return;
|
||||
}
|
||||
@@ -776,7 +782,7 @@ static void mixer_win_commit(void *ctx, int win)
|
||||
{
|
||||
struct mixer_context *mixer_ctx = ctx;
|
||||
|
||||
DRM_DEBUG_KMS("[%d] %s, win: %d\n", __LINE__, __func__, win);
|
||||
DRM_DEBUG_KMS("win: %d\n", win);
|
||||
|
||||
mutex_lock(&mixer_ctx->mixer_mutex);
|
||||
if (!mixer_ctx->powered) {
|
||||
@@ -799,7 +805,7 @@ static void mixer_win_disable(void *ctx, int win)
|
||||
struct mixer_resources *res = &mixer_ctx->mixer_res;
|
||||
unsigned long flags;
|
||||
|
||||
DRM_DEBUG_KMS("[%d] %s, win: %d\n", __LINE__, __func__, win);
|
||||
DRM_DEBUG_KMS("win: %d\n", win);
|
||||
|
||||
mutex_lock(&mixer_ctx->mixer_mutex);
|
||||
if (!mixer_ctx->powered) {
|
||||
@@ -820,17 +826,21 @@ static void mixer_win_disable(void *ctx, int win)
|
||||
mixer_ctx->win_data[win].enabled = false;
|
||||
}
|
||||
|
||||
static int mixer_check_timing(void *ctx, struct fb_videomode *timing)
|
||||
static int mixer_check_mode(void *ctx, struct drm_display_mode *mode)
|
||||
{
|
||||
struct mixer_context *mixer_ctx = ctx;
|
||||
u32 w, h;
|
||||
|
||||
w = timing->xres;
|
||||
h = timing->yres;
|
||||
w = mode->hdisplay;
|
||||
h = mode->vdisplay;
|
||||
|
||||
DRM_DEBUG_KMS("%s : xres=%d, yres=%d, refresh=%d, intl=%d\n",
|
||||
__func__, timing->xres, timing->yres,
|
||||
timing->refresh, (timing->vmode &
|
||||
FB_VMODE_INTERLACED) ? true : false);
|
||||
DRM_DEBUG_KMS("xres=%d, yres=%d, refresh=%d, intl=%d\n",
|
||||
mode->hdisplay, mode->vdisplay, mode->vrefresh,
|
||||
(mode->flags & DRM_MODE_FLAG_INTERLACE) ? 1 : 0);
|
||||
|
||||
if (mixer_ctx->mxr_ver == MXR_VER_0_0_0_16 ||
|
||||
mixer_ctx->mxr_ver == MXR_VER_128_0_0_184)
|
||||
return 0;
|
||||
|
||||
if ((w >= 464 && w <= 720 && h >= 261 && h <= 576) ||
|
||||
(w >= 1024 && w <= 1280 && h >= 576 && h <= 720) ||
|
||||
@@ -891,8 +901,6 @@ static void mixer_poweron(struct mixer_context *ctx)
|
||||
{
|
||||
struct mixer_resources *res = &ctx->mixer_res;
|
||||
|
||||
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
|
||||
|
||||
mutex_lock(&ctx->mixer_mutex);
|
||||
if (ctx->powered) {
|
||||
mutex_unlock(&ctx->mixer_mutex);
|
||||
@@ -901,10 +909,10 @@ static void mixer_poweron(struct mixer_context *ctx)
|
||||
ctx->powered = true;
|
||||
mutex_unlock(&ctx->mixer_mutex);
|
||||
|
||||
clk_enable(res->mixer);
|
||||
clk_prepare_enable(res->mixer);
|
||||
if (ctx->vp_enabled) {
|
||||
clk_enable(res->vp);
|
||||
clk_enable(res->sclk_mixer);
|
||||
clk_prepare_enable(res->vp);
|
||||
clk_prepare_enable(res->sclk_mixer);
|
||||
}
|
||||
|
||||
mixer_reg_write(res, MXR_INT_EN, ctx->int_en);
|
||||
@@ -917,8 +925,6 @@ static void mixer_poweroff(struct mixer_context *ctx)
|
||||
{
|
||||
struct mixer_resources *res = &ctx->mixer_res;
|
||||
|
||||
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
|
||||
|
||||
mutex_lock(&ctx->mixer_mutex);
|
||||
if (!ctx->powered)
|
||||
goto out;
|
||||
@@ -928,10 +934,10 @@ static void mixer_poweroff(struct mixer_context *ctx)
|
||||
|
||||
ctx->int_en = mixer_reg_read(res, MXR_INT_EN);
|
||||
|
||||
clk_disable(res->mixer);
|
||||
clk_disable_unprepare(res->mixer);
|
||||
if (ctx->vp_enabled) {
|
||||
clk_disable(res->vp);
|
||||
clk_disable(res->sclk_mixer);
|
||||
clk_disable_unprepare(res->vp);
|
||||
clk_disable_unprepare(res->sclk_mixer);
|
||||
}
|
||||
|
||||
mutex_lock(&ctx->mixer_mutex);
|
||||
@@ -945,8 +951,6 @@ static void mixer_dpms(void *ctx, int mode)
|
||||
{
|
||||
struct mixer_context *mixer_ctx = ctx;
|
||||
|
||||
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
|
||||
|
||||
switch (mode) {
|
||||
case DRM_MODE_DPMS_ON:
|
||||
if (pm_runtime_suspended(mixer_ctx->dev))
|
||||
@@ -978,7 +982,7 @@ static struct exynos_mixer_ops mixer_ops = {
|
||||
.win_disable = mixer_win_disable,
|
||||
|
||||
/* display */
|
||||
.check_timing = mixer_check_timing,
|
||||
.check_mode = mixer_check_mode,
|
||||
};
|
||||
|
||||
static irqreturn_t mixer_irq_handler(int irq, void *arg)
|
||||
@@ -1128,12 +1132,17 @@ static int vp_resources_init(struct exynos_drm_hdmi_context *ctx,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct mixer_drv_data exynos5_mxr_drv_data = {
|
||||
static struct mixer_drv_data exynos5420_mxr_drv_data = {
|
||||
.version = MXR_VER_128_0_0_184,
|
||||
.is_vp_enabled = 0,
|
||||
};
|
||||
|
||||
static struct mixer_drv_data exynos5250_mxr_drv_data = {
|
||||
.version = MXR_VER_16_0_33_0,
|
||||
.is_vp_enabled = 0,
|
||||
};
|
||||
|
||||
static struct mixer_drv_data exynos4_mxr_drv_data = {
|
||||
static struct mixer_drv_data exynos4210_mxr_drv_data = {
|
||||
.version = MXR_VER_0_0_0_16,
|
||||
.is_vp_enabled = 1,
|
||||
};
|
||||
@@ -1141,10 +1150,10 @@ static struct mixer_drv_data exynos4_mxr_drv_data = {
|
||||
static struct platform_device_id mixer_driver_types[] = {
|
||||
{
|
||||
.name = "s5p-mixer",
|
||||
.driver_data = (unsigned long)&exynos4_mxr_drv_data,
|
||||
.driver_data = (unsigned long)&exynos4210_mxr_drv_data,
|
||||
}, {
|
||||
.name = "exynos5-mixer",
|
||||
.driver_data = (unsigned long)&exynos5_mxr_drv_data,
|
||||
.driver_data = (unsigned long)&exynos5250_mxr_drv_data,
|
||||
}, {
|
||||
/* end node */
|
||||
}
|
||||
@@ -1153,7 +1162,13 @@ static struct platform_device_id mixer_driver_types[] = {
|
||||
static struct of_device_id mixer_match_types[] = {
|
||||
{
|
||||
.compatible = "samsung,exynos5-mixer",
|
||||
.data = &exynos5_mxr_drv_data,
|
||||
.data = &exynos5250_mxr_drv_data,
|
||||
}, {
|
||||
.compatible = "samsung,exynos5250-mixer",
|
||||
.data = &exynos5250_mxr_drv_data,
|
||||
}, {
|
||||
.compatible = "samsung,exynos5420-mixer",
|
||||
.data = &exynos5420_mxr_drv_data,
|
||||
}, {
|
||||
/* end node */
|
||||
}
|
||||
@@ -1186,8 +1201,7 @@ static int mixer_probe(struct platform_device *pdev)
|
||||
|
||||
if (dev->of_node) {
|
||||
const struct of_device_id *match;
|
||||
match = of_match_node(of_match_ptr(mixer_match_types),
|
||||
dev->of_node);
|
||||
match = of_match_node(mixer_match_types, dev->of_node);
|
||||
drv = (struct mixer_drv_data *)match->data;
|
||||
} else {
|
||||
drv = (struct mixer_drv_data *)
|
||||
@@ -1251,10 +1265,8 @@ static int mixer_suspend(struct device *dev)
|
||||
struct exynos_drm_hdmi_context *drm_hdmi_ctx = get_mixer_context(dev);
|
||||
struct mixer_context *ctx = drm_hdmi_ctx->ctx;
|
||||
|
||||
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
|
||||
|
||||
if (pm_runtime_suspended(dev)) {
|
||||
DRM_DEBUG_KMS("%s : Already suspended\n", __func__);
|
||||
DRM_DEBUG_KMS("Already suspended\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1268,10 +1280,8 @@ static int mixer_resume(struct device *dev)
|
||||
struct exynos_drm_hdmi_context *drm_hdmi_ctx = get_mixer_context(dev);
|
||||
struct mixer_context *ctx = drm_hdmi_ctx->ctx;
|
||||
|
||||
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
|
||||
|
||||
if (!pm_runtime_suspended(dev)) {
|
||||
DRM_DEBUG_KMS("%s : Already resumed\n", __func__);
|
||||
DRM_DEBUG_KMS("Already resumed\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1287,8 +1297,6 @@ static int mixer_runtime_suspend(struct device *dev)
|
||||
struct exynos_drm_hdmi_context *drm_hdmi_ctx = get_mixer_context(dev);
|
||||
struct mixer_context *ctx = drm_hdmi_ctx->ctx;
|
||||
|
||||
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
|
||||
|
||||
mixer_poweroff(ctx);
|
||||
|
||||
return 0;
|
||||
@@ -1299,8 +1307,6 @@ static int mixer_runtime_resume(struct device *dev)
|
||||
struct exynos_drm_hdmi_context *drm_hdmi_ctx = get_mixer_context(dev);
|
||||
struct mixer_context *ctx = drm_hdmi_ctx->ctx;
|
||||
|
||||
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
|
||||
|
||||
mixer_poweron(ctx);
|
||||
|
||||
return 0;
|
||||
|
@@ -44,6 +44,9 @@
|
||||
#define MXR_CM_COEFF_Y 0x0080
|
||||
#define MXR_CM_COEFF_CB 0x0084
|
||||
#define MXR_CM_COEFF_CR 0x0088
|
||||
#define MXR_MO 0x0304
|
||||
#define MXR_RESOLUTION 0x0310
|
||||
|
||||
#define MXR_GRAPHIC0_BASE_S 0x2024
|
||||
#define MXR_GRAPHIC1_BASE_S 0x2044
|
||||
|
||||
@@ -119,6 +122,10 @@
|
||||
#define MXR_GRP_WH_WIDTH(x) MXR_MASK_VAL(x, 26, 16)
|
||||
#define MXR_GRP_WH_HEIGHT(x) MXR_MASK_VAL(x, 10, 0)
|
||||
|
||||
/* bits for MXR_RESOLUTION */
|
||||
#define MXR_MXR_RES_HEIGHT(x) MXR_MASK_VAL(x, 26, 16)
|
||||
#define MXR_MXR_RES_WIDTH(x) MXR_MASK_VAL(x, 10, 0)
|
||||
|
||||
/* bits for MXR_GRAPHICn_SXY */
|
||||
#define MXR_GRP_SXY_SX(x) MXR_MASK_VAL(x, 26, 16)
|
||||
#define MXR_GRP_SXY_SY(x) MXR_MASK_VAL(x, 10, 0)
|
||||
|
Reference in New Issue
Block a user