From sacadmin Wed Oct 19 09:06:52 2005
Received: from jurassic.eng.sun.com (jurassic [129.146.108.38] (may be forged))
	by sac.sfbay.sun.com (8.12.9+Sun/8.12.9) with ESMTP id j9JG6pIQ015710
	for <psarc-record@sac.sfbay.sun.com>; Wed, 19 Oct 2005 09:06:51 -0700 (PDT)
Received: from [129.146.175.65] (new-sac.SFBay.Sun.COM [129.146.175.65])
	by jurassic.eng.sun.com (8.13.5+Sun/8.13.5) with ESMTP id j9JG6p0m275250
	for <psarc-record@sac.sfbay>; Wed, 19 Oct 2005 09:06:51 -0700 (PDT)
Message-ID: <43566FA2.7070502@Sun.Com>
Date: Wed, 19 Oct 2005 09:09:06 -0700
From: John Plocher <John.Plocher@Sun.Com>
User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.7) Gecko/20040618
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: psarc-record@sac.sfbay.sun.com
Subject: [Fwd: sacMaiL Error [PSARC]: gfx_private update for devmap and DMA
 [PSARC/2005/623 Timeout:  10/25/2005]]
Content-Type: multipart/mixed;
 boundary="------------020205060708070507050107"
Status: RO
Content-Length: 9195

This is a multi-part message in MIME format.
--------------020205060708070507050107
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Fixed mail filing bug

--------------020205060708070507050107
Content-Type: message/rfc822;
 name="sacMaiL Error [PSARC]: gfx_private update for devmap and DMA [PSARC/2005/623Timeout:  10/25/2005]"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="sacMaiL Error [PSARC]: gfx_private update for devmap and DMA [PSARC/2005/623Timeout:  10/25/2005]"

Return-path: <sacadmin@sac.sfbay.sun.com>
Received: from fe-amer-10.sun.com ([192.18.108.184])
 by bedge2-mail1.central.sun.com
 (Sun Java System Messaging Server 6.1 HotFix 0.11 (built Jan 28 2005))
 with ESMTP id <0IOL002KA27P9RD0@bedge2-mail1.central.sun.com> for
 plocher@bedge2-mail1.Central.Sun.COM; Tue, 18 Oct 2005 19:16:37 -0600 (MDT)
Received: from conversion-daemon.mail-amer.sun.com by mail-amer.sun.com
 (Sun Java System Messaging Server 6.1 HotFix 0.11 (built Jan 28 2005))
 id <0IOL00I01221VB00@mail-amer.sun.com> for
 plocher@bedge2-mail1.Central.Sun.COM
 (ORCPT plocher@bedge2-mail1.Central.Sun.COM); Tue,
 18 Oct 2005 19:16:37 -0600 (MDT)
Received: from phys-bedge2-2.central.sun.com ([129.147.156.108])
 by mail-amer.sun.com
 (Sun Java System Messaging Server 6.1 HotFix 0.11 (built Jan 28 2005))
 with ESMTP id <0IOL006IW27PVLF6@mail-amer.sun.com> for
 plocher@bedge2-mail1.Central.Sun.COM
 (ORCPT plocher@bedge2-mail1.Central.Sun.COM); Tue,
 18 Oct 2005 19:16:37 -0600 (MDT)
Received: from sfbaymail2sca.sfbay.sun.com ([129.145.155.42])
 by bedge2-mail1.central.sun.com
 (Sun Java System Messaging Server 6.1 HotFix 0.11 (built Jan 28 2005))
 with ESMTP id <0IOL002K827P9RD0@bedge2-mail1.central.sun.com> for
 plocher@bedge2-mail1.Central.Sun.COM; Tue, 18 Oct 2005 19:16:37 -0600 (MDT)
Received: from sac.sfbay.sun.com (sac.SFBay.Sun.COM [129.146.175.66])
	by sfbaymail2sca.sfbay.sun.com (8.12.10+Sun/8.12.10/ENSMAIL,v2.2)
 with ESMTP id j9J1Gbao022664; Tue, 18 Oct 2005 18:16:37 -0700 (PDT)
Received: from sac.sfbay.sun.com (localhost [127.0.0.1])
	by sac.sfbay.sun.com (8.12.9+Sun/8.12.9) with ESMTP id j9J1GaIQ016160	for
 <sacadmin@sac.sfbay.sun.com>; Tue, 18 Oct 2005 18:16:36 -0700 (PDT)
Received: (from daemon@localhost)
	by sac.sfbay.sun.com (8.12.9+Sun/8.12.9/Submit)
 id j9J1GaZM016159	for sacadmin@sac.sfbay; Tue, 18 Oct 2005 18:16:36 -0700 (PDT)
