Re: glint KMS - how to proceed?

2010-07-13 Thread Matt Turner
On Wed, Jun 23, 2010 at 1:22 PM, Matt Turner  wrote:
> On Wed, Jun 23, 2010 at 12:03 PM, James Simmons  
> wrote:
>>
>>> I'm working on modesetting, and I'm kind of unsure how to proceed.
>>>
>>> My repository is here (ignore all the commit dates):
>>> http://git.kernel.org/?p=linux/kernel/git/mattst88/glint.git;a=summary
>>
>> I also did one for the 3Dfx drm driver. Just as a note make sure that your
>> glint driver works with the xorg driver. After I had a 3Dfx KMS driver the
>> xorg driver no longer worked :-(. I would need to rework the xord driver
>> first then be able to submit my KMS driver.
>
> Is your 3dfx DRM driver available somewhere? It would be interesting to see.
>
> Thanks,
> Matt

Ping? Can we see your driver?

--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: glint KMS - how to proceed?

2010-06-23 Thread Matt Turner
On Wed, Jun 23, 2010 at 12:03 PM, James Simmons  wrote:
>
>> I'm working on modesetting, and I'm kind of unsure how to proceed.
>>
>> My repository is here (ignore all the commit dates):
>> http://git.kernel.org/?p=linux/kernel/git/mattst88/glint.git;a=summary
>
> I also did one for the 3Dfx drm driver. Just as a note make sure that your
> glint driver works with the xorg driver. After I had a 3Dfx KMS driver the
> xorg driver no longer worked :-(. I would need to rework the xord driver
> first then be able to submit my KMS driver.

Is your 3dfx DRM driver available somewhere? It would be interesting to see.

Thanks,
Matt

--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


glint KMS - how to proceed?

2010-06-17 Thread Matt Turner
I'm working on modesetting, and I'm kind of unsure how to proceed.

My repository is here (ignore all the commit dates):
http://git.kernel.org/?p=linux/kernel/git/mattst88/glint.git;a=summary

I've filled out struct drm_crtc_funcs in glint_crtc.c, except for
cursor_{set,move} (I think I can ignore them for the time being,
right?), and think filling out drm_crtc_helper_funcs is probably the
next step. Locally, I've implemented glint_crtc_dpms, since it gets
called by various other drm_crtc_helper_funcs.

I'm unsure what mode_fixup is, exactly. Alex tells me on IRC that it's
for scaling, which is what the radeon driver does with it.
nv04_crtc.c:nv_crtc_mode_fixup and nv50_crtc.c:nv50_crtc_mode_fixup do
nothing except returning true though. Why?
intel_display.c:intel_crtc_mode_fixup looks like it checks some clocks
or something. I'm not sure what needs to happen in this function, so
please give hints as to what my driver should be doing here.

The biggest piece of implementing drm_crtc_helper_funcs is mode_set.
I've got drivers/video/pm3fb.c in the kernel for reference and the
-glint DDX, so I think I can figure out how to program the clocks, but
trying to figure out the other things that need to happen in mode_set
are getting me. The intel driver's intel_crtc_mode_set is an example
of a function that needs to be split for clarity (600 lines). The
radeon driver's radeon_crtc_mode_set is pretty clear, and calls
radeon_mode_set_base which looks like it's setting up the scanout
buffer for fbcon. Since I haven't done memory management yet, a nudge
in the the right direction here would be nice as well.

Also, at what point do I need to setup encoders/connectors? It looks
like some of these functions are being called by functions in
drm_crtc_helper_funcs.

For both my ability to understand, and for the latter part of the
project, the documentation and tutorial/guides, I'd like to make as
small and incremental changes as possible. Ideally, add a few
functions, be able to see some new growth in the driver. Is there any
milestone I can hit here before going all the way to framebuffer
console? It'd be nice to be able to verify functions like
glint_crtc_load_lut or glint_crtc_dpms work correctly before I add a
bunch more code that depends on them.

Thanks!
Matt

--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH] drm/ttm: include linux/seq_file.h for seq_printf

2010-04-07 Thread Matt Turner
Fixes

drivers/gpu/drm/ttm/ttm_page_alloc.c: In function 'ttm_page_alloc_debugfs':
drivers/gpu/drm/ttm/ttm_page_alloc.c:829: error: implicit declaration of
function 'seq_printf'

Signed-off-by: Matt Turner 
---
 drivers/gpu/drm/ttm/ttm_page_alloc.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c 
b/drivers/gpu/drm/ttm/ttm_page_alloc.c
index 6ca9b27..2ad2dc9 100644
--- a/drivers/gpu/drm/ttm/ttm_page_alloc.c
+++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c
@@ -36,6 +36,7 @@
 #include 
 #include 
 #include 
+#include  /* for seq_printf */
 
 #include 
 #include 
-- 
1.6.5.3


--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [patch] radeon: small memory leak

2010-04-06 Thread Matt Turner
On Tue, Apr 6, 2010 at 6:55 AM, Dan Carpenter  wrote:
> This is an unlikely memory leak, but we may as well fix it.  It's easy
> to fix and every static checker will complain if we don't.
>
> Signed-off-by: Dan Carpenter 
>
> diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c
> index 247f8ee..58845e0 100644
> --- a/drivers/gpu/drm/radeon/atom.c
> +++ b/drivers/gpu/drm/radeon/atom.c
> @@ -1136,6 +1136,7 @@ static int atom_execute_table_locked(struct 
> atom_context *ctx, int index, uint32
>        int len, ws, ps, ptr;
>        unsigned char op;
>        atom_exec_context ectx;
> +       int ret = 0;
>
>        if (!base)
>                return -EINVAL;
> @@ -1168,7 +1169,8 @@ static int atom_execute_table_locked(struct 
> atom_context *ctx, int index, uint32
>                if (ectx.abort) {
>                        DRM_ERROR("atombios stuck executing %04X (len %d, WS 
> %d, PS %d) @ 0x%04X\n",
>                                base, len, ws, ps, ptr - 1);
> -                       return -EINVAL;
> +                       ret = -EINVAL;
> +                       goto free;
>                }
>
>                if (op < ATOM_OP_CNT && op > 0)
> @@ -1183,9 +1185,10 @@ static int atom_execute_table_locked(struct 
> atom_context *ctx, int index, uint32
>        debug_depth--;
>        SDEBUG("<<\n");
>
> +free:
>        if (ws)
>                kfree(ectx.ws);
> -       return 0;
> +       return ret;
>  }
>
>  int atom_execute_table(struct atom_context *ctx, int index, uint32_t * 
> params)
>

Looks good.

Reviewed-by: Matt Turner 

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [PATCH 1/2] libdrm: Move intel_atomic.h to libdrm core for sharing.

2010-03-10 Thread Matt Turner
On Wed, Mar 10, 2010 at 11:20 AM, Pauli Nieminen  wrote:
> intel_atomic.h includes very usefull atomic operations for
> lock free parrallel access of variables. Moving these to
> core libdrm for code sharing with radeon.
>
> Signed-off-by: Pauli Nieminen 
> ---
>  Makefile.am          |    2 +-
>  configure.ac         |    2 +-
>  intel/intel_atomic.h |   56 +-
>  xf86atomic.h         |   93 
> ++
>  4 files changed, 96 insertions(+), 57 deletions(-)
>  create mode 100644 xf86atomic.h
>
> diff --git a/Makefile.am b/Makefile.am
> index ee3ccc7..295121f 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -59,7 +59,7 @@ libdrm_la_SOURCES =                           \
>        libdrm_lists.h
>
>  libdrmincludedir = ${includedir}
> -libdrminclude_HEADERS = xf86drm.h xf86drmMode.h
> +libdrminclude_HEADERS = xf86drm.h xf86drmMode.h xf86atomic.h
>
>  EXTRA_DIST = libdrm.pc.in include/drm/*
>
> diff --git a/configure.ac b/configure.ac
> index aaa8efa..953a758 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -198,7 +198,7 @@ if test "x$INTEL" != "xno"; then
>
>     ])
>     if test "x$drm_cv_atomic_primitives" = xIntel; then
> -           AC_DEFINE(HAVE_INTEL_ATOMIC_PRIMITIVES, 1,
> +           AC_DEFINE(HAVE_LIBDRM_ATOMIC_PRIMITIVES, 1,
>                      [Enable if your compiler supports the Intel __sync_* 
> atomic primitives])
>     fi
>     if test "x$drm_cv_atomic_primitives" = "xlibatomic-ops"; then
> diff --git a/intel/intel_atomic.h b/intel/intel_atomic.h
> index 12bb96b..dcb4ec8 100644
> --- a/intel/intel_atomic.h
> +++ b/intel/intel_atomic.h
> @@ -34,60 +34,6 @@
>  #ifndef INTEL_ATOMICS_H
>  #define INTEL_ATOMICS_H
>
> -#ifdef HAVE_CONFIG_H
> -#include "config.h"
> -#endif
> -
> -#if HAVE_INTEL_ATOMIC_PRIMITIVES
> -
> -#define HAS_ATOMIC_OPS 1
> -
> -typedef struct {
> -       int atomic;
> -} atomic_t;
> -
> -# define atomic_read(x) ((x)->atomic)
> -# define atomic_set(x, val) ((x)->atomic = (val))
> -# define atomic_inc(x) ((void) __sync_fetch_and_add (&(x)->atomic, 1))
> -# define atomic_dec_and_test(x) (__sync_fetch_and_add (&(x)->atomic, -1) == 
> 1)
> -# define atomic_cmpxchg(x, oldv, newv) __sync_val_compare_and_swap 
> (&(x)->atomic, oldv, newv)
> -
> -#endif
> -
> -#if HAVE_LIB_ATOMIC_OPS
> -#include 
> -
> -#define HAS_ATOMIC_OPS 1
> -
> -typedef struct {
> -       AO_t atomic;
> -} atomic_t;
> -
> -# define atomic_read(x) AO_load_full(&(x)->atomic)
> -# define atomic_set(x, val) AO_store_full(&(x)->atomic, (val))
> -# define atomic_inc(x) ((void) AO_fetch_and_add1_full(&(x)->atomic))
> -# define atomic_dec_and_test(x) (AO_fetch_and_sub1_full(&(x)->atomic) == 1)
> -# define atomic_cmpxchg(x, oldv, newv) 
> AO_compare_and_swap_full(&(x)->atomic, oldv, newv)
> -
> -#endif
> -
> -#if defined(__sun) && !defined(HAS_ATOMIC_OPS)  /* Solaris & OpenSolaris */
> -
> -#include 
> -#define HAS_ATOMIC_OPS 1
> -
> -typedef struct { uint_t atomic; } atomic_t;
> -
> -# define atomic_read(x) (int) ((x)->atomic)
> -# define atomic_set(x, val) ((x)->atomic = (uint_t)(val))
> -# define atomic_inc(x) (atomic_inc_uint (&(x)->atomic))
> -# define atomic_dec_and_test(x) (atomic_dec_uint_nv(&(x)->atomic) == 1)
> -# define atomic_cmpxchg(x, oldv, newv) atomic_cas_uint (&(x)->atomic, oldv, 
> newv)
> -
> -#endif
> -
> -#if ! HAS_ATOMIC_OPS
> -#error libdrm-intel requires atomic operations, please define them for your 
> CPU/compiler.
> -#endif
> +#include 
>
>  #endif
> diff --git a/xf86atomic.h b/xf86atomic.h
> new file mode 100644
> index 000..627dcf2
> --- /dev/null
> +++ b/xf86atomic.h
> @@ -0,0 +1,93 @@
> +/*
> + * Copyright © 2009 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
> DEALINGS
> + * IN THE SOFTWARE.
> + *
> + * Authors:
> + *    Chris Wilson 
> + *
> + */
> +
> +/**
> + * @file intel_atomics.h

This needs to be updated.

> + *
> + 

Re: Making Xorg easier to test (was Re: [git pull] drm request 3)

2010-03-05 Thread Matt Turner
On Fri, Mar 5, 2010 at 5:00 AM, Carlos R. Mafra  wrote:
> Why can't there be a 'Linus Torvalds' for Xorg accepting patches from various
> maintainers and keeping the whole thing tied up? Why can't it mimic the
> 'make menuconfig' way of selecting what to compile to have the guarantee that
> the whole thing will simply work nicely together?

You must not follow X development at all. His name is Keith Packard.

Matt Turner

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: Move lists to freedesktop.org?

2010-03-04 Thread Matt Turner
On Thu, Mar 4, 2010 at 3:37 PM, Jesse Barnes  wrote:
> Would anyone have objections if these lists moved to freedesktop.org?
> The recent thread with Linus about the drm pull request highlights the
> post lag and non-subscriber aspect of the current lists, and that
> leaves aside sf.net's horrible mail archive interface and poor
> performance.
>
> If spam is an issue, another option would be vger.kernel.org.  That
> team runs lkml and several other very high traffic, high profile lists
> and manages quite well; performance is always high and spam is nearly
> non-existent given the amount of traffic.
>
> --
> Jesse Barnes, Intel Open Source Technology Center

As a user and occasional poster to these lists, that sounds very good to me.

> --
> Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev

It'd be nice to get rid of these silly advertisements too.

Matt

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [git pull] drm request 3

2010-03-04 Thread Matt Turner
On Thu, Mar 4, 2010 at 1:18 PM, Linus Torvalds
 wrote:
> but why the hell wasn't I made aware of it before-hand? Quite frankly, I
> probably wouldn't have pulled it.

>From Dave's initial pull request "[git pull] drm merge" from March 1,
he does say

> *NOTE* in case you missed it: this will *break* your nvidia machine, its 
> purely
> intentional. Rawhide should have the libdrm and driver updates necessary.

Matt Turner

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH] drm/vmwgfx: use ALIGN instead of open coding it

2010-02-24 Thread Matt Turner
CC: Jakob Bornecrantz 
Signed-off-by: Matt Turner 
---
 drivers/gpu/drm/vmwgfx/svga_overlay.h |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/vmwgfx/svga_overlay.h 
b/drivers/gpu/drm/vmwgfx/svga_overlay.h
index f753d73..55b7627 100644
--- a/drivers/gpu/drm/vmwgfx/svga_overlay.h
+++ b/drivers/gpu/drm/vmwgfx/svga_overlay.h
@@ -143,7 +143,7 @@ VMwareVideoGetAttributes(const SVGAOverlayFormat format,
// IN
 {
 int tmp;
 
-*width = (*width + 1) & ~1;
+*width = ALIGN(*width, 2)
 
 if (offsets) {
 offsets[0] = 0;
@@ -151,8 +151,8 @@ VMwareVideoGetAttributes(const SVGAOverlayFormat format,
// IN
 
 switch (format) {
 case VMWARE_FOURCC_YV12:
-   *height = (*height + 1) & ~1;
-   *size = (*width + 3) & ~3;
+   *height = ALIGN(*height, 2);
+   *size = ALIGN(*width, 4);
 
if (pitches) {
   pitches[0] = *size;
@@ -164,7 +164,7 @@ VMwareVideoGetAttributes(const SVGAOverlayFormat format,
// IN
   offsets[1] = *size;
}
 
-   tmp = ((*width >> 1) + 3) & ~3;
+   tmp = ALIGN(*width >> 1, 4);
 
if (pitches) {
   pitches[1] = pitches[2] = tmp;
-- 
1.6.4.4


--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH] drm/radeon: use ALIGN instead of open coding it

2010-02-24 Thread Matt Turner
CC: Jerome Glisse 
CC: Alex Deucher 
CC: Dave Airlie 
Signed-off-by: Matt Turner 
---
 drivers/gpu/drm/radeon/r600_blit.c |2 +-
 drivers/gpu/drm/radeon/r600_blit_kms.c |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/radeon/r600_blit.c 
b/drivers/gpu/drm/radeon/r600_blit.c
index 5ea4323..f4fb88e 100644
--- a/drivers/gpu/drm/radeon/r600_blit.c
+++ b/drivers/gpu/drm/radeon/r600_blit.c
@@ -49,7 +49,7 @@ set_render_target(drm_radeon_private_t *dev_priv, int format, 
int w, int h, u64
RING_LOCALS;
DRM_DEBUG("\n");
 
-   h = (h + 7) & ~7;
+   h = ALIGN(h, 8);
if (h < 8)
h = 8;
 
diff --git a/drivers/gpu/drm/radeon/r600_blit_kms.c 
b/drivers/gpu/drm/radeon/r600_blit_kms.c
index 446b765..ddea43a 100644
--- a/drivers/gpu/drm/radeon/r600_blit_kms.c
+++ b/drivers/gpu/drm/radeon/r600_blit_kms.c
@@ -25,7 +25,7 @@ set_render_target(struct radeon_device *rdev, int format,
u32 cb_color_info;
int pitch, slice;
 
-   h = (h + 7) & ~7;
+   h = ALIGN(h, 8);
if (h < 8)
h = 8;
 
@@ -396,7 +396,7 @@ set_default_state(struct radeon_device *rdev)
NUM_ES_STACK_ENTRIES(num_es_stack_entries));
 
/* emit an IB pointing at default state */
-   dwords = (rdev->r600_blit.state_len + 0xf) & ~0xf;
+   dwords = ALIGN(rdev->r600_blit.state_len, 0x10);
gpu_addr = rdev->r600_blit.shader_gpu_addr + 
rdev->r600_blit.state_offset;
radeon_ring_write(rdev, PACKET3(PACKET3_INDIRECT_BUFFER, 2));
radeon_ring_write(rdev, gpu_addr & 0xFFFC);
-- 
1.6.4.4


--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [PATCH] drm/radeon/kms/atom: use get_unaligned() for ctx->ps

2010-02-13 Thread Matt Turner
Ugh. I missed a */


0001-drm-radeon-kms-atom-use-get_unaligned_le32-for-ctx-p.patch
Description: Binary data
--
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [PATCH] drm/radeon/kms/atom: use get_unaligned() for ctx->ps

2010-02-13 Thread Matt Turner
On Thu, Feb 11, 2010 at 12:50 AM, Alex Deucher  wrote:
> On Wed, Feb 10, 2010 at 11:19 PM, Matt Turner  wrote:
>> Updated patch to use get_unaligned_le32, as suggested by Dave.
>>
>> On Wed, Feb 10, 2010 at 10:56 PM, Matt Turner  wrote:
>>> Noticed on a DEC Alpha.
>>>
>>> Start up into console mode caused 15 unaligned accesses, and starting X
>>> caused another 48.
>>>
>>> Signed-off-by: Matt Turner 
>>> CC: Jerome Glisse 
>>> CC: Alex Deucher 
>>> CC: Dave Airlie 
>>> ---
>>>  drivers/gpu/drm/radeon/atom.c |    5 -
>>>  1 files changed, 4 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c
>>> index bd0c843..c1d3c24 100644
>>> --- a/drivers/gpu/drm/radeon/atom.c
>>> +++ b/drivers/gpu/drm/radeon/atom.c
>>> @@ -24,6 +24,7 @@
>>>
>>>  #include 
>>>  #include 
>>> +#include 
>>>
>>>  #define ATOM_DEBUG
>>>
>>> @@ -212,7 +213,9 @@ static uint32_t atom_get_src_int(atom_exec_context 
>>> *ctx, uint8_t attr,
>>>        case ATOM_ARG_PS:
>>>                idx = U8(*ptr);
>>>                (*ptr)++;
>>> -               val = le32_to_cpu(ctx->ps[idx]);
>>> +               /* get_unaligned avoids unaligned accesses from atombios 
>>> tables
>>> +                * 21, 24, 42. */
>
> Not a big deal, but you might want to mention that this is needed for
> alpha in the comment.  Also, the tables with unaligned accesses will
> probably vary with the card, so there's not really any need to mention
> them here.
>
> Alex

Alright, please check out the attached patch.

Thanks,
Matt


0001-drm-radeon-kms-atom-use-get_unaligned_le32-for-ctx-p.patch
Description: Binary data
--
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [PATCH] drm/radeon/kms: isolate audio engine management, change fini order

2010-02-11 Thread Matt Turner
2010/2/11 Rafał Miłecki :
> We should stop audio-state-reading timer before we turn off engine
>
> Signed-off-by: Rafał Miłecki 
> ---
>  drivers/gpu/drm/radeon/r600_audio.c |   16 
>  1 files changed, 12 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/r600_audio.c 
> b/drivers/gpu/drm/radeon/r600_audio.c
> index b1c1d34..d7f6909 100644
> --- a/drivers/gpu/drm/radeon/r600_audio.c
> +++ b/drivers/gpu/drm/radeon/r600_audio.c
> @@ -147,6 +147,15 @@ static void r600_audio_update_hdmi(unsigned long param)
>  }
>
>  /*
> + * turn on/off audio engine
> + */
> +static void r600_audio_engine_enable(struct radeon_device *rdev, bool enable)
> +{
> +       DRM_INFO("%s audio support", enable ? "Enabling" : "Disabling");
> +       WREG32_P(R600_AUDIO_ENABLE, enable ? 0x8100 : 0x0, ~0x8100);

Maybe a #define instead of using magic numbers?

> +}
> +
> +/*
>  * initialize the audio vars and register the update timer
>  */
>  int r600_audio_init(struct radeon_device *rdev)
> @@ -154,8 +163,7 @@ int r600_audio_init(struct radeon_device *rdev)
>        if (!r600_audio_chipset_supported(rdev))
>                return 0;
>
> -       DRM_INFO("%s audio support", radeon_audio ? "Enabling" : "Disabling");
> -       WREG32_P(R600_AUDIO_ENABLE, radeon_audio ? 0x8100 : 0x0, 
> ~0x8100);
> +       r600_audio_engine_enable(rdev, radeon_audio);
>
>        rdev->audio_channels = -1;
>        rdev->audio_rate = -1;
> @@ -261,7 +269,7 @@ void r600_audio_fini(struct radeon_device *rdev)
>        if (!r600_audio_chipset_supported(rdev))
>                return;
>
> -       WREG32_P(R600_AUDIO_ENABLE, 0x0, ~0x8100);
> -
>        del_timer(&rdev->audio_timer);
> +
> +       r600_audio_engine_enable(rdev, false);
>  }
> --
> 1.6.4.2
>
>
> --
> SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
> Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
> http://p.sf.net/sfu/solaris-dev2dev
> --
> ___
> Dri-devel mailing list
> Dri-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/dri-devel
>

