Merge branch 'exynos-drm-fixes' of git://git.infradead.org/users/kmpark/linux-samsung into drm-fixes
* 'exynos-drm-fixes' of git://git.infradead.org/users/kmpark/linux-samsung: drm/exynos: fixed blending for hdmi graphic layer drm/exynos: Remove dummy encoder get_crtc operation implementation drm/exynos: Keep a reference to frame buffer GEM objects drm/exynos: Don't cast GEM object to Exynos GEM object when not needed drm/exynos: DRIVER_BUS_PLATFORM is not a driver feature drm/exynos: fixed size type. drm/exynos: Use DRM_FORMAT_{NV12, YUV420} instead of DRM_FORMAT_{NV12M, YUV420M}
This commit is contained in:
@@ -244,8 +244,8 @@ static const struct file_operations exynos_drm_driver_fops = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static struct drm_driver exynos_drm_driver = {
|
static struct drm_driver exynos_drm_driver = {
|
||||||
.driver_features = DRIVER_HAVE_IRQ | DRIVER_BUS_PLATFORM |
|
.driver_features = DRIVER_HAVE_IRQ | DRIVER_MODESET |
|
||||||
DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME,
|
DRIVER_GEM | DRIVER_PRIME,
|
||||||
.load = exynos_drm_load,
|
.load = exynos_drm_load,
|
||||||
.unload = exynos_drm_unload,
|
.unload = exynos_drm_unload,
|
||||||
.open = exynos_drm_open,
|
.open = exynos_drm_open,
|
||||||
|
@@ -172,19 +172,12 @@ static void exynos_drm_encoder_commit(struct drm_encoder *encoder)
|
|||||||
manager_ops->commit(manager->dev);
|
manager_ops->commit(manager->dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct drm_crtc *
|
|
||||||
exynos_drm_encoder_get_crtc(struct drm_encoder *encoder)
|
|
||||||
{
|
|
||||||
return encoder->crtc;
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct drm_encoder_helper_funcs exynos_encoder_helper_funcs = {
|
static struct drm_encoder_helper_funcs exynos_encoder_helper_funcs = {
|
||||||
.dpms = exynos_drm_encoder_dpms,
|
.dpms = exynos_drm_encoder_dpms,
|
||||||
.mode_fixup = exynos_drm_encoder_mode_fixup,
|
.mode_fixup = exynos_drm_encoder_mode_fixup,
|
||||||
.mode_set = exynos_drm_encoder_mode_set,
|
.mode_set = exynos_drm_encoder_mode_set,
|
||||||
.prepare = exynos_drm_encoder_prepare,
|
.prepare = exynos_drm_encoder_prepare,
|
||||||
.commit = exynos_drm_encoder_commit,
|
.commit = exynos_drm_encoder_commit,
|
||||||
.get_crtc = exynos_drm_encoder_get_crtc,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static void exynos_drm_encoder_destroy(struct drm_encoder *encoder)
|
static void exynos_drm_encoder_destroy(struct drm_encoder *encoder)
|
||||||
|
@@ -51,11 +51,22 @@ struct exynos_drm_fb {
|
|||||||
static void exynos_drm_fb_destroy(struct drm_framebuffer *fb)
|
static void exynos_drm_fb_destroy(struct drm_framebuffer *fb)
|
||||||
{
|
{
|
||||||
struct exynos_drm_fb *exynos_fb = to_exynos_fb(fb);
|
struct exynos_drm_fb *exynos_fb = to_exynos_fb(fb);
|
||||||
|
unsigned int i;
|
||||||
|
|
||||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||||
|
|
||||||
drm_framebuffer_cleanup(fb);
|
drm_framebuffer_cleanup(fb);
|
||||||
|
|
||||||
|
for (i = 0; i < ARRAY_SIZE(exynos_fb->exynos_gem_obj); i++) {
|
||||||
|
struct drm_gem_object *obj;
|
||||||
|
|
||||||
|
if (exynos_fb->exynos_gem_obj[i] == NULL)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
obj = &exynos_fb->exynos_gem_obj[i]->base;
|
||||||
|
drm_gem_object_unreference_unlocked(obj);
|
||||||
|
}
|
||||||
|
|
||||||
kfree(exynos_fb);
|
kfree(exynos_fb);
|
||||||
exynos_fb = NULL;
|
exynos_fb = NULL;
|
||||||
}
|
}
|
||||||
@@ -134,11 +145,11 @@ exynos_user_fb_create(struct drm_device *dev, struct drm_file *file_priv,
|
|||||||
return ERR_PTR(-ENOENT);
|
return ERR_PTR(-ENOENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
drm_gem_object_unreference_unlocked(obj);
|
|
||||||
|
|
||||||
fb = exynos_drm_framebuffer_init(dev, mode_cmd, obj);
|
fb = exynos_drm_framebuffer_init(dev, mode_cmd, obj);
|
||||||
if (IS_ERR(fb))
|
if (IS_ERR(fb)) {
|
||||||
|
drm_gem_object_unreference_unlocked(obj);
|
||||||
return fb;
|
return fb;
|
||||||
|
}
|
||||||
|
|
||||||
exynos_fb = to_exynos_fb(fb);
|
exynos_fb = to_exynos_fb(fb);
|
||||||
nr = exynos_drm_format_num_buffers(fb->pixel_format);
|
nr = exynos_drm_format_num_buffers(fb->pixel_format);
|
||||||
@@ -152,8 +163,6 @@ exynos_user_fb_create(struct drm_device *dev, struct drm_file *file_priv,
|
|||||||
return ERR_PTR(-ENOENT);
|
return ERR_PTR(-ENOENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
drm_gem_object_unreference_unlocked(obj);
|
|
||||||
|
|
||||||
exynos_fb->exynos_gem_obj[i] = to_exynos_gem_obj(obj);
|
exynos_fb->exynos_gem_obj[i] = to_exynos_gem_obj(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -31,10 +31,10 @@
|
|||||||
static inline int exynos_drm_format_num_buffers(uint32_t format)
|
static inline int exynos_drm_format_num_buffers(uint32_t format)
|
||||||
{
|
{
|
||||||
switch (format) {
|
switch (format) {
|
||||||
case DRM_FORMAT_NV12M:
|
case DRM_FORMAT_NV12:
|
||||||
case DRM_FORMAT_NV12MT:
|
case DRM_FORMAT_NV12MT:
|
||||||
return 2;
|
return 2;
|
||||||
case DRM_FORMAT_YUV420M:
|
case DRM_FORMAT_YUV420:
|
||||||
return 3;
|
return 3;
|
||||||
default:
|
default:
|
||||||
return 1;
|
return 1;
|
||||||
|
@@ -689,7 +689,6 @@ int exynos_drm_gem_dumb_map_offset(struct drm_file *file_priv,
|
|||||||
struct drm_device *dev, uint32_t handle,
|
struct drm_device *dev, uint32_t handle,
|
||||||
uint64_t *offset)
|
uint64_t *offset)
|
||||||
{
|
{
|
||||||
struct exynos_drm_gem_obj *exynos_gem_obj;
|
|
||||||
struct drm_gem_object *obj;
|
struct drm_gem_object *obj;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
@@ -710,15 +709,13 @@ int exynos_drm_gem_dumb_map_offset(struct drm_file *file_priv,
|
|||||||
goto unlock;
|
goto unlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
exynos_gem_obj = to_exynos_gem_obj(obj);
|
if (!obj->map_list.map) {
|
||||||
|
ret = drm_gem_create_mmap_offset(obj);
|
||||||
if (!exynos_gem_obj->base.map_list.map) {
|
|
||||||
ret = drm_gem_create_mmap_offset(&exynos_gem_obj->base);
|
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
*offset = (u64)exynos_gem_obj->base.map_list.hash.key << PAGE_SHIFT;
|
*offset = (u64)obj->map_list.hash.key << PAGE_SHIFT;
|
||||||
DRM_DEBUG_KMS("offset = 0x%lx\n", (unsigned long)*offset);
|
DRM_DEBUG_KMS("offset = 0x%lx\n", (unsigned long)*offset);
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
@@ -365,7 +365,7 @@ static void vp_video_buffer(struct mixer_context *ctx, int win)
|
|||||||
switch (win_data->pixel_format) {
|
switch (win_data->pixel_format) {
|
||||||
case DRM_FORMAT_NV12MT:
|
case DRM_FORMAT_NV12MT:
|
||||||
tiled_mode = true;
|
tiled_mode = true;
|
||||||
case DRM_FORMAT_NV12M:
|
case DRM_FORMAT_NV12:
|
||||||
crcb_mode = false;
|
crcb_mode = false;
|
||||||
buf_num = 2;
|
buf_num = 2;
|
||||||
break;
|
break;
|
||||||
@@ -601,18 +601,20 @@ static void mixer_win_reset(struct mixer_context *ctx)
|
|||||||
mixer_reg_write(res, MXR_BG_COLOR2, 0x008080);
|
mixer_reg_write(res, MXR_BG_COLOR2, 0x008080);
|
||||||
|
|
||||||
/* setting graphical layers */
|
/* setting graphical layers */
|
||||||
|
|
||||||
val = MXR_GRP_CFG_COLOR_KEY_DISABLE; /* no blank key */
|
val = MXR_GRP_CFG_COLOR_KEY_DISABLE; /* no blank key */
|
||||||
val |= MXR_GRP_CFG_WIN_BLEND_EN;
|
val |= MXR_GRP_CFG_WIN_BLEND_EN;
|
||||||
|
val |= MXR_GRP_CFG_BLEND_PRE_MUL;
|
||||||
|
val |= MXR_GRP_CFG_PIXEL_BLEND_EN;
|
||||||
val |= MXR_GRP_CFG_ALPHA_VAL(0xff); /* non-transparent alpha */
|
val |= MXR_GRP_CFG_ALPHA_VAL(0xff); /* non-transparent alpha */
|
||||||
|
|
||||||
/* the same configuration for both layers */
|
/* the same configuration for both layers */
|
||||||
mixer_reg_write(res, MXR_GRAPHIC_CFG(0), val);
|
mixer_reg_write(res, MXR_GRAPHIC_CFG(0), val);
|
||||||
|
|
||||||
val |= MXR_GRP_CFG_BLEND_PRE_MUL;
|
|
||||||
val |= MXR_GRP_CFG_PIXEL_BLEND_EN;
|
|
||||||
mixer_reg_write(res, MXR_GRAPHIC_CFG(1), val);
|
mixer_reg_write(res, MXR_GRAPHIC_CFG(1), val);
|
||||||
|
|
||||||
|
/* setting video layers */
|
||||||
|
val = MXR_GRP_CFG_ALPHA_VAL(0);
|
||||||
|
mixer_reg_write(res, MXR_VIDEO_CFG, val);
|
||||||
|
|
||||||
/* configuration of Video Processor Registers */
|
/* configuration of Video Processor Registers */
|
||||||
vp_win_reset(ctx);
|
vp_win_reset(ctx);
|
||||||
vp_default_filter(res);
|
vp_default_filter(res);
|
||||||
|
@@ -64,6 +64,7 @@ struct drm_exynos_gem_map_off {
|
|||||||
* A structure for mapping buffer.
|
* A structure for mapping buffer.
|
||||||
*
|
*
|
||||||
* @handle: a handle to gem object created.
|
* @handle: a handle to gem object created.
|
||||||
|
* @pad: just padding to be 64-bit aligned.
|
||||||
* @size: memory size to be mapped.
|
* @size: memory size to be mapped.
|
||||||
* @mapped: having user virtual address mmaped.
|
* @mapped: having user virtual address mmaped.
|
||||||
* - this variable would be filled by exynos gem module
|
* - this variable would be filled by exynos gem module
|
||||||
@@ -72,7 +73,8 @@ struct drm_exynos_gem_map_off {
|
|||||||
*/
|
*/
|
||||||
struct drm_exynos_gem_mmap {
|
struct drm_exynos_gem_mmap {
|
||||||
unsigned int handle;
|
unsigned int handle;
|
||||||
unsigned int size;
|
unsigned int pad;
|
||||||
|
uint64_t size;
|
||||||
uint64_t mapped;
|
uint64_t mapped;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user