Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 282555
b: refs/heads/master
c: 864ee9e
h: refs/heads/master
i:
  282553: f820bd0
  282551: 348e4d3
v: v3
  • Loading branch information
Joonyoung Shim authored and Inki Dae committed Dec 21, 2011
1 parent 01549b0 commit 331f287
Show file tree
Hide file tree
Showing 11 changed files with 255 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cb91f6a078097cdfe23bc1bd997e4310b06b87a3
refs/heads/master: 864ee9e6f643b479e0469c9865cae238590d5f6e
3 changes: 2 additions & 1 deletion trunk/drivers/gpu/drm/exynos/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
ccflags-y := -Iinclude/drm -Idrivers/gpu/drm/exynos
exynosdrm-y := exynos_drm_drv.o exynos_drm_encoder.o exynos_drm_connector.o \
exynos_drm_crtc.o exynos_drm_fbdev.o exynos_drm_fb.o \
exynos_drm_buf.o exynos_drm_gem.o exynos_drm_core.o
exynos_drm_buf.o exynos_drm_gem.o exynos_drm_core.o \
exynos_drm_plane.o

obj-$(CONFIG_DRM_EXYNOS) += exynosdrm.o
obj-$(CONFIG_DRM_EXYNOS_FIMD) += exynos_drm_fimd.o
1 change: 1 addition & 0 deletions trunk/drivers/gpu/drm/exynos/exynos_drm_crtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ int exynos_drm_crtc_create(struct drm_device *dev, unsigned int nr)

exynos_crtc->pipe = nr;
exynos_crtc->dpms = DRM_MODE_DPMS_OFF;
exynos_crtc->overlay.zpos = DEFAULT_ZPOS;
crtc = &exynos_crtc->drm_crtc;

private->crtc[nr] = crtc;
Expand Down
9 changes: 9 additions & 0 deletions trunk/drivers/gpu/drm/exynos/exynos_drm_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include "exynos_drm_fbdev.h"
#include "exynos_drm_fb.h"
#include "exynos_drm_gem.h"
#include "exynos_drm_plane.h"

#define DRIVER_NAME "exynos-drm"
#define DRIVER_DESC "Samsung SoC DRM"
Expand Down Expand Up @@ -77,6 +78,12 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags)
goto err_crtc;
}

for (nr = 0; nr < MAX_PLANE; nr++) {
ret = exynos_plane_init(dev, nr);
if (ret)
goto err_crtc;
}

ret = drm_vblank_init(dev, MAX_CRTC);
if (ret)
goto err_crtc;
Expand Down Expand Up @@ -163,6 +170,8 @@ static struct drm_ioctl_desc exynos_ioctls[] = {
DRM_AUTH),
DRM_IOCTL_DEF_DRV(EXYNOS_GEM_MMAP,
exynos_drm_gem_mmap_ioctl, DRM_UNLOCKED | DRM_AUTH),
DRM_IOCTL_DEF_DRV(EXYNOS_PLANE_SET_ZPOS, exynos_plane_set_zpos_ioctl,
DRM_UNLOCKED | DRM_AUTH),
};

static const struct file_operations exynos_drm_driver_fops = {
Expand Down
8 changes: 6 additions & 2 deletions trunk/drivers/gpu/drm/exynos/exynos_drm_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
#include "drm.h"

#define MAX_CRTC 2
#define MAX_PLANE 5
#define DEFAULT_ZPOS -1

struct drm_device;
struct exynos_drm_overlay;
Expand All @@ -57,8 +59,8 @@ enum exynos_drm_output_type {
struct exynos_drm_overlay_ops {
void (*mode_set)(struct device *subdrv_dev,
struct exynos_drm_overlay *overlay);
void (*commit)(struct device *subdrv_dev);
void (*disable)(struct device *subdrv_dev);
void (*commit)(struct device *subdrv_dev, int zpos);
void (*disable)(struct device *subdrv_dev, int zpos);
};

/*
Expand All @@ -83,6 +85,7 @@ struct exynos_drm_overlay_ops {
* @dma_addr: bus(accessed by dma) address to the memory region allocated
* for a overlay.
* @vaddr: virtual memory addresss to this overlay.
* @zpos: order of overlay layer(z position).
* @default_win: a window to be enabled.
* @color_key: color key on or off.
* @index_color: if using color key feature then this value would be used
Expand Down Expand Up @@ -111,6 +114,7 @@ struct exynos_drm_overlay {
unsigned int pitch;
dma_addr_t dma_addr;
void __iomem *vaddr;
int zpos;

bool default_win;
bool color_key;
Expand Down
26 changes: 22 additions & 4 deletions trunk/drivers/gpu/drm/exynos/exynos_drm_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,12 +294,27 @@ void exynos_drm_disable_vblank(struct drm_encoder *encoder, void *data)
manager_ops->disable_vblank(manager->dev);
}

void exynos_drm_encoder_crtc_commit(struct drm_encoder *encoder, void *data)
void exynos_drm_encoder_crtc_plane_commit(struct drm_encoder *encoder,
void *data)
{
struct exynos_drm_manager *manager =
to_exynos_encoder(encoder)->manager;
struct exynos_drm_overlay_ops *overlay_ops = manager->overlay_ops;
int zpos = DEFAULT_ZPOS;

if (data)
zpos = *(int *)data;

if (overlay_ops && overlay_ops->commit)
overlay_ops->commit(manager->dev, zpos);
}

void exynos_drm_encoder_crtc_commit(struct drm_encoder *encoder, void *data)
{
struct exynos_drm_manager *manager =
to_exynos_encoder(encoder)->manager;
int crtc = *(int *)data;
int zpos = DEFAULT_ZPOS;

DRM_DEBUG_KMS("%s\n", __FILE__);

Expand All @@ -309,8 +324,7 @@ void exynos_drm_encoder_crtc_commit(struct drm_encoder *encoder, void *data)
*/
manager->pipe = crtc;

if (overlay_ops && overlay_ops->commit)
overlay_ops->commit(manager->dev);
exynos_drm_encoder_crtc_plane_commit(encoder, &zpos);
}

void exynos_drm_encoder_dpms_from_crtc(struct drm_encoder *encoder, void *data)
Expand Down Expand Up @@ -375,11 +389,15 @@ void exynos_drm_encoder_crtc_disable(struct drm_encoder *encoder, void *data)
struct exynos_drm_manager *manager =
to_exynos_encoder(encoder)->manager;
struct exynos_drm_overlay_ops *overlay_ops = manager->overlay_ops;
int zpos = DEFAULT_ZPOS;

DRM_DEBUG_KMS("\n");

if (data)
zpos = *(int *)data;

if (overlay_ops && overlay_ops->disable)
overlay_ops->disable(manager->dev);
overlay_ops->disable(manager->dev, zpos);
}