Date: Tue, 18 Oct 2005 18:16:36 -0700 (PDT)
From: Sac Administrator <sacadmin@sac.sfbay.sun.com>
Subject: sacMaiL Error [PSARC]: gfx_private update for devmap and DMA
 [PSARC/2005/623 Timeout:  10/25/2005]
To: undisclosed-recipients: ;
Message-id: <200510190116.j9J1GaZM016159@sac.sfbay.sun.com>
Content-type: TEXT/PLAIN
Precedence: junk
Original-recipient: rfc822;plocher@bedge2-mail1.Central.Sun.COM


[This message was auto-generated by the SAC mail system]

NO CASE: 2005/623
    The ProjectID or case number was not found in SAC database.
    The message's Subject line has what looks like a
    project-id or case number, but SAC's project database
    does not contain any information about it.
    The project-id or case number is most likely slightly
    erroneous or does not reference an official SAC project;
    please check it for validity.
    Please contact SACAdmin@sac.sfbay if you have questions.

---- original message follows ----

Date: Tue, 18 Oct 2005 18:16:27 -0700 (PDT)
From: Alan Coopersmith <alanc@sac.sfbay.sun.com>
To: PSARC@sac.sfbay.sun.com
Cc: Cindy.Sabenorio@Sun.COM, John.M.Martin@Sun.COM
Subject: gfx_private update for devmap and DMA [PSARC/2005/623 Timeout:  10/25/2005]

Subject: PSARC FastTrack [10/25/2005]: gfx_private update for devmap and DMA

I am sponsoring this fasttrack for John Martin of the Solaris x86 Platform
team.   It times out on Tuesday, Oct. 25, 2005.

Since this is a simple update to the not-yet-delivered PSARC 2005/475, it
requests the same micro/patch binding as PSARC 2005/475, with the intent
to deliver at the same time.

        -Alan Coopersmith-           alan.coopersmith@sun.com
         Sun Microsystems, Inc. - X Window System Engineering


