diff options
author | Dave Airlie <airlied@redhat.com> | 2012-06-08 04:42:51 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-06-08 04:42:51 -0400 |
commit | 2d5c7cd35f1addb812e0b1709b3c727f1a58ca9c (patch) | |
tree | a08ec4c74b7b9ab423c879baace645ce3666c875 /drivers/gpu | |
parent | 6cf98d6ebb37a183d92c4183dc228cdeef9a7083 (diff) | |
parent | 5736603bef2383b6bb07f88596ccc8c387d91121 (diff) |
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}
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_drv.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_encoder.c | 7 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_fb.c | 19 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_fb.h | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_gem.c | 9 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_mixer.c | 12 |
6 files changed, 28 insertions, 27 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index 420953197d0a..d6de2e07fa03 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c | |||
@@ -244,8 +244,8 @@ static const struct file_operations exynos_drm_driver_fops = { | |||
244 | }; | 244 | }; |
245 | 245 | ||
246 | static struct drm_driver exynos_drm_driver = { | 246 | static struct drm_driver exynos_drm_driver = { |
247 | .driver_features = DRIVER_HAVE_IRQ | DRIVER_BUS_PLATFORM | | 247 | .driver_features = DRIVER_HAVE_IRQ | DRIVER_MODESET | |
248 | DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME, | 248 | DRIVER_GEM | DRIVER_PRIME, |
249 | .load = exynos_drm_load, | 249 | .load = exynos_drm_load, |
250 | .unload = exynos_drm_unload, | 250 | .unload = exynos_drm_unload, |
251 | .open = exynos_drm_open, | 251 | .open = exynos_drm_open, |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_encoder.c b/drivers/gpu/drm/exynos/exynos_drm_encoder.c index 6e9ac7bd1dcf..23d5ad379f86 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_encoder.c +++ b/drivers/gpu/drm/exynos/exynos_drm_encoder.c | |||
@@ -172,19 +172,12 @@ static void exynos_drm_encoder_commit(struct drm_encoder *encoder) | |||
172 | manager_ops->commit(manager->dev); | 172 | manager_ops->commit(manager->dev); |
173 | } | 173 | } |
174 | 174 | ||
175 | static struct drm_crtc * | ||
176 | exynos_drm_encoder_get_crtc(struct drm_encoder *encoder) | ||
177 | { | ||
178 | return encoder->crtc; | ||
179 | } | ||
180 | |||
181 | static struct drm_encoder_helper_funcs exynos_encoder_helper_funcs = { | 175 | static struct drm_encoder_helper_funcs exynos_encoder_helper_funcs = { |
182 | .dpms = exynos_drm_encoder_dpms, | 176 | .dpms = exynos_drm_encoder_dpms, |
183 | .mode_fixup = exynos_drm_encoder_mode_fixup, | 177 | .mode_fixup = exynos_drm_encoder_mode_fixup, |
184 | .mode_set = exynos_drm_encoder_mode_set, | 178 | .mode_set = exynos_drm_encoder_mode_set, |
185 | .prepare = exynos_drm_encoder_prepare, | 179 | .prepare = exynos_drm_encoder_prepare, |
186 | .commit = exynos_drm_encoder_commit, | 180 | .commit = exynos_drm_encoder_commit, |
187 | .get_crtc = exynos_drm_encoder_get_crtc, | ||
188 | }; | 181 | }; |
189 | 182 | ||
190 | static void exynos_drm_encoder_destroy(struct drm_encoder *encoder) | 183 | static void exynos_drm_encoder_destroy(struct drm_encoder *encoder) |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fb.c b/drivers/gpu/drm/exynos/exynos_drm_fb.c index f82a299553fb..4ccfe4328fab 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fb.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fb.c | |||
@@ -51,11 +51,22 @@ struct exynos_drm_fb { | |||
51 | static void exynos_drm_fb_destroy(struct drm_framebuffer *fb) | 51 | static void exynos_drm_fb_destroy(struct drm_framebuffer *fb) |
52 | { | 52 | { |
53 | struct exynos_drm_fb *exynos_fb = to_exynos_fb(fb); | 53 | struct exynos_drm_fb *exynos_fb = to_exynos_fb(fb); |
54 | unsigned int i; | ||
54 | 55 | ||
55 | DRM_DEBUG_KMS("%s\n", __FILE__); | 56 | DRM_DEBUG_KMS("%s\n", __FILE__); |
56 | 57 | ||
57 | drm_framebuffer_cleanup(fb); | 58 | drm_framebuffer_cleanup(fb); |
58 | 59 | ||
60 | for (i = 0; i < ARRAY_SIZE(exynos_fb->exynos_gem_obj); i++) { | ||
61 | struct drm_gem_object *obj; | ||
62 | |||
63 | if (exynos_fb->exynos_gem_obj[i] == NULL) | ||
64 | continue; | ||
65 | |||
66 | obj = &exynos_fb->exynos_gem_obj[i]->base; | ||
67 | drm_gem_object_unreference_unlocked(obj); | ||
68 | } | ||
69 | |||
59 | kfree(exynos_fb); | 70 | kfree(exynos_fb); |
60 | exynos_fb = NULL; | 71 | exynos_fb = NULL; |
61 | } | 72 | } |
@@ -134,11 +145,11 @@ exynos_user_fb_create(struct drm_device *dev, struct drm_file *file_priv, | |||
134 | return ERR_PTR(-ENOENT); | 145 | return ERR_PTR(-ENOENT); |
135 | } | 146 | } |
136 | 147 | ||
137 | drm_gem_object_unreference_unlocked(obj); | ||
138 | |||
139 | fb = exynos_drm_framebuffer_init(dev, mode_cmd, obj); | 148 | fb = exynos_drm_framebuffer_init(dev, mode_cmd, obj); |
140 | if (IS_ERR(fb)) | 149 | if (IS_ERR(fb)) { |
150 | drm_gem_object_unreference_unlocked(obj); | ||
141 | return fb; | 151 | return fb; |
152 | } | ||
142 | 153 | ||
143 | exynos_fb = to_exynos_fb(fb); | 154 | exynos_fb = to_exynos_fb(fb); |
144 | nr = exynos_drm_format_num_buffers(fb->pixel_format); | 155 | 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, | |||
152 | return ERR_PTR(-ENOENT); | 163 | return ERR_PTR(-ENOENT); |
153 | } | 164 | } |
154 | 165 | ||
155 | drm_gem_object_unreference_unlocked(obj); | ||
156 | |||
157 | exynos_fb->exynos_gem_obj[i] = to_exynos_gem_obj(obj); | 166 | exynos_fb->exynos_gem_obj[i] = to_exynos_gem_obj(obj); |
158 | } | 167 | } |
159 | 168 | ||
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fb.h b/drivers/gpu/drm/exynos/exynos_drm_fb.h index 3ecb30d93552..50823756cdea 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fb.h +++ b/drivers/gpu/drm/exynos/exynos_drm_fb.h | |||
@@ -31,10 +31,10 @@ | |||
31 | static inline int exynos_drm_format_num_buffers(uint32_t format) | 31 | static inline int exynos_drm_format_num_buffers(uint32_t format) |
32 | { | 32 | { |
33 | switch (format) { | 33 | switch (format) { |
34 | case DRM_FORMAT_NV12M: | 34 | case DRM_FORMAT_NV12: |
35 | case DRM_FORMAT_NV12MT: | 35 | case DRM_FORMAT_NV12MT: |
36 | return 2; | 36 | return 2; |
37 | case DRM_FORMAT_YUV420M: | 37 | case DRM_FORMAT_YUV420: |
38 | return 3; | 38 | return 3; |
39 | default: | 39 | default: |
40 | return 1; | 40 | return 1; |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c index fc91293c4560..5c8b683029ea 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gem.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c | |||
@@ -689,7 +689,6 @@ int exynos_drm_gem_dumb_map_offset(struct drm_file *file_priv, | |||
689 | struct drm_device *dev, uint32_t handle, | 689 | struct drm_device *dev, uint32_t handle, |
690 | uint64_t *offset) | 690 | uint64_t *offset) |
691 | { | 691 | { |
692 | struct exynos_drm_gem_obj *exynos_gem_obj; | ||
693 | struct drm_gem_object *obj; | 692 | struct drm_gem_object *obj; |
694 | int ret = 0; | 693 | int ret = 0; |
695 | 694 | ||
@@ -710,15 +709,13 @@ int exynos_drm_gem_dumb_map_offset(struct drm_file *file_priv, | |||
710 | goto unlock; | 709 | goto unlock; |
711 | } | 710 | } |
712 | 711 | ||
713 | exynos_gem_obj = to_exynos_gem_obj(obj); | 712 | if (!obj->map_list.map) { |
714 | 713 | ret = drm_gem_create_mmap_offset(obj); | |
715 | if (!exynos_gem_obj->base.map_list.map) { | ||
716 | ret = drm_gem_create_mmap_offset(&exynos_gem_obj->base); | ||
717 | if (ret) | 714 | if (ret) |
718 | goto out; | 715 | goto out; |
719 | } | 716 | } |
720 | 717 | ||
721 | *offset = (u64)exynos_gem_obj->base.map_list.hash.key << PAGE_SHIFT; | 718 | *offset = (u64)obj->map_list.hash.key << PAGE_SHIFT; |
722 | DRM_DEBUG_KMS("offset = 0x%lx\n", (unsigned long)*offset); | 719 | DRM_DEBUG_KMS("offset = 0x%lx\n", (unsigned long)*offset); |
723 | 720 | ||
724 | out: | 721 | out: |
diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c index 68ef01028375..e2147a2ddcec 100644 --- a/drivers/gpu/drm/exynos/exynos_mixer.c +++ b/drivers/gpu/drm/exynos/exynos_mixer.c | |||
@@ -365,7 +365,7 @@ static void vp_video_buffer(struct mixer_context *ctx, int win) | |||
365 | switch (win_data->pixel_format) { | 365 | switch (win_data->pixel_format) { |
366 | case DRM_FORMAT_NV12MT: | 366 | case DRM_FORMAT_NV12MT: |
367 | tiled_mode = true; | 367 | tiled_mode = true; |
368 | case DRM_FORMAT_NV12M: | 368 | case DRM_FORMAT_NV12: |
369 | crcb_mode = false; | 369 | crcb_mode = false; |
370 | buf_num = 2; | 370 | buf_num = 2; |
371 | break; | 371 | break; |
@@ -601,18 +601,20 @@ static void mixer_win_reset(struct mixer_context *ctx) | |||
601 | mixer_reg_write(res, MXR_BG_COLOR2, 0x008080); | 601 | mixer_reg_write(res, MXR_BG_COLOR2, 0x008080); |
602 | 602 | ||
603 | /* setting graphical layers */ | 603 | /* setting graphical layers */ |
604 | |||
605 | val = MXR_GRP_CFG_COLOR_KEY_DISABLE; /* no blank key */ | 604 | val = MXR_GRP_CFG_COLOR_KEY_DISABLE; /* no blank key */ |
606 | val |= MXR_GRP_CFG_WIN_BLEND_EN; | 605 | val |= MXR_GRP_CFG_WIN_BLEND_EN; |
606 | val |= MXR_GRP_CFG_BLEND_PRE_MUL; | ||
607 | val |= MXR_GRP_CFG_PIXEL_BLEND_EN; | ||
607 | val |= MXR_GRP_CFG_ALPHA_VAL(0xff); /* non-transparent alpha */ | 608 | val |= MXR_GRP_CFG_ALPHA_VAL(0xff); /* non-transparent alpha */ |
608 | 609 | ||
609 | /* the same configuration for both layers */ | 610 | /* the same configuration for both layers */ |
610 | mixer_reg_write(res, MXR_GRAPHIC_CFG(0), val); | 611 | mixer_reg_write(res, MXR_GRAPHIC_CFG(0), val); |
611 | |||
612 | val |= MXR_GRP_CFG_BLEND_PRE_MUL; | ||
613 | val |= MXR_GRP_CFG_PIXEL_BLEND_EN; | ||
614 | mixer_reg_write(res, MXR_GRAPHIC_CFG(1), val); | 612 | mixer_reg_write(res, MXR_GRAPHIC_CFG(1), val); |
615 | 613 | ||
614 | /* setting video layers */ | ||
615 | val = MXR_GRP_CFG_ALPHA_VAL(0); | ||
616 | mixer_reg_write(res, MXR_VIDEO_CFG, val); | ||
617 | |||
616 | /* configuration of Video Processor Registers */ | 618 | /* configuration of Video Processor Registers */ |
617 | vp_win_reset(ctx); | 619 | vp_win_reset(ctx); |
618 | vp_default_filter(res); | 620 | vp_default_filter(res); |