MODULE_AUTHOR("Inki Dae <inki.dae@samsung.com>");
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/gpu/drm/exynos/exynos_drm_encoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ void exynos_drm_fn_encoder(struct drm_crtc *crtc, void *data,
void (*fn)(struct drm_encoder *, void *));
void exynos_drm_enable_vblank(struct drm_encoder *encoder, void *data);
void exynos_drm_disable_vblank(struct drm_encoder *encoder, void *data);
void exynos_drm_encoder_crtc_plane_commit(struct drm_encoder *encoder,
void *data);
void exynos_drm_encoder_crtc_commit(struct drm_encoder *encoder, void *data);
void exynos_drm_encoder_dpms_from_crtc(struct drm_encoder *encoder,
void *data);
Expand Down
33 changes: 25 additions & 8 deletions trunk/drivers/gpu/drm/exynos/exynos_drm_fimd.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,15 @@ static void fimd_apply(struct device *subdrv_dev)
struct exynos_drm_manager_ops *mgr_ops = mgr->ops;
struct exynos_drm_overlay_ops *ovl_ops = mgr->overlay_ops;
struct fimd_win_data *win_data;
int i;

DRM_DEBUG_KMS("%s\n", __FILE__);

win_data = &ctx->win_data[ctx->default_win];
if (win_data->enabled && (ovl_ops && ovl_ops->commit))
ovl_ops->commit(subdrv_dev);
for (i = 0; i < WINDOWS_NR; i++) {
win_data = &ctx->win_data[i];
if (win_data->enabled && (ovl_ops && ovl_ops->commit))
ovl_ops->commit(subdrv_dev, i);
}

if (mgr_ops && mgr_ops->commit)
mgr_ops->commit(subdrv_dev);
Expand Down Expand Up @@ -277,6 +280,7 @@ static void fimd_win_mode_set(struct device *dev,
{
struct fimd_context *ctx = get_fimd_context(dev);
struct fimd_win_data *win_data;
int win;
unsigned long offset;

DRM_DEBUG_KMS("%s\n", __FILE__);
Expand All @@ -286,12 +290,19 @@ static void fimd_win_mode_set(struct device *dev,
return;
}

win = overlay->zpos;
if (win == DEFAULT_ZPOS)
win = ctx->default_win;

if (win < 0 || win > WINDOWS_NR)
return;

offset = overlay->fb_x * (overlay->bpp >> 3);
offset += overlay->fb_y * overlay->pitch;

DRM_DEBUG_KMS("offset = 0x%lx, pitch = %x\n", offset, overlay->pitch);

win_data = &ctx->win_data[ctx->default_win];
win_data = &ctx->win_data[win];

win_data->offset_x = overlay->crtc_x;
win_data->offset_y = overlay->crtc_y;
Expand Down Expand Up @@ -394,15 +405,18 @@ static void fimd_win_set_colkey(struct device *dev, unsigned int win)
writel(keycon1, ctx->regs + WKEYCON1_BASE(win));
}

static void fimd_win_commit(struct device *dev)
static void fimd_win_commit(struct device *dev, int zpos)
{
struct fimd_context *ctx = get_fimd_context(dev);
struct fimd_win_data *win_data;
int win = ctx->default_win;
int win = zpos;
unsigned long val, alpha, size;

DRM_DEBUG_KMS("%s\n", __FILE__);

if (win == DEFAULT_ZPOS)
win = ctx->default_win;

if (win < 0 || win > WINDOWS_NR)
return;

Expand Down Expand Up @@ -499,15 +513,18 @@ static void fimd_win_commit(struct device *dev)
win_data->enabled = true;
}

static void fimd_win_disable(struct device *dev)
static void fimd_win_disable(struct device *dev, int zpos)
{
struct fimd_context *ctx = get_fimd_context(dev);
struct fimd_win_data *win_data;
int win = ctx->default_win;
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)
return;

Expand Down
Loading

0 comments on commit 331f287

Please sign in to comment.