Template Version: @(#)sac_nextcase 1.55 08/11/04 SMI
This information is Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
1. Introduction
    1.1. Project/Component Working Name:
	 gfx_private update for devmap and DMA
    1.2. Name of Document Author/Supplier:
	 Author:  John Martin
    1.3  Date of This Document:
	18 October, 2005
4. Technical Description

Update of gfx_private misc module to add devmap and DMA functions
=================================================================

This project updates the graphics private misc module defined
by PSARC 2005/475.  It adds devmap functions and provides a
more encapsulated DMA function.

As segmap(9e) is obsolete, drivers are encouraged to use
devmap instead.  However the devmap DDI functions are lacking
in two ways:

  1. devmap_umem_setup() requires a kernel buffer being exported
     to user space be created with ddi_umem_alloc(), but ddi_umem_alloc()
     does not yet allow creation of buffers with suitable DMA
     and cache attributes.

  2. devmap_umem_setup() currently ignores the ddi_device_acc_attr()
     argument, so it does not create user mappings with the
     correct cache attributes.

To solve these issues, this project adds a substitute function
for devmap_umem_setup() which creates the correct cache attributes
on user space mappings and functions which create a dummy 
ddi_umem_cookie from memory allocated with ddi_dma_mem_alloc(),
where the umem cookie is handed to the substitute devmap_umem_setup()
function.


The second change is an update to the DMA function gfxp_fix_mem_cache_attrs().
As this function is only meant to be used to fix the cache attributes
for the kernel mapping created by ddi_dma_mem_alloc(), it makes
more sense to replace this function with a substitute of ddi_dma_mem_alloc()
which then makes certain the cache attributes are correct before
returning.  This change makes the partner private driver code
cleaner and it also makes it easier for the gfx_private function
to be updated when ddi_dma_mem_alloc() creates DMA buffers with
the correct cache attributes for the kernel mappings.  By moving
the existing gfxp_fix_mem_cache_attrs() inside the new DMA function,
it also provides better protection against misuse.

Since gfx_private is partner private the risks of these changes
are minimal.  Sun controls the OS specific portion of the only
client as of this writing that intends to use gfx_private
(NVIDIA, PSARC 2005/371).

devmap function details:
------------------------

    ddi_umem_cookie_t gfxp_umem_cookie_init(caddr_t kva, size_t size);
          Creates a dummy ddi_umem_cookie from KVA created
          by ddi_dma_mem_alloc().  Used to export DMA buffers
          to user space via devmap.

    void gfxp_umem_cookie_destroy();
          Destructor function for dummy ddi_umem_cookie created
          by gfxp_umem_cookie_init().

    int gfxp_devmap_umem_setup( devmap_cookie_t dhc, dev_info_t *dip,
        struct devmap_callback_ctl *callbackops,
        ddi_umem_cookie_t cookie, offset_t off, size_t len,
        uint_t maxprot, uint_t flags, ddi_device_acc_attr_t *accattrp);

          Until devmap_umem_setup() produces the correct UVA cache
          attributes, this function performs the same operations
          as devmap_umem_setup() but also makes certain the cache
          attributes are correct.

dma function details:
---------------------

    int gfxp_ddi_dma_mem_alloc(ddi_dma_handle_t handle, size_t length,
        ddi_device_acc_attr_t  *accattrp, uint_t flags, 
	int (*waitfp) (caddr_t), caddr_t arg, caddr_t *kaddrp, 
	size_t *real_length, ddi_acc_handle_t *handlep);

          Until ddi_dma_mem_alloc() returns kernel mappings that have
          the correct cache attributes defined by ddi_device_acc_attr_t,
          this function performs the same operations as ddi_dma_mem_alloc()
          but it also makes certain the cache attributes are correct.
          The proposed implementation just calls ddi_dma_mem_alloc()
          and then calls gfxp_fix_mem_cache_attrs() which is removed
          from the API by this project and made private.
     
          There is no change in functionality from what is already
          defined by PSARC 2005/475.  This is just better encapsulation
          of the original gfxp_fix_mem_cache_attrs() function.


Interface Tables
================

Imported Interfaces:
--------------------
    Existing implementation of devmap_umem_setup() with proper
    updating of the devmap_handle_t dh_hat_attr element.

    The elements of ddi_umem_cookie_t needed by the devmap_umem_setup().

Exported Interfaces:
--------------------
    gfxp_ddi_dma_mem_alloc();		Project Private
    gfxp_umem_cookie_destroy();		Project Private
    gfxp_devmap_umem_setup(); 		Project Private
    gfxp_ddi_dma_mem_alloc();		Project Private

6. Resources and Schedule
    6.4. Steering Committee requested information
   	6.4.1. Consolidation C-team Name:
		Desktop
    6.5. ARC review type: FastTrack
---- end of original message ----



--------------020205060708070507050107--

From sacadmin Tue Oct 25 17:56:56 2005
Received: from phys-d3-ha21sca-2 (phys-d3-ha21sca-2.SFBay.Sun.COM [129.145.155.165])
	by sac.sfbay.sun.com (8.12.9+Sun/8.12.9) with ESMTP id j9Q0uuIQ004157
	for <PSARC@sac.sfbay.sun.com>; Tue, 25 Oct 2005 17:56:56 -0700 (PDT)
Received: from conversion-daemon.ha21sca-mail1.sfbay.sun.com by
 ha21sca-mail1.sfbay.sun.com
 (iPlanet Messaging Server 5.2 HotFix 1.24 (built Dec 19 2003))
 id <0IOX00601ZZGPL@ha21sca-mail1.sfbay.sun.com>
 (original mail from alan.coopersmith@sun.com) for PSARC@sac.sfbay.sun.com;
 Tue, 25 Oct 2005 17:57:18 -0700 (PDT)
Received: from [192.168.0.101]
 (vpn-129-150-33-181.Central.Sun.COM [129.150.33.181])
 by ha21sca-mail1.sfbay.sun.com
 (iPlanet Messaging Server 5.2 HotFix 1.24 (built Dec 19 2003))
 with ESMTP id <0IOX00HQMZZHAZ@ha21sca-mail1.sfbay.sun.com>; Tue,
 25 Oct 2005 17:57:18 -0700 (PDT)
Date: Tue, 25 Oct 2005 17:56:47 -0700
From: Alan Coopersmith <alan.coopersmith@sun.com>
Subject: Re: gfx_private update for devmap and DMA [PSARC/2005/623 Timeout:
 10/25/2005]
In-reply-to: <200510190116.j9J1GRPf016095@sac.sfbay.sun.com>
To: PSARC@sac.sfbay.sun.com
Cc: Cindy.Sabenorio@Sun.COM, John.M.Martin@Sun.COM
Message-id: <435ED44F.7000305@sun.com>
MIME-version: 1.0
Content-type: text/plain; charset=ISO-8859-1; format=flowed
Content-transfer-encoding: 7BIT
X-Accept-Language: en-us, en
User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050722)
References: <200510190116.j9J1GRPf016095@sac.sfbay.sun.com>
Status: RO
Content-Length: 406

Alan Coopersmith wrote:
> Subject: PSARC FastTrack [10/25/2005]: gfx_private update for devmap and DMA
> 
> I am sponsoring this fasttrack for John Martin of the Solaris x86 Platform
> team.   It times out on Tuesday, Oct. 25, 2005.

This fasttrack has now timed out and is closed approved.

-- 
	-Alan Coopersmith-           alan.coopersmith@sun.com
	 Sun Microsystems, Inc. - X Window System Engineering

