summaryrefslogtreecommitdiff
path: root/linux-core/radeon_display.c
diff options
context:
space:
mode:
authorJerome Glisse <glisse@freedesktop.org>2008-11-05 15:59:37 +0100
committerJerome Glisse <glisse@freedesktop.org>2008-11-05 15:59:37 +0100
commitddfb12b32e64d00d302f7fbb36fb079deec3646f (patch)
tree5caeade40ef88936a88e47060b6090aa44d38b94 /linux-core/radeon_display.c
parent7651b4c424aa6c6ac6c47b2d07c8f65d0b9d0191 (diff)
parent68fcb7770efc20b9e27b1724e2fb5ac112a5330e (diff)
Merge branch 'modesetting-gem' of ssh://git.freedesktop.org/git/mesa/drm into modesetting-gem
Diffstat (limited to 'linux-core/radeon_display.c')
-rw-r--r--linux-core/radeon_display.c31
1 files changed, 21 insertions, 10 deletions
diff --git a/linux-core/radeon_display.c b/linux-core/radeon_display.c
index ddc933cc..0b9467fd 100644
--- a/linux-core/radeon_display.c
+++ b/linux-core/radeon_display.c
@@ -263,7 +263,9 @@ bool radeon_setup_enc_conn(struct drm_device *dev)
/* TMDS on DVI */
if ((mode_info->bios_connector[i].connector_type == CONNECTOR_DVI_I) ||
- (mode_info->bios_connector[i].connector_type == CONNECTOR_DVI_D)) {
+ (mode_info->bios_connector[i].connector_type == CONNECTOR_DVI_D) ||
+ (mode_info->bios_connector[i].connector_type == CONNECTOR_HDMI_TYPE_A) ||
+ (mode_info->bios_connector[i].connector_type == CONNECTOR_HDMI_TYPE_B)) {
if (radeon_is_avivo(dev_priv) || radeon_r4xx_atom)
encoder = radeon_encoder_atom_tmds_add(dev, i, mode_info->bios_connector[i].tmds_type);
else {
@@ -601,17 +603,22 @@ static void radeon_user_framebuffer_destroy(struct drm_framebuffer *fb)
if (fb->fbdev)
radeonfb_remove(dev, fb);
+ if (radeon_fb->obj) {
+ mutex_lock(&dev->struct_mutex);
+ drm_gem_object_unreference(radeon_fb->obj);
+ mutex_unlock(&dev->struct_mutex);
+ }
drm_framebuffer_cleanup(fb);
kfree(radeon_fb);
}
static int radeon_user_framebuffer_create_handle(struct drm_framebuffer *fb,
- struct drm_file *file_priv,
- unsigned int *handle)
+ struct drm_file *file_priv,
+ unsigned int *handle)
{
- struct drm_gem_object *object = fb->mm_private;
+ struct radeon_framebuffer *radeon_fb = to_radeon_framebuffer(fb);
- return drm_gem_handle_create(file_priv, object, handle);
+ return drm_gem_handle_create(file_priv, radeon_fb->obj, handle);
}
static const struct drm_framebuffer_funcs radeon_fb_funcs = {
@@ -622,7 +629,7 @@ static const struct drm_framebuffer_funcs radeon_fb_funcs = {
struct drm_framebuffer *
radeon_framebuffer_create(struct drm_device *dev,
struct drm_mode_fb_cmd *mode_cmd,
- void *mm_private)
+ struct drm_gem_object *obj)
{
struct radeon_framebuffer *radeon_fb;
@@ -631,7 +638,10 @@ radeon_framebuffer_create(struct drm_device *dev,
return NULL;
drm_framebuffer_init(dev, &radeon_fb->base, &radeon_fb_funcs);
- drm_helper_mode_fill_fb_struct(&radeon_fb->base, mode_cmd, mm_private);
+ drm_helper_mode_fill_fb_struct(&radeon_fb->base, mode_cmd);
+
+ radeon_fb->obj = obj;
+
return &radeon_fb->base;
}
@@ -641,10 +651,11 @@ radeon_user_framebuffer_create(struct drm_device *dev,
struct drm_mode_fb_cmd *mode_cmd)
{
struct radeon_framebuffer *radeon_fb;
- void *mm_private;
+ struct drm_gem_object *obj;
+
+ obj = drm_gem_object_lookup(dev, file_priv, mode_cmd->handle);
- mm_private = drm_gem_object_lookup(dev, file_priv, mode_cmd->handle);
- return radeon_framebuffer_create(dev, mode_cmd, mm_private);
+ return radeon_framebuffer_create(dev, mode_cmd, obj);
}
static const struct drm_mode_config_funcs radeon_mode_funcs = {