FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu Kernel Team

 
 
LinkBack Thread Tools
 
Old 03-18-2010, 11:32 PM
Dave Airlie
 
Default drm/radeon/bo: add some fallback placements for VRAM only objects.

On constrained r100 systems compiz would fail to start due to a lack
of memory, we can just fallback place the objects rather than completely
failing it works a lot better.

Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 924788672f9c802a4c8e6bc8d88fbc2c9b2e3089)

Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>

BUGLINK: http://launchpad.net/bugs/507148
---
drivers/gpu/drm/radeon/radeon.h | 2 ++
drivers/gpu/drm/radeon/radeon_object.c | 10 +++++++---
2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index c0356bb..e1553f0 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -214,7 +214,9 @@ struct radeon_bo {
struct list_head list;
/* Protected by tbo.reserved */
u32 placements[3];
+ u32 busy_placements[3];
struct ttm_placement placement;
+ struct ttm_placement busy_placement;
struct ttm_buffer_object tbo;
struct ttm_bo_kmap_obj kmap;
unsigned pin_count;
diff --git a/drivers/gpu/drm/radeon/radeon_object.c b/drivers/gpu/drm/radeon/radeon_object.c
index f1da370..e781fa9 100644
--- a/drivers/gpu/drm/radeon/radeon_object.c
+++ b/drivers/gpu/drm/radeon/radeon_object.c
@@ -65,15 +65,19 @@ bool radeon_ttm_bo_is_radeon_bo(struct ttm_buffer_object *bo)

void radeon_ttm_placement_from_domain(struct radeon_bo *rbo, u32 domain)
{
- u32 c = 0;
+ u32 c = 0, b = 0;

rbo->placement.fpfn = 0;
rbo->placement.lpfn = 0;
rbo->placement.placement = rbo->placements;
- rbo->placement.busy_placement = rbo->placements;
+ rbo->placement.busy_placement = rbo->busy_placements;
if (domain & RADEON_GEM_DOMAIN_VRAM)
rbo->placements[c++] = TTM_PL_FLAG_WC | TTM_PL_FLAG_UNCACHED |
TTM_PL_FLAG_VRAM;
+ /* add busy placement to TTM if VRAM is only option */
+ if (domain == RADEON_GEM_DOMAIN_VRAM) {
+ rbo->busy_placements[b++] = TTM_PL_MASK_CACHING | TTM_PL_FLAG_TT;
+ }
if (domain & RADEON_GEM_DOMAIN_GTT)
rbo->placements[c++] = TTM_PL_MASK_CACHING | TTM_PL_FLAG_TT;
if (domain & RADEON_GEM_DOMAIN_CPU)
@@ -81,7 +85,7 @@ void radeon_ttm_placement_from_domain(struct radeon_bo *rbo, u32 domain)
if (!c)
rbo->placements[c++] = TTM_PL_MASK_CACHING | TTM_PL_FLAG_SYSTEM;
rbo->placement.num_placement = c;
- rbo->placement.num_busy_placement = c;
+ rbo->placement.num_busy_placement = b;
}

int radeon_bo_create(struct radeon_device *rdev, struct drm_gem_object *gobj,
--
1.7.0


Cheers
--- manjo

--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 
Old 03-18-2010, 11:32 PM
Dave Airlie
 
Default drm/radeon/bo: add some fallback placements for VRAM only objects.

On constrained r100 systems compiz would fail to start due to a lack
of memory, we can just fallback place the objects rather than completely
failing it works a lot better.

Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 924788672f9c802a4c8e6bc8d88fbc2c9b2e3089)

Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>

BugLink: http://launchpad.net/bugs/507148

Cherry-picked from git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6.git
---
drivers/gpu/drm/radeon/radeon.h | 2 ++
drivers/gpu/drm/radeon/radeon_object.c | 10 +++++++---
2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index c0356bb..e1553f0 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -214,7 +214,9 @@ struct radeon_bo {
struct list_head list;
/* Protected by tbo.reserved */
u32 placements[3];
+ u32 busy_placements[3];
struct ttm_placement placement;
+ struct ttm_placement busy_placement;
struct ttm_buffer_object tbo;
struct ttm_bo_kmap_obj kmap;
unsigned pin_count;
diff --git a/drivers/gpu/drm/radeon/radeon_object.c b/drivers/gpu/drm/radeon/radeon_object.c
index f1da370..e781fa9 100644
--- a/drivers/gpu/drm/radeon/radeon_object.c
+++ b/drivers/gpu/drm/radeon/radeon_object.c
@@ -65,15 +65,19 @@ bool radeon_ttm_bo_is_radeon_bo(struct ttm_buffer_object *bo)

void radeon_ttm_placement_from_domain(struct radeon_bo *rbo, u32 domain)
{
- u32 c = 0;
+ u32 c = 0, b = 0;

rbo->placement.fpfn = 0;
rbo->placement.lpfn = 0;
rbo->placement.placement = rbo->placements;
- rbo->placement.busy_placement = rbo->placements;
+ rbo->placement.busy_placement = rbo->busy_placements;
if (domain & RADEON_GEM_DOMAIN_VRAM)
rbo->placements[c++] = TTM_PL_FLAG_WC | TTM_PL_FLAG_UNCACHED |
TTM_PL_FLAG_VRAM;
+ /* add busy placement to TTM if VRAM is only option */
+ if (domain == RADEON_GEM_DOMAIN_VRAM) {
+ rbo->busy_placements[b++] = TTM_PL_MASK_CACHING | TTM_PL_FLAG_TT;
+ }
if (domain & RADEON_GEM_DOMAIN_GTT)
rbo->placements[c++] = TTM_PL_MASK_CACHING | TTM_PL_FLAG_TT;
if (domain & RADEON_GEM_DOMAIN_CPU)
@@ -81,7 +85,7 @@ void radeon_ttm_placement_from_domain(struct radeon_bo *rbo, u32 domain)
if (!c)
rbo->placements[c++] = TTM_PL_MASK_CACHING | TTM_PL_FLAG_SYSTEM;
rbo->placement.num_placement = c;
- rbo->placement.num_busy_placement = c;
+ rbo->placement.num_busy_placement = b;
}

int radeon_bo_create(struct radeon_device *rdev, struct drm_gem_object *gobj,
--
1.7.0

Cheers
--- manjo

On Tue, 30 Mar 2010, Stefan Bader wrote:

> Manoj Iyer wrote:
>> Tested the following upstream patchs on Thinkpad T42, this patch seems fix
>> issues with drm/compiz on ATI Radeon Mobility 7500. Please review and pull
>> for lucid.
>>
>>
>> The following changes since commit
>> 762ba435f6c1050068f3372bc61a1477b0066e33:
>> Dave Airlie (1):
>> drm/radeon/bo: add some fallback placements for VRAM only objects.
>>
>> are available in the git repository at:
>>
>> git://kernel.ubuntu.com/manjo/ubuntu-lucid.git lp507148upstream
>>
>> Dave Airlie (1):
>> drm/radeon/kms: don't print error on -ERESTARTSYS.
>>
>> drivers/gpu/drm/radeon/radeon_cs.c | 3 ++-
>> 1 files changed, 2 insertions(+), 1 deletions(-)
>>
>> From 762ba435f6c1050068f3372bc61a1477b0066e33 Mon Sep 17 00:00:00 2001
>> From: Dave Airlie <airlied@redhat.com>
>> Date: Fri, 19 Mar 2010 10:32:10 +1000
>> Subject: [PATCH 1/2] drm/radeon/bo: add some fallback placements for VRAM only objects.
>>
>> On constrained r100 systems compiz would fail to start due to a lack
>> of memory, we can just fallback place the objects rather than completely
>> failing it works a lot better.
>>
>> Cc: stable@kernel.org
>> Signed-off-by: Dave Airlie <airlied@redhat.com>
>> (cherry picked from commit 924788672f9c802a4c8e6bc8d88fbc2c9b2e3089)
>
> You really should document _where_ you got that from. As far as I could see this
> is not in Linus tree.
>
>>
>> Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
>>
>> BUGLINK: http://launchpad.net/bugs/507148
>> ---
>> drivers/gpu/drm/radeon/radeon.h | 2 ++
>> drivers/gpu/drm/radeon/radeon_object.c | 10 +++++++---
>> 2 files changed, 9 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
>> index c0356bb..e1553f0 100644
>> --- a/drivers/gpu/drm/radeon/radeon.h
>> +++ b/drivers/gpu/drm/radeon/radeon.h
>> @@ -214,7 +214,9 @@ struct radeon_bo {
>> struct list_head list;
>> /* Protected by tbo.reserved */
>> u32 placements[3];
>> + u32 busy_placements[3];
>> struct ttm_placement placement;
>> + struct ttm_placement busy_placement;
>> struct ttm_buffer_object tbo;
>> struct ttm_bo_kmap_obj kmap;
>> unsigned pin_count;
>> diff --git a/drivers/gpu/drm/radeon/radeon_object.c b/drivers/gpu/drm/radeon/radeon_object.c
>> index f1da370..e781fa9 100644
>> --- a/drivers/gpu/drm/radeon/radeon_object.c
>> +++ b/drivers/gpu/drm/radeon/radeon_object.c
>> @@ -65,15 +65,19 @@ bool radeon_ttm_bo_is_radeon_bo(struct ttm_buffer_object *bo)
>>
>> void radeon_ttm_placement_from_domain(struct radeon_bo *rbo, u32 domain)
>> {
>> - u32 c = 0;
>> + u32 c = 0, b = 0;
>>
>> rbo->placement.fpfn = 0;
>> rbo->placement.lpfn = 0;
>> rbo->placement.placement = rbo->placements;
>> - rbo->placement.busy_placement = rbo->placements;
>> + rbo->placement.busy_placement = rbo->busy_placements;
>> if (domain & RADEON_GEM_DOMAIN_VRAM)
>> rbo->placements[c++] = TTM_PL_FLAG_WC | TTM_PL_FLAG_UNCACHED |
>> TTM_PL_FLAG_VRAM;
>> + /* add busy placement to TTM if VRAM is only option */
>> + if (domain == RADEON_GEM_DOMAIN_VRAM) {
>> + rbo->busy_placements[b++] = TTM_PL_MASK_CACHING | TTM_PL_FLAG_TT;
>> + }
>> if (domain & RADEON_GEM_DOMAIN_GTT)
>> rbo->placements[c++] = TTM_PL_MASK_CACHING | TTM_PL_FLAG_TT;
>> if (domain & RADEON_GEM_DOMAIN_CPU)
>> @@ -81,7 +85,7 @@ void radeon_ttm_placement_from_domain(struct radeon_bo *rbo, u32 domain)
>> if (!c)
>> rbo->placements[c++] = TTM_PL_MASK_CACHING | TTM_PL_FLAG_SYSTEM;
>> rbo->placement.num_placement = c;
>> - rbo->placement.num_busy_placement = c;
>> + rbo->placement.num_busy_placement = b;
>> }
>>
>> int radeon_bo_create(struct radeon_device *rdev, struct drm_gem_object *gobj,
>
>

--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 

Thread Tools




All times are GMT. The time now is 07:30 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org