--
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [PATCH] drm/radeon/kms/atom: use get_unaligned() for ctx->ps

2010-02-10 Thread Matt Turner
Updated patch to use get_unaligned_le32, as suggested by Dave.

On Wed, Feb 10, 2010 at 10:56 PM, Matt Turner  wrote:
> Noticed on a DEC Alpha.
>
> Start up into console mode caused 15 unaligned accesses, and starting X
> caused another 48.
>
> Signed-off-by: Matt Turner 
> CC: Jerome Glisse 
> CC: Alex Deucher 
> CC: Dave Airlie 
> ---
>  drivers/gpu/drm/radeon/atom.c |    5 -
>  1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c
> index bd0c843..c1d3c24 100644
> --- a/drivers/gpu/drm/radeon/atom.c
> +++ b/drivers/gpu/drm/radeon/atom.c
> @@ -24,6 +24,7 @@
>
>  #include 
>  #include 
> +#include 
>
>  #define ATOM_DEBUG
>
> @@ -212,7 +213,9 @@ static uint32_t atom_get_src_int(atom_exec_context *ctx, 
> uint8_t attr,
>        case ATOM_ARG_PS:
>                idx = U8(*ptr);
>                (*ptr)++;
> -               val = le32_to_cpu(ctx->ps[idx]);
> +               /* get_unaligned avoids unaligned accesses from atombios 
> tables
> +                * 21, 24, 42. */
> +               val = le32_to_cpu(get_unaligned((u32 *)&ctx->ps[idx]));
>                if (print)
>                        DEBUG("PS[0x%02X,0x%04X]", idx, val);
>                break;
> --
> 1.6.5.3
>
>


0001-drm-radeon-kms-atom-use-get_unaligned_le32-for-ctx-p.patch
Description: Binary data
--
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH] drm/radeon/kms/atom: use get_unaligned() for ctx->ps

2010-02-10 Thread Matt Turner
Noticed on a DEC Alpha.

Start up into console mode caused 15 unaligned accesses, and starting X
caused another 48.

Signed-off-by: Matt Turner 
CC: Jerome Glisse 
CC: Alex Deucher 
CC: Dave Airlie 
---
 drivers/gpu/drm/radeon/atom.c |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c
index bd0c843..c1d3c24 100644
--- a/drivers/gpu/drm/radeon/atom.c
+++ b/drivers/gpu/drm/radeon/atom.c
@@ -24,6 +24,7 @@
 
 #include 
 #include 
+#include 
 
 #define ATOM_DEBUG
 
@@ -212,7 +213,9 @@ static uint32_t atom_get_src_int(atom_exec_context *ctx, 
uint8_t attr,
case ATOM_ARG_PS:
idx = U8(*ptr);
(*ptr)++;
-   val = le32_to_cpu(ctx->ps[idx]);
+   /* get_unaligned avoids unaligned accesses from atombios tables
+* 21, 24, 42. */
+   val = le32_to_cpu(get_unaligned((u32 *)&ctx->ps[idx]));
if (print)
DEBUG("PS[0x%02X,0x%04X]", idx, val);
break;
-- 
1.6.5.3


--
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [PATCH] improved LVDS power sequnce on pre-atom chips

2010-01-04 Thread Matt Turner
On Mon, Jan 4, 2010 at 6:57 PM, Paul Menzel
 wrote:
> Am Montag, den 04.01.2010, 18:32 -0500 schrieb Alex Deucher:
>> This patch might help with LVDS resume on pre-atom systems .  Please
>> test and let me know if there are any regressions.
>
> Did you forget to attach the patch? I did not get any.
>
>
> Thanks,
>
> Paul

It was attached to his email, not inlined.

--
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH] drm/radeon/kms: use RADEON_GPU_PAGE_SIZE instead of 4096

2009-10-13 Thread Matt Turner
Signed-off-by: Matt Turner 
---
 drivers/gpu/drm/radeon/r100.c |2 +-
 drivers/gpu/drm/radeon/r300.c |2 +-
 drivers/gpu/drm/radeon/r600.c |   10 +-
 drivers/gpu/drm/radeon/radeon.h   |2 ++
 drivers/gpu/drm/radeon/radeon_benchmark.c |4 ++--
 drivers/gpu/drm/radeon/radeon_gart.c  |   20 ++--
 drivers/gpu/drm/radeon/radeon_test.c  |6 +++---
 7 files changed, 24 insertions(+), 22 deletions(-)

diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c
index 33198dd..c22adff 100644
--- a/drivers/gpu/drm/radeon/r100.c
+++ b/drivers/gpu/drm/radeon/r100.c
@@ -240,7 +240,7 @@ int r100_wb_init(struct radeon_device *rdev)
int r;
 
if (rdev->wb.wb_obj == NULL) {
-   r = radeon_object_create(rdev, NULL, 4096,
+   r = radeon_object_create(rdev, NULL, RADEON_GPU_PAGE_SIZE,
 true,
 RADEON_GEM_DOMAIN_GTT,
 false, &rdev->wb.wb_obj);
diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c
index e08c4a8..2f43ee8 100644
--- a/drivers/gpu/drm/radeon/r300.c
+++ b/drivers/gpu/drm/radeon/r300.c
@@ -113,7 +113,7 @@ int rv370_pcie_gart_enable(struct radeon_device *rdev)
tmp = RADEON_PCIE_TX_GART_UNMAPPED_ACCESS_DISCARD;
WREG32_PCIE(RADEON_PCIE_TX_GART_CNTL, tmp);
WREG32_PCIE(RADEON_PCIE_TX_GART_START_LO, rdev->mc.gtt_location);
-   tmp = rdev->mc.gtt_location + rdev->mc.gtt_size - 4096;
+   tmp = rdev->mc.gtt_location + rdev->mc.gtt_size - RADEON_GPU_PAGE_SIZE;
WREG32_PCIE(RADEON_PCIE_TX_GART_END_LO, tmp);
WREG32_PCIE(RADEON_PCIE_TX_GART_START_HI, 0);
WREG32_PCIE(RADEON_PCIE_TX_GART_END_HI, 0);
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index 6b43a95..1b5aa1f 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -1269,9 +1269,9 @@ int r600_cp_resume(struct radeon_device *rdev)
rb_bufsz = drm_order(rdev->cp.ring_size / 8);
 #ifdef __BIG_ENDIAN
WREG32(CP_RB_CNTL, BUF_SWAP_32BIT | RB_NO_UPDATE |
-   (drm_order(4096/8) << 8) | rb_bufsz);
+   (drm_order(RADEON_GPU_PAGE_SIZE/8) << 8) | rb_bufsz);
 #else
-   WREG32(CP_RB_CNTL, RB_NO_UPDATE | (drm_order(4096/8) << 8) | rb_bufsz);
+   WREG32(CP_RB_CNTL, RB_NO_UPDATE | (drm_order(RADEON_GPU_PAGE_SIZE/8) << 
8) | rb_bufsz);
 #endif
WREG32(CP_SEM_WAIT_TIMER, 0x4);
 
@@ -1400,7 +1400,7 @@ int r600_wb_enable(struct radeon_device *rdev)
int r;
 
if (rdev->wb.wb_obj == NULL) {
-   r = radeon_object_create(rdev, NULL, 4096, true,
+   r = radeon_object_create(rdev, NULL, RADEON_GPU_PAGE_SIZE, true,
RADEON_GEM_DOMAIN_GTT, false, &rdev->wb.wb_obj);
if (r) {
dev_warn(rdev->dev, "failed to create WB buffer 
(%d).\n", r);
@@ -1450,8 +1450,8 @@ int r600_copy_blit(struct radeon_device *rdev,
   uint64_t src_offset, uint64_t dst_offset,
   unsigned num_pages, struct radeon_fence *fence)
 {
-   r600_blit_prepare_copy(rdev, num_pages * 4096);
-   r600_kms_blit_copy(rdev, src_offset, dst_offset, num_pages * 4096);
+   r600_blit_prepare_copy(rdev, num_pages * RADEON_GPU_PAGE_SIZE);
+   r600_kms_blit_copy(rdev, src_offset, dst_offset, num_pages * 
RADEON_GPU_PAGE_SIZE);
r600_blit_done_copy(rdev, fence);
return 0;
 }
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index 3598adc..8b60e36 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -276,6 +276,8 @@ union radeon_gart_table {
struct radeon_gart_table_vram   vram;
 };
 
+#define RADEON_GPU_PAGE_SIZE 4096
+
 struct radeon_gart {
dma_addr_t  table_addr;
unsignednum_gpu_pages;
diff --git a/drivers/gpu/drm/radeon/radeon_benchmark.c 
b/drivers/gpu/drm/radeon/radeon_benchmark.c
index 2e938f7..10bd50a 100644
--- a/drivers/gpu/drm/radeon/radeon_benchmark.c
+++ b/drivers/gpu/drm/radeon/radeon_benchmark.c
@@ -63,7 +63,7 @@ void radeon_benchmark_move(struct radeon_device *rdev, 
unsigned bsize,
if (r) {
goto out_cleanup;
}
-   r = radeon_copy_dma(rdev, saddr, daddr, size / 4096, fence);
+   r = radeon_copy_dma(rdev, saddr, daddr, size / 
RADEON_GPU_PAGE_SIZE, fence);
if (r) {
goto out_cleanup;
}
@@ -88,7 +88,7 @@ void radeon_benchmark_move(struct radeon_device *rdev, 
unsigned bsize,
if (r) {
goto out_cleanup;
}
-   r = radeon_copy_blit(rd

[PATCH] Use RADEON_GPU_PAGE_SIZE instead of hardcoded 4096

2009-09-01 Thread Matt Turner
Cc: Dave Airlie 
Signed-off-by: Matt Turner 
---
 drivers/gpu/drm/radeon/r100.c |2 +-
 drivers/gpu/drm/radeon/r300.c |4 ++--
 drivers/gpu/drm/radeon/r600.c |4 ++--
 drivers/gpu/drm/radeon/radeon.h   |2 ++
 drivers/gpu/drm/radeon/radeon_benchmark.c |4 ++--
 drivers/gpu/drm/radeon/radeon_gart.c  |   20 ++--
 drivers/gpu/drm/radeon/radeon_test.c  |6 +++---
 drivers/gpu/drm/radeon/rv770.c|4 ++--
 8 files changed, 24 insertions(+), 22 deletions(-)

diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c
index 639d5b2..96f3046 100644
--- a/drivers/gpu/drm/radeon/r100.c
+++ b/drivers/gpu/drm/radeon/r100.c
@@ -364,7 +364,7 @@ int r100_wb_init(struct radeon_device *rdev)
int r;
 
if (rdev->wb.wb_obj == NULL) {
-   r = radeon_object_create(rdev, NULL, 4096,
+   r = radeon_object_create(rdev, NULL, RADEON_GPU_PAGE_SIZE,
 true,
 RADEON_GEM_DOMAIN_GTT,
 false, &rdev->wb.wb_obj);
diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c
index 482d6b2..b91243b 100644
--- a/drivers/gpu/drm/radeon/r300.c
+++ b/drivers/gpu/drm/radeon/r300.c
@@ -113,7 +113,7 @@ int rv370_pcie_gart_enable(struct radeon_device *rdev)
tmp = RADEON_PCIE_TX_GART_UNMAPPED_ACCESS_DISCARD;
WREG32_PCIE(RADEON_PCIE_TX_GART_CNTL, tmp);
WREG32_PCIE(RADEON_PCIE_TX_GART_START_LO, rdev->mc.gtt_location);
-   tmp = rdev->mc.gtt_location + rdev->mc.gtt_size - 4096;
+   tmp = rdev->mc.gtt_location + rdev->mc.gtt_size - RADEON_GPU_PAGE_SIZE;
WREG32_PCIE(RADEON_PCIE_TX_GART_END_LO, tmp);
WREG32_PCIE(RADEON_PCIE_TX_GART_START_HI, 0);
WREG32_PCIE(RADEON_PCIE_TX_GART_END_HI, 0);
@@ -917,7 +917,7 @@ static inline void r300_cs_track_clear(struct r300_cs_track 
*track)
unsigned i;
 
track->num_cb = 4;
-   track->maxy = 4096;
+   track->maxy = RADEON_GPU_PAGE_SIZE;
for (i = 0; i < track->num_cb; i++) {
track->cb[i].robj = NULL;
track->cb[i].pitch = 8192;
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index 538cd90..4069fa0 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -54,10 +54,10 @@ int r600_mc_init(struct radeon_device *rdev)
 * discard unmapped mc request
 */
/* FIXME: disable out of gart access */
-   tmp = rdev->mc.gtt_location / 4096;
+   tmp = rdev->mc.gtt_location / RADEON_GPU_PAGE_SIZE;
tmp = REG_SET(R600_LOGICAL_PAGE_NUMBER, tmp);
WREG32(R600_MC_VM_SYSTEM_APERTURE_LOW_ADDR, tmp);
-   tmp = (rdev->mc.gtt_location + rdev->mc.gtt_size) / 4096;
+   tmp = (rdev->mc.gtt_location + rdev->mc.gtt_size) / 
RADEON_GPU_PAGE_SIZE;
tmp = REG_SET(R600_LOGICAL_PAGE_NUMBER, tmp);
WREG32(R600_MC_VM_SYSTEM_APERTURE_HIGH_ADDR, tmp);
 
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index 1041a7c..83542aa 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -301,6 +301,8 @@ union radeon_gart_table {
struct radeon_gart_table_vram   vram;
 };
 
+#define RADEON_GPU_PAGE_SIZE 4096
+
 struct radeon_gart {
dma_addr_t  table_addr;
unsignednum_gpu_pages;
diff --git a/drivers/gpu/drm/radeon/radeon_benchmark.c 
b/drivers/gpu/drm/radeon/radeon_benchmark.c
index 2e938f7..10bd50a 100644
--- a/drivers/gpu/drm/radeon/radeon_benchmark.c
+++ b/drivers/gpu/drm/radeon/radeon_benchmark.c
@@ -63,7 +63,7 @@ void radeon_benchmark_move(struct radeon_device *rdev, 
unsigned bsize,
if (r) {
goto out_cleanup;
}
-   r = radeon_copy_dma(rdev, saddr, daddr, size / 4096, fence);
+   r = radeon_copy_dma(rdev, saddr, daddr, size / 
RADEON_GPU_PAGE_SIZE, fence);
if (r) {
goto out_cleanup;
}
@@ -88,7 +88,7 @@ void radeon_benchmark_move(struct radeon_device *rdev, 
unsigned bsize,
if (r) {
goto out_cleanup;
}
-   r = radeon_copy_blit(rdev, saddr, daddr, size / 4096, fence);
+   r = radeon_copy_blit(rdev, saddr, daddr, size / 
RADEON_GPU_PAGE_SIZE, fence);
if (r) {
goto out_cleanup;
}
diff --git a/drivers/gpu/drm/radeon/radeon_gart.c 
b/drivers/gpu/drm/radeon/radeon_gart.c
index 2977539..bc54501 100644
--- a/drivers/gpu/drm/radeon/radeon_gart.c
+++ b/drivers/gpu/drm/radeon/radeon_gart.c
@@ -133,15 +133,15 @@ void radeon_gart_unbind(struct radeon_device *rdev, 
unsigned offset,

[PATCH] Use RADEON_GPU_PAGE_SIZE instead of hardcoded 4096

2009-09-01 Thread Matt Turner
Cc: Dave Airlie 
Signed-off-by: Matt Turner 
---
 drivers/gpu/drm/radeon/r100.c |2 +-
 drivers/gpu/drm/radeon/r300.c |4 ++--
 drivers/gpu/drm/radeon/r600.c |4 ++--
 drivers/gpu/drm/radeon/radeon.h   |2 ++
 drivers/gpu/drm/radeon/radeon_benchmark.c |4 ++--
 drivers/gpu/drm/radeon/radeon_display.c   |4 ++--
 drivers/gpu/drm/radeon/radeon_gart.c  |   20 ++--
 drivers/gpu/drm/radeon/radeon_test.c  |6 +++---
 drivers/gpu/drm/radeon/rv770.c|4 ++--
 9 files changed, 26 insertions(+), 24 deletions(-)

diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c
index 639d5b2..96f3046 100644
--- a/drivers/gpu/drm/radeon/r100.c
+++ b/drivers/gpu/drm/radeon/r100.c
@@ -364,7 +364,7 @@ int r100_wb_init(struct radeon_device *rdev)
int r;
 
if (rdev->wb.wb_obj == NULL) {
-   r = radeon_object_create(rdev, NULL, 4096,
+   r = radeon_object_create(rdev, NULL, RADEON_GPU_PAGE_SIZE,
 true,
 RADEON_GEM_DOMAIN_GTT,
 false, &rdev->wb.wb_obj);
diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c
index 482d6b2..b91243b 100644
--- a/drivers/gpu/drm/radeon/r300.c
+++ b/drivers/gpu/drm/radeon/r300.c
@@ -113,7 +113,7 @@ int rv370_pcie_gart_enable(struct radeon_device *rdev)
tmp = RADEON_PCIE_TX_GART_UNMAPPED_ACCESS_DISCARD;
WREG32_PCIE(RADEON_PCIE_TX_GART_CNTL, tmp);
WREG32_PCIE(RADEON_PCIE_TX_GART_START_LO, rdev->mc.gtt_location);
-   tmp = rdev->mc.gtt_location + rdev->mc.gtt_size - 4096;
+   tmp = rdev->mc.gtt_location + rdev->mc.gtt_size - RADEON_GPU_PAGE_SIZE;
WREG32_PCIE(RADEON_PCIE_TX_GART_END_LO, tmp);
WREG32_PCIE(RADEON_PCIE_TX_GART_START_HI, 0);
WREG32_PCIE(RADEON_PCIE_TX_GART_END_HI, 0);
@@ -917,7 +917,7 @@ static inline void r300_cs_track_clear(struct r300_cs_track 
*track)
unsigned i;
 
track->num_cb = 4;
-   track->maxy = 4096;
+   track->maxy = RADEON_GPU_PAGE_SIZE;
for (i = 0; i < track->num_cb; i++) {
track->cb[i].robj = NULL;
track->cb[i].pitch = 8192;
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index 538cd90..4069fa0 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -54,10 +54,10 @@ int r600_mc_init(struct radeon_device *rdev)
 * discard unmapped mc request
 */
/* FIXME: disable out of gart access */
-   tmp = rdev->mc.gtt_location / 4096;
+   tmp = rdev->mc.gtt_location / RADEON_GPU_PAGE_SIZE;
tmp = REG_SET(R600_LOGICAL_PAGE_NUMBER, tmp);
WREG32(R600_MC_VM_SYSTEM_APERTURE_LOW_ADDR, tmp);
-   tmp = (rdev->mc.gtt_location + rdev->mc.gtt_size) / 4096;
+   tmp = (rdev->mc.gtt_location + rdev->mc.gtt_size) / 
RADEON_GPU_PAGE_SIZE;
tmp = REG_SET(R600_LOGICAL_PAGE_NUMBER, tmp);
WREG32(R600_MC_VM_SYSTEM_APERTURE_HIGH_ADDR, tmp);
 
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index 1041a7c..83542aa 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -301,6 +301,8 @@ union radeon_gart_table {
struct radeon_gart_table_vram   vram;
 };
 
+#define RADEON_GPU_PAGE_SIZE 4096
+
 struct radeon_gart {
dma_addr_t  table_addr;
unsignednum_gpu_pages;
diff --git a/drivers/gpu/drm/radeon/radeon_benchmark.c 
b/drivers/gpu/drm/radeon/radeon_benchmark.c
index 2e938f7..10bd50a 100644
--- a/drivers/gpu/drm/radeon/radeon_benchmark.c
+++ b/drivers/gpu/drm/radeon/radeon_benchmark.c
@@ -63,7 +63,7 @@ void radeon_benchmark_move(struct radeon_device *rdev, 
unsigned bsize,
if (r) {
goto out_cleanup;
}
-   r = radeon_copy_dma(rdev, saddr, daddr, size / 4096, fence);
+   r = radeon_copy_dma(rdev, saddr, daddr, size / 
RADEON_GPU_PAGE_SIZE, fence);
if (r) {
goto out_cleanup;
}
@@ -88,7 +88,7 @@ void radeon_benchmark_move(struct radeon_device *rdev, 
unsigned bsize,
if (r) {
goto out_cleanup;
}
-   r = radeon_copy_blit(rdev, saddr, daddr, size / 4096, fence);
+   r = radeon_copy_blit(rdev, saddr, daddr, size / 
RADEON_GPU_PAGE_SIZE, fence);
if (r) {
goto out_cleanup;
}
diff --git a/drivers/gpu/drm/radeon/radeon_display.c 
b/drivers/gpu/drm/radeon/radeon_display.c
index af03560..4e91d25 100644
--- a/drivers/gpu/drm/radeon/radeon_display.c
+++ b/drivers/gpu/drm/radeon/radeon_display.c
@@ -633,8 +633,8 @@ int radeon_mod

Radeon kernel-modesetting on Alpha. Problem reading PCI ROM

2009-04-14 Thread Matt Turner
Hi,

I'm testing Jerome Glisse's drm-next-radeon branch which provides
Radeon Kernel-modesetting support on a Samsung UP1500 with a PCI
Radeon X1550.

See http://cgit.freedesktop.org/~glisse/drm-next/log/?h=drm-next-radeon

While doing so, I've hit a few snags, and placed DRM_INFOs and printks
throughout code in question. On Alpha, it hangs after calling
fb_notifier_call_chain in register_framebuffer.

Jerome and I think that the hang may be caused by being unable to read
the PCI ROM.

The radeon_read_bios function makes use of pci_map_rom, which calls
pci_get_rom_size. In pci_get_rom_size, readb(image) doesn't return
0x55. It falls back to read_disabled functions which appear to
succeed.

Why would the ROM not be able to be read by readb? Is this a general
problem, or Alpha-specific?

Attached are relevant dmesg logs and printk patches (against commit
7582b4332602dcf03bb0c79f17e0cf89eeec6623) to give context.

Thanks,

Matt Turner


radeon-kms.log
Description: Binary data


radeon-kms-debugging.patch
Description: Binary data
--
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [PATCH] radeon: Don't print results of microcode writeback if disabled

2009-04-05 Thread Matt Turner
One small change: if writeback test is disabled say 'writeback test
disabled' instead of 'writeback disabled'.

Matt

On Sun, Apr 5, 2009 at 4:15 PM, Matt Turner  wrote:
> Hi,
>
> The attached patch removes the case where something silly like the
> following could be printed to dmesg.
>
> [drm] writeback test failed
> [drm] writeback forced off
>
> Please commit (I don't have commit access).
>
> Thanks,
>
> Matt Turner
>


0001-radeon-Don-t-print-results-of-microcode-writeback-i.patch
Description: Binary data
--
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


[PATCH] radeon: Don't print results of microcode writeback if disabled

2009-04-05 Thread Matt Turner
Hi,

The attached patch removes the case where something silly like the
following could be printed to dmesg.

[drm] writeback test failed
[drm] writeback forced off

Please commit (I don't have commit access).

Thanks,

Matt Turner


0001-radeon-Don-t-print-results-of-microcode-writeback-i.patch
Description: Binary data
--
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel