[PATCH 0/7] [RFC] drm/exynos: Add IOMMU support to DRM
> -Original Message- > From: Subash Patel [mailto:subash.ramaswamy at linaro.org] > Sent: Friday, July 13, 2012 3:58 PM > To: Inki Dae > Cc: 'Prathyush K'; dri-devel at lists.freedesktop.org; prathyush at chromium.org; > m.szyprowski at samsung.com > Subject: Re: [PATCH 0/7] [RFC] drm/exynos: Add IOMMU support to DRM > > On 07/13/2012 12:09 PM, Inki Dae wrote: > > > >> -Original Message- > >> From: Prathyush K [mailto:prathyush.k at samsung.com] > >> Sent: Wednesday, July 11, 2012 6:40 PM > >> To: dri-devel at lists.freedesktop.org > >> Cc: prathyush at chromium.org; m.szyprowski at samsung.com; > > inki.dae at samsung.com; > >> subash.ramaswamy at linaro.org > >> Subject: [PATCH 0/7] [RFC] drm/exynos: Add IOMMU support to DRM > >> > >> The dma-mapping framework needs a IOMMU mapping to be created for the > >> device which allocates/maps/frees the non-contig buffer. In the DRM > >> framework, a gem buffer is created by the DRM virtual device and not > >> directly by any of the physical devices (FIMD, HDMI etc). Each gem > object > >> can be set as a framebuffer to one or many of the drm devices. So a gem > >> object cannot be allocated for any one device. All the DRM devices > should > >> be able to access this buffer. > >> > > It's good to use unified iommu table so I agree to your opinion but we > don't > > decide whether we use dma mapping api or not. now dma mapping api has > one > > issue. > > in case of using iommu with dma mapping api, we couldn't use physically > > contiguous memory region with iommu. for this, there is a case that we > > should use physically contiguous memory region with iommu. it is because > we > > sometime may use mfc(hw video codec) with secure zone such as ARM > TrustZone. > > Then, it needs physically contiguous memory region. > > > > Thanks, > > Inki Dae > I agree. In the mainline code, as of now only the arm_dma_ops has the > support allocating > from the CMA. But in the function arm_iommu_alloc_attrs(), there is no > way to know if the > device had declared a contiguous memory range. The reason, we don't > store that cookie > into the device during the dma_declare_contiguous(). So is it advisable > to store such information > like mapping(in the iommu operations) in the device.archdata? > > Regards, > Subash There was my missing point. dma mapping api with iommu tries to allocate pages contiguously if possible. as HW Video codec above, there is the case that physically contiguous memory region is need necessarily but it seems like that now dma mapping api doesn't guarantee fully physically contiguous memory region(for example, if physically contiguous memory allocation is failed then it should return an error so that we can check it) Marek, for this, could you please give us comments? Thanks, Inki Dae > > > >> The proposed method is to create a common IOMMU mapping during drm init. > >> This > >> mapping is then attached to all of the drm devices including the drm > >> device. > >> [PATCH 1/7] drm/exynos: create common IOMMU mapping for DRM > >> > >> During the probe of drm fimd, the driver retrieves a 'sysmmu' field > >> in the device node for fimd. If such a field exists, the driver > retrieves > >> the > >> platform device of the sysmmu device. This sysmmu is set as the sysmmu > >> for fimd. The common mapping created is then attached to fimd. > >> This needs to be done for all the other devices (hdmi, vidi etc). > >> [PATCH 2/7] ARM: EXYNOS5: add sysmmu field to fimd device node > >> [PATCH 3/7] drm/exynos: add IOMMU support to drm fimd > >> > >> During DRM's probe which happens last, the common mapping is set to its > >> archdata > >> and iommu ops are set as its dma ops. This requires a modification in > the > >> dma-mapping framework so that the iommu ops can be visible to all > drivers. > >> [PATCH 4/7] ARM: dma-mapping: rename and export iommu_ops > >> [PATCH 5/7] drm/exynos: attach drm device with common drm mapping > >> > >> Currently allocation and free use the iommu framework by calling > >> dma_alloc_writecombine and dma_free_writecombine respectively. > >> For mapping the buffers to user space, the mmap functions assume that > >> the buffer is contiguous. This is modified by calling > >> dma_mmap_writecombine. > >> [PATCH 6/7] drm/exynos: Add exynos drm specific fb_mmap function > >> [PATCH 7/7] Add IOMMU support for mapping gem object > >> > >> The device tree based patches are based on Leela's patch which was > posted > >> last week for adding DT support to DRM FIMD. The patch to add sysmmu > >> field is for reference only and will be posted to the device tree > >> mailing list. Same with the rename and export iommu_ops patch. > >> > >> These patches are tested on Exynos5250 SMDK board and tested with > modetest > >> from libdrm tests. > >> > >> Prathyush K (7): > >>drm/exynos: create common IOMMU mapping for DRM > >>ARM: EXYNOS5: add sysmmu field to fimd device node > >>drm/exynos: add IOMMU support to drm fimd > >>
[Bug 52171] New: [gallium/r600/clover] Simple benchmarks failed to run
https://bugs.freedesktop.org/show_bug.cgi?id=52171 Bug #: 52171 Summary: [gallium/r600/clover] Simple benchmarks failed to run Classification: Unclassified Product: Mesa Version: git Platform: Other OS/Version: Linux (All) Status: NEW Severity: normal Priority: medium Component: Drivers/Gallium/r600 AssignedTo: dri-devel at lists.freedesktop.org ReportedBy: alexxy at gentoo.org I get benchmarks from here http://www.bealto.com/gpu-benchmarks.html CPU ones runs fine while all gpu benchmarks failed with: Build failed, errors: clGetProgramInfo NUM_DEVICES failed HW is 01:00.0 VGA compatible controller: Advanced Micro Devices [AMD] nee ATI Turks [Radeon HD 6670] -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug.
[git pull] drm gma500 fixes
On Mon, 16 Jul 2012 13:44:32 -0700 Linus Torvalds wrote: > On Mon, Jul 16, 2012 at 12:42 PM, Dave Airlie wrote: > > > > Sorry been travelling and a bit neglectful of some of Alan's > > patches, > > I actually took the three Alan sent me already, exactly because they > seemed harmless and I didn't know your schedule. > > Your pull has a "gma500: Fix frequency detection" patch that I haven't > seen though, which makes me wonder if Alan wants that one too. He only > sent me a series of the three other patches.. > > Alan? The frequency detect bug isn't a regression, indeed its not clear it's a path ever taken. Alan
[git pull] drm gma500 fixes
Hi Linus, Sorry been travelling and a bit neglectful of some of Alan's patches, These all look necessary for -fixes, Dave. The following changes since commit ac7d181e323a888015e19e2e4d776095a0433787: Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging (2012-07-13 11:01:03 -0700) are available in the git repository at: ssh://people.freedesktop.org/~airlied/linux.git drm-fixes for you to fetch changes up to a3928c6b5f43bcd561802b52049b6024b8da675f: gma500,cdv: Fix the brightness base (2012-07-17 04:35:06 +1000) Alan Cox (4): gma500: Fix frequency detection gma500: Fix lid related crash gma500: move the ASLE enable gma500,cdv: Fix the brightness base drivers/gpu/drm/gma500/cdv_device.c | 36 +++ drivers/gpu/drm/gma500/opregion.c |8 +++- drivers/gpu/drm/gma500/opregion.h |5 + drivers/gpu/drm/gma500/psb_device.c | 13 + drivers/gpu/drm/gma500/psb_drv.c|1 + 5 files changed, 34 insertions(+), 29 deletions(-)
[Bug 52136] Mesa fails to link r600_dri.so with LLVM
https://bugs.freedesktop.org/show_bug.cgi?id=52136 --- Comment #1 from Tom Stellard 2012-07-16 13:41:13 PDT --- I've seen this before. The problem is mismatched CXXFLAGS in mesa and llvm. The typeinfo errors are caused the -fno-rtti flag (or the absence of it) and the isCurrentDebugType and DebugFlag errors are cause by -DNDEBUG. The problem with -DNDEBUG is that LLVM defines DNDEBUG in public headers, so if you compiled LLVM with it, you have have to compile Mesa with it as well. If you play with your configure flags you should be able to get this to work. I'll try to look into a proper solution when I get a chance. -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug.
[Bug 52140] Ubuntu Unity - Launcher and switcher icons disappeared
https://bugs.freedesktop.org/show_bug.cgi?id=52140 --- Comment #3 from Alex Deucher 2012-07-16 12:44:43 PDT --- If it broke both AMD and NV hw, it's most likely an Ubuntu specific packaging issue rather than an upstream driver issue and should probably be opened as an ubuntu bug. -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug.
[Bug 52140] Ubuntu Unity - Launcher and switcher icons disappeared
https://bugs.freedesktop.org/show_bug.cgi?id=52140 --- Comment #2 from Alex Deucher 2012-07-16 12:42:34 PDT --- Please attach your xorg log, dmesg output, and glxinfo output. Also, it would be helpful if you could track down what package(s) caused the problem. -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug.
[PATCH 14/15] drm/radeon: record what is next valid wptr for each ring v3
On Fri, Jul 13, 2012 at 9:57 AM, Alex Deucher wrote: > On Fri, Jul 13, 2012 at 9:46 AM, Christian K?nig > wrote: >> On 13.07.2012 14:27, Alex Deucher wrote: >>> >>> On Fri, Jul 13, 2012 at 5:09 AM, Christian K?nig >>> wrote: On 12.07.2012 18:36, Alex Deucher wrote: > > On Thu, Jul 12, 2012 at 12:12 PM, Christian K?nig > wrote: >> >> Before emitting any indirect buffer, emit the offset of the next >> valid ring content if any. This allow code that want to resume >> ring to resume ring right after ib that caused GPU lockup. >> >> v2: use scratch registers instead of storing it into memory >> v3: skip over the surface sync for ni and si as well >> >> Signed-off-by: Jerome Glisse >> Signed-off-by: Christian K?nig >> --- >>drivers/gpu/drm/radeon/evergreen.c |8 +++- >>drivers/gpu/drm/radeon/ni.c | 11 ++- >>drivers/gpu/drm/radeon/r600.c| 18 -- >>drivers/gpu/drm/radeon/radeon.h |1 + >>drivers/gpu/drm/radeon/radeon_ring.c |4 >>drivers/gpu/drm/radeon/rv770.c |4 +++- >>drivers/gpu/drm/radeon/si.c | 22 +++--- >>7 files changed, 60 insertions(+), 8 deletions(-) >> >> diff --git a/drivers/gpu/drm/radeon/evergreen.c >> b/drivers/gpu/drm/radeon/evergreen.c >> index f39b900..40de347 100644 >> --- a/drivers/gpu/drm/radeon/evergreen.c >> +++ b/drivers/gpu/drm/radeon/evergreen.c >> @@ -1368,7 +1368,13 @@ void evergreen_ring_ib_execute(struct >> radeon_device *rdev, struct radeon_ib *ib) >> /* set to DX10/11 mode */ >> radeon_ring_write(ring, PACKET3(PACKET3_MODE_CONTROL, 0)); >> radeon_ring_write(ring, 1); >> - /* FIXME: implement */ >> + >> + if (ring->rptr_save_reg) { >> + uint32_t next_rptr = ring->wptr + 2 + 4; >> + radeon_ring_write(ring, PACKET0(ring->rptr_save_reg, >> 0)); >> + radeon_ring_write(ring, next_rptr); >> + } > > On r600 and newer please use SET_CONFIG_REG rather than Packet0. Why? Please note that it's on purpose that this doesn't interfere with the top/bottom of pipe handling and the draw commands, e.g. the register write isn't associated with drawing but instead just marks the beginning of parsing the IB. >>> >>> Packet0's are have been semi-deprecated since r600. They still work, >>> but the CP guys recommend using the appropriate packet3 whenever >>> possible. >> >> Ok, that makes sense. >> >> Any further comments on the patchset, or can I send that to Dave for merging >> now? > > Other than that, it looks good to me. For the series: > > Reviewed-by: Alex Deucher Thinking about this more, we should probably support a memory locations as well in case there are rings that can't write to registers and since most things now use memory (fences, etc.), I'm not sure we'll always have scratch regs to use. Alex
[Bug 52140] Ubuntu Unity - Launcher and switcher icons disappeared
https://bugs.freedesktop.org/show_bug.cgi?id=52140 --- Comment #1 from black_painkiller at yahoo.it 2012-07-16 11:45:37 PDT --- same for me. ubuntu 12.04, 64bit. xorg-edgers ppa but with nouveau driver. -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug.
[PATCH 10/10] drm/radeon: start to document evergreen.c
From: Alex DeucherStill a lot to do. Signed-off-by: Alex Deucher --- drivers/gpu/drm/radeon/evergreen.c | 120 1 files changed, 120 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c index 4b8e5c5..b560e65 100644 --- a/drivers/gpu/drm/radeon/evergreen.c +++ b/drivers/gpu/drm/radeon/evergreen.c @@ -99,6 +99,14 @@ void evergreen_fix_pci_max_read_req_size(struct radeon_device *rdev) } } +/** + * dce4_wait_for_vblank - vblank wait asic callback. + * + * @rdev: radeon_device pointer + * @crtc: crtc to wait for vblank on + * + * Wait for vblank on the requested crtc (evergreen+). + */ void dce4_wait_for_vblank(struct radeon_device *rdev, int crtc) { struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc]; @@ -118,18 +126,49 @@ void dce4_wait_for_vblank(struct radeon_device *rdev, int crtc) } } +/** + * radeon_irq_kms_pflip_irq_get - pre-pageflip callback. + * + * @rdev: radeon_device pointer + * @crtc: crtc to prepare for pageflip on + * + * Pre-pageflip callback (evergreen+). + * Enables the pageflip irq (vblank irq). + */ void evergreen_pre_page_flip(struct radeon_device *rdev, int crtc) { /* enable the pflip int */ radeon_irq_kms_pflip_irq_get(rdev, crtc); } +/** + * evergreen_post_page_flip - pos-pageflip callback. + * + * @rdev: radeon_device pointer + * @crtc: crtc to cleanup pageflip on + * + * Post-pageflip callback (evergreen+). + * Disables the pageflip irq (vblank irq). + */ void evergreen_post_page_flip(struct radeon_device *rdev, int crtc) { /* disable the pflip int */ radeon_irq_kms_pflip_irq_put(rdev, crtc); } +/** + * evergreen_page_flip - pageflip callback. + * + * @rdev: radeon_device pointer + * @crtc_id: crtc to cleanup pageflip on + * @crtc_base: new address of the crtc (GPU MC address) + * + * Does the actual pageflip (evergreen+). + * During vblank we take the crtc lock and wait for the update_pending + * bit to go high, when it does, we release the lock, and allow the + * double buffered update to take place. + * Returns the current update pending status. + */ u32 evergreen_page_flip(struct radeon_device *rdev, int crtc_id, u64 crtc_base) { struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc_id]; @@ -214,6 +253,15 @@ int sumo_get_temp(struct radeon_device *rdev) return actual_temp * 1000; } +/** + * sumo_pm_init_profile - Initialize power profiles callback. + * + * @rdev: radeon_device pointer + * + * Initialize the power states used in profile mode + * (sumo, trinity, SI). + * Used for profile mode only. + */ void sumo_pm_init_profile(struct radeon_device *rdev) { int idx; @@ -265,6 +313,14 @@ void sumo_pm_init_profile(struct radeon_device *rdev) rdev->pm.power_state[idx].num_clock_modes - 1; } +/** + * evergreen_pm_misc - set additional pm hw parameters callback. + * + * @rdev: radeon_device pointer + * + * Set non-clock parameters associated with a power state + * (voltage, etc.) (evergreen+). + */ void evergreen_pm_misc(struct radeon_device *rdev) { int req_ps_idx = rdev->pm.requested_power_state_index; @@ -292,6 +348,13 @@ void evergreen_pm_misc(struct radeon_device *rdev) } } +/** + * evergreen_pm_prepare - pre-power state change callback. + * + * @rdev: radeon_device pointer + * + * Prepare for a power state change (evergreen+). + */ void evergreen_pm_prepare(struct radeon_device *rdev) { struct drm_device *ddev = rdev->ddev; @@ -310,6 +373,13 @@ void evergreen_pm_prepare(struct radeon_device *rdev) } } +/** + * evergreen_pm_finish - post-power state change callback. + * + * @rdev: radeon_device pointer + * + * Clean up after a power state change (evergreen+). + */ void evergreen_pm_finish(struct radeon_device *rdev) { struct drm_device *ddev = rdev->ddev; @@ -328,6 +398,15 @@ void evergreen_pm_finish(struct radeon_device *rdev) } } +/** + * evergreen_hpd_sense - hpd sense callback. + * + * @rdev: radeon_device pointer + * @hpd: hpd (hotplug detect) pin + * + * Checks if a digital monitor is connected (evergreen+). + * Returns true if connected, false if not connected. + */ bool evergreen_hpd_sense(struct radeon_device *rdev, enum radeon_hpd_id hpd) { bool connected = false; @@ -364,6 +443,14 @@ bool evergreen_hpd_sense(struct radeon_device *rdev, enum radeon_hpd_id hpd) return connected; } +/** + * evergreen_hpd_set_polarity - hpd set polarity callback. + * + * @rdev: radeon_device pointer + * @hpd: hpd (hotplug detect) pin + * + * Set the polarity of the hpd pin (evergreen+). + */ void evergreen_hpd_set_polarity(struct radeon_device *rdev, enum radeon_hpd_id hpd) { @@ -424,6 +511,14 @@ void evergreen_hpd_set_polarity(struct radeon_device *rdev, } } +/** + * evergreen_hpd_init - hpd setup
[PATCH 09/10] drm/radeon: start to document the functions r100.c
From: Alex DeucherStill a lot more to do. Signed-off-by: Alex Deucher --- drivers/gpu/drm/radeon/r100.c | 127 - 1 files changed, 124 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c index 4ee5a74..c3ccf80 100644 --- a/drivers/gpu/drm/radeon/r100.c +++ b/drivers/gpu/drm/radeon/r100.c @@ -65,6 +65,19 @@ MODULE_FIRMWARE(FIRMWARE_R520); #include "r100_track.h" +/* This files gather functions specifics to: + * r100,rv100,rs100,rv200,rs200,r200,rv250,rs300,rv280 + * and others in some cases. + */ + +/** + * r100_wait_for_vblank - vblank wait asic callback. + * + * @rdev: radeon_device pointer + * @crtc: crtc to wait for vblank on + * + * Wait for vblank on the requested crtc (r1xx-r4xx). + */ void r100_wait_for_vblank(struct radeon_device *rdev, int crtc) { struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc]; @@ -99,22 +112,49 @@ void r100_wait_for_vblank(struct radeon_device *rdev, int crtc) } } -/* This files gather functions specifics to: - * r100,rv100,rs100,rv200,rs200,r200,rv250,rs300,rv280 +/** + * r100_pre_page_flip - pre-pageflip callback. + * + * @rdev: radeon_device pointer + * @crtc: crtc to prepare for pageflip on + * + * Pre-pageflip callback (r1xx-r4xx). + * Enables the pageflip irq (vblank irq). */ - void r100_pre_page_flip(struct radeon_device *rdev, int crtc) { /* enable the pflip int */ radeon_irq_kms_pflip_irq_get(rdev, crtc); } +/** + * r100_post_page_flip - pos-pageflip callback. + * + * @rdev: radeon_device pointer + * @crtc: crtc to cleanup pageflip on + * + * Post-pageflip callback (r1xx-r4xx). + * Disables the pageflip irq (vblank irq). + */ void r100_post_page_flip(struct radeon_device *rdev, int crtc) { /* disable the pflip int */ radeon_irq_kms_pflip_irq_put(rdev, crtc); } +/** + * r100_page_flip - pageflip callback. + * + * @rdev: radeon_device pointer + * @crtc_id: crtc to cleanup pageflip on + * @crtc_base: new address of the crtc (GPU MC address) + * + * Does the actual pageflip (r1xx-r4xx). + * During vblank we take the crtc lock and wait for the update_pending + * bit to go high, when it does, we release the lock, and allow the + * double buffered update to take place. + * Returns the current update pending status. + */ u32 r100_page_flip(struct radeon_device *rdev, int crtc_id, u64 crtc_base) { struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc_id]; @@ -141,6 +181,15 @@ u32 r100_page_flip(struct radeon_device *rdev, int crtc_id, u64 crtc_base) return RREG32(RADEON_CRTC_OFFSET + radeon_crtc->crtc_offset) & RADEON_CRTC_OFFSET__GUI_TRIG_OFFSET; } +/** + * r100_pm_get_dynpm_state - look up dynpm power state callback. + * + * @rdev: radeon_device pointer + * + * Look up the optimal power state based on the + * current state of the GPU (r1xx-r5xx). + * Used for dynpm only. + */ void r100_pm_get_dynpm_state(struct radeon_device *rdev) { int i; @@ -223,6 +272,15 @@ void r100_pm_get_dynpm_state(struct radeon_device *rdev) pcie_lanes); } +/** + * r100_pm_init_profile - Initialize power profiles callback. + * + * @rdev: radeon_device pointer + * + * Initialize the power states used in profile mode + * (r1xx-r3xx). + * Used for profile mode only. + */ void r100_pm_init_profile(struct radeon_device *rdev) { /* default */ @@ -262,6 +320,14 @@ void r100_pm_init_profile(struct radeon_device *rdev) rdev->pm.profiles[PM_PROFILE_HIGH_MH_IDX].dpms_on_cm_idx = 0; } +/** + * r100_pm_misc - set additional pm hw parameters callback. + * + * @rdev: radeon_device pointer + * + * Set non-clock parameters associated with a power state + * (voltage, pcie lanes, etc.) (r1xx-r4xx). + */ void r100_pm_misc(struct radeon_device *rdev) { int requested_index = rdev->pm.requested_power_state_index; @@ -353,6 +419,13 @@ void r100_pm_misc(struct radeon_device *rdev) } } +/** + * r100_pm_prepare - pre-power state change callback. + * + * @rdev: radeon_device pointer + * + * Prepare for a power state change (r1xx-r4xx). + */ void r100_pm_prepare(struct radeon_device *rdev) { struct drm_device *ddev = rdev->ddev; @@ -377,6 +450,13 @@ void r100_pm_prepare(struct radeon_device *rdev) } } +/** + * r100_pm_finish - post-power state change callback. + * + * @rdev: radeon_device pointer + * + * Clean up after a power state change (r1xx-r4xx). + */ void r100_pm_finish(struct radeon_device *rdev) { struct drm_device *ddev = rdev->ddev; @@ -401,6 +481,14 @@ void r100_pm_finish(struct radeon_device *rdev) } } +/** + * r100_gui_idle - gui idle callback. + * + * @rdev: radeon_device pointer + * + * Check of the GUI (2D/3D engines) are idle (r1xx-r5xx). + * Returns true if idle, false if not. + */ bool r100_gui_idle(struct radeon_device *rdev) { if (RREG32(RADEON_RBBM_STATUS)
[PATCH 08/10] drm/radeon: document VM functions in radeon_gart.c (v3)
From: Alex DeucherDocument the VM functions in radeon_gart.c v2: adjust per Christian's suggestions v3: adjust to Christains's latest changes Signed-off-by: Alex Deucher --- drivers/gpu/drm/radeon/radeon_gart.c | 142 ++ 1 files changed, 142 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_gart.c b/drivers/gpu/drm/radeon/radeon_gart.c index 9c44c42..b372005 100644 --- a/drivers/gpu/drm/radeon/radeon_gart.c +++ b/drivers/gpu/drm/radeon/radeon_gart.c @@ -397,11 +397,39 @@ void radeon_gart_fini(struct radeon_device *rdev) } /* + * GPUVM + * GPUVM is similar to the legacy gart on older asics, however + * rather than there being a single global gart table + * for the entire GPU, there are multiple VM page tables active + * at any given time. The VM page tables can contain a mix + * vram pages and system memory pages and system memory pages + * can be mapped as snooped (cached system pages) or unsnooped + * (uncached system pages). + * Each VM has an ID associated with it and there is a page table + * associated with each VMID. When execting a command buffer, + * the kernel tells the the ring what VMID to use for that command + * buffer. VMIDs are allocated dynamically as commands are submitted. + * The userspace drivers maintain their own address space and the kernel + * sets up their pages tables accordingly when they submit their + * command buffers and a VMID is assigned. + * Cayman/Trinity support up to 8 active VMs at any given time; + * SI supports 16. + */ + +/* * vm helpers * * TODO bind a default page at vm initialization for default address */ +/** + * radeon_vm_manager_init - init the vm manager + * + * @rdev: radeon_device pointer + * + * Init the vm manager (cayman+). + * Returns 0 for success, error for failure. + */ int radeon_vm_manager_init(struct radeon_device *rdev) { struct radeon_vm *vm; @@ -457,6 +485,16 @@ int radeon_vm_manager_init(struct radeon_device *rdev) } /* global mutex must be lock */ +/** + * radeon_vm_unbind_locked - unbind a specific vm + * + * @rdev: radeon_device pointer + * @vm: vm to unbind + * + * Unbind the requested vm (cayman+). + * Wait for use of the VM to finish, then unbind the page table, + * and free the page table memory. + */ static void radeon_vm_unbind_locked(struct radeon_device *rdev, struct radeon_vm *vm) { @@ -496,6 +534,13 @@ static void radeon_vm_unbind_locked(struct radeon_device *rdev, } } +/** + * radeon_vm_manager_fini - tear down the vm manager + * + * @rdev: radeon_device pointer + * + * Tear down the VM manager (cayman+). + */ void radeon_vm_manager_fini(struct radeon_device *rdev) { struct radeon_vm *vm, *tmp; @@ -517,6 +562,14 @@ void radeon_vm_manager_fini(struct radeon_device *rdev) } /* global mutex must be locked */ +/** + * radeon_vm_unbind - locked version of unbind + * + * @rdev: radeon_device pointer + * @vm: vm to unbind + * + * Locked version that wraps radeon_vm_unbind_locked (cayman+). + */ void radeon_vm_unbind(struct radeon_device *rdev, struct radeon_vm *vm) { mutex_lock(>mutex); @@ -525,6 +578,18 @@ void radeon_vm_unbind(struct radeon_device *rdev, struct radeon_vm *vm) } /* global and local mutex must be locked */ +/** + * radeon_vm_bind - bind a page table to a VMID + * + * @rdev: radeon_device pointer + * @vm: vm to bind + * + * Bind the requested vm (cayman+). + * Suballocate memory for the page table, allocate a VMID + * and bind the page table to it, and finally start to populate + * the page table. + * Returns 0 for success, error for failure. + */ int radeon_vm_bind(struct radeon_device *rdev, struct radeon_vm *vm) { struct radeon_vm *vm_evict; @@ -587,6 +652,20 @@ retry_id: } /* object have to be reserved */ +/** + * radeon_vm_bo_add - add a bo to a specific vm + * + * @rdev: radeon_device pointer + * @vm: requested vm + * @bo: radeon buffer object + * @offset: requested offset of the buffer in the VM address space + * @flags: attributes of pages (read/write/valid/etc.) + * + * Add @bo into the requested vm (cayman+). + * Add @bo to the list of bos associated with the vm and validate + * the offset requested within the vm address space. + * Returns 0 for success, error for failure. + */ int radeon_vm_bo_add(struct radeon_device *rdev, struct radeon_vm *vm, struct radeon_bo *bo, @@ -664,6 +743,17 @@ int radeon_vm_bo_add(struct radeon_device *rdev, return 0; } +/** + * radeon_vm_get_addr - get the physical address of the page + * + * @rdev: radeon_device pointer + * @mem: ttm mem + * @pfn: pfn + * + * Look up the physical address of the page that the pte resolves + * to (cayman+). + * Returns the physical address of the page. + */ static u64 radeon_vm_get_addr(struct radeon_device *rdev, struct ttm_mem_reg *mem,
[PATCH 07/10] drm/radeon: document non-VM functions in radeon_gart.c (v2)
From: Alex DeucherDocument the non-VM functions in radeon_gart.c v2: adjust per Christian's suggestions Signed-off-by: Alex Deucher --- drivers/gpu/drm/radeon/radeon_gart.c | 125 +- 1 files changed, 122 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_gart.c b/drivers/gpu/drm/radeon/radeon_gart.c index 13621df..9c44c42 100644 --- a/drivers/gpu/drm/radeon/radeon_gart.c +++ b/drivers/gpu/drm/radeon/radeon_gart.c @@ -31,8 +31,38 @@ #include "radeon_reg.h" /* + * GART + * The GART (Graphics Aperture Remapping Table) is an aperture + * in the GPU's address space. System pages can be mapped into + * the aperture and look like contiguous pages from the GPU's + * perspective. A page table maps the pages in the aperture + * to the actual backing pages in system memory. + * + * Radeon GPUs support both an internal GART, as described above, + * and AGP. AGP works similarly, but the GART table is configured + * and maintained by the northbridge rather than the driver. + * Radeon hw has a separate AGP aperture that is programmed to + * point to the AGP aperture provided by the northbridge and the + * requests are passed through to the northbridge aperture. + * Both AGP and internal GART can be used at the same time, however + * that is not currently supported by the driver. + * + * This file handles the common internal GART management. + */ + +/* * Common GART table functions. */ +/** + * radeon_gart_table_ram_alloc - allocate system ram for gart page table + * + * @rdev: radeon_device pointer + * + * Allocate system memory for GART page table + * (r1xx-r3xx, non-pcie r4xx, rs400). These asics require the + * gart table to be in system memory. + * Returns 0 for success, -ENOMEM for failure. + */ int radeon_gart_table_ram_alloc(struct radeon_device *rdev) { void *ptr; @@ -54,6 +84,15 @@ int radeon_gart_table_ram_alloc(struct radeon_device *rdev) return 0; } +/** + * radeon_gart_table_ram_free - free system ram for gart page table + * + * @rdev: radeon_device pointer + * + * Free system memory for GART page table + * (r1xx-r3xx, non-pcie r4xx, rs400). These asics require the + * gart table to be in system memory. + */ void radeon_gart_table_ram_free(struct radeon_device *rdev) { if (rdev->gart.ptr == NULL) { @@ -73,6 +112,16 @@ void radeon_gart_table_ram_free(struct radeon_device *rdev) rdev->gart.table_addr = 0; } +/** + * radeon_gart_table_vram_alloc - allocate vram for gart page table + * + * @rdev: radeon_device pointer + * + * Allocate video memory for GART page table + * (pcie r4xx, r5xx+). These asics require the + * gart table to be in video memory. + * Returns 0 for success, error for failure. + */ int radeon_gart_table_vram_alloc(struct radeon_device *rdev) { int r; @@ -88,6 +137,16 @@ int radeon_gart_table_vram_alloc(struct radeon_device *rdev) return 0; } +/** + * radeon_gart_table_vram_pin - pin gart page table in vram + * + * @rdev: radeon_device pointer + * + * Pin the GART page table in vram so it will not be moved + * by the memory manager (pcie r4xx, r5xx+). These asics require the + * gart table to be in video memory. + * Returns 0 for success, error for failure. + */ int radeon_gart_table_vram_pin(struct radeon_device *rdev) { uint64_t gpu_addr; @@ -110,6 +169,14 @@ int radeon_gart_table_vram_pin(struct radeon_device *rdev) return r; } +/** + * radeon_gart_table_vram_unpin - unpin gart page table in vram + * + * @rdev: radeon_device pointer + * + * Unpin the GART page table in vram (pcie r4xx, r5xx+). + * These asics require the gart table to be in video memory. + */ void radeon_gart_table_vram_unpin(struct radeon_device *rdev) { int r; @@ -126,6 +193,15 @@ void radeon_gart_table_vram_unpin(struct radeon_device *rdev) } } +/** + * radeon_gart_table_vram_free - free gart page table vram + * + * @rdev: radeon_device pointer + * + * Free the video memory used for the GART page table + * (pcie r4xx, r5xx+). These asics require the gart table to + * be in video memory. + */ void radeon_gart_table_vram_free(struct radeon_device *rdev) { if (rdev->gart.robj == NULL) { @@ -135,12 +211,19 @@ void radeon_gart_table_vram_free(struct radeon_device *rdev) radeon_bo_unref(>gart.robj); } - - - /* * Common gart functions. */ +/** + * radeon_gart_unbind - unbind pages from the gart page table + * + * @rdev: radeon_device pointer + * @offset: offset into the GPU's gart aperture + * @pages: number of pages to unbind + * + * Unbinds the requested pages from the gart page table and + * replaces them with the dummy page (all asics). + */ void radeon_gart_unbind(struct radeon_device *rdev, unsigned offset, int pages) { @@ -172,6 +255,19 @@ void radeon_gart_unbind(struct radeon_device *rdev, unsigned offset, radeon_gart_tlb_flush(rdev); } +/** + *
[PATCH 06/10] drm/radeon: document radeon_ring.c (v3)
From: Alex DeucherAdds documentation to most of the functions in radeon_ring.c v2: adjust per Christian's suggestions v3: adjust per Christian's latest patches Signed-off-by: Alex Deucher --- drivers/gpu/drm/radeon/radeon_ring.c | 207 +- 1 files changed, 204 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_ring.c b/drivers/gpu/drm/radeon/radeon_ring.c index c48c354..3a487cd 100644 --- a/drivers/gpu/drm/radeon/radeon_ring.c +++ b/drivers/gpu/drm/radeon/radeon_ring.c @@ -35,10 +35,28 @@ #include "atom.h" /* - * IB. + * IB + * IBs (Indirect Buffers) and areas of GPU accessible memory where + * commands are stored. You can put a pointer to the IB in the + * command ring and the hw will fetch the commands from the IB + * and execute them. Generally userspace acceleration drivers + * produce command buffers which are send to the kernel and + * put in IBs for execution by the requested ring. */ int radeon_debugfs_sa_init(struct radeon_device *rdev); +/** + * radeon_ib_get - request an IB (Indirect Buffer) + * + * @rdev: radeon_device pointer + * @ring: ring index the IB is associated with + * @ib: IB object returned + * @size: requested IB size + * + * Request an IB (all asics). IBs are allocated using the + * suballocator. + * Returns 0 on success, error on failure. + */ int radeon_ib_get(struct radeon_device *rdev, int ring, struct radeon_ib *ib, unsigned size) { @@ -67,6 +85,14 @@ int radeon_ib_get(struct radeon_device *rdev, int ring, return 0; } +/** + * radeon_ib_free - free an IB (Indirect Buffer) + * + * @rdev: radeon_device pointer + * @ib: IB object to free + * + * Free an IB (all asics). + */ void radeon_ib_free(struct radeon_device *rdev, struct radeon_ib *ib) { radeon_semaphore_free(rdev, >semaphore, ib->fence); @@ -74,6 +100,26 @@ void radeon_ib_free(struct radeon_device *rdev, struct radeon_ib *ib) radeon_fence_unref(>fence); } +/** + * radeon_ib_schedule - schedule an IB (Indirect Buffer) on the ring + * + * @rdev: radeon_device pointer + * @ib: IB object to schedule + * @const_ib: Const IB to schedule (SI only) + * + * Schedule an IB on the associated ring (all asics). + * Returns 0 on success, error on failure. + * + * On SI, there are two parallel engines fed from the primary ring, + * the CE (Constant Engine) and the DE (Drawing Engine). Since + * resource descriptors have moved to memory, the CE allows you to + * prime the caches while the DE is updating register state so that + * the resource descriptors will be already in cache when the draw is + * processed. To accomplish this, the userspace driver submits two + * IBs, one for the CE and one for the DE. If there is a CE IB (called + * a CONST_IB), it will be put on the ring prior to the DE IB. Prior + * to SI there was just a DE IB. + */ int radeon_ib_schedule(struct radeon_device *rdev, struct radeon_ib *ib, struct radeon_ib *const_ib) { @@ -124,6 +170,15 @@ int radeon_ib_schedule(struct radeon_device *rdev, struct radeon_ib *ib, return 0; } +/** + * radeon_ib_pool_init - Init the IB (Indirect Buffer) pool + * + * @rdev: radeon_device pointer + * + * Initialize the suballocator to manage a pool of memory + * for use as IBs (all asics). + * Returns 0 on success, error on failure. + */ int radeon_ib_pool_init(struct radeon_device *rdev) { int r; @@ -150,6 +205,14 @@ int radeon_ib_pool_init(struct radeon_device *rdev) return 0; } +/** + * radeon_ib_pool_fini - Free the IB (Indirect Buffer) pool + * + * @rdev: radeon_device pointer + * + * Tear down the suballocator managing the pool of memory + * for use as IBs (all asics). + */ void radeon_ib_pool_fini(struct radeon_device *rdev) { if (rdev->ib_pool_ready) { @@ -159,6 +222,16 @@ void radeon_ib_pool_fini(struct radeon_device *rdev) } } +/** + * radeon_ib_ring_tests - test IBs on the rings + * + * @rdev: radeon_device pointer + * + * Test an IB (Indirect Buffer) on each ring. + * If the test fails, disable the ring. + * Returns 0 on success, error if the primary GFX ring + * IB test fails. + */ int radeon_ib_ring_tests(struct radeon_device *rdev) { unsigned i; @@ -190,10 +263,28 @@ int radeon_ib_ring_tests(struct radeon_device *rdev) } /* - * Ring. + * Rings + * Most engines on the GPU are fed via ring buffers. Ring + * buffers are areas of GPU accessible memory that the host + * writes commands into and the GPU reads commands out of. + * There is a rptr (read pointer) that determines where the + * GPU is currently reading, and a wptr (write pointer) + * which determines where the host has written. When the + * pointers are equal, the ring is idle. When the host + * writes commands to the ring buffer, it increments the + * wptr. The GPU then starts fetching commands and executes + * them until the pointers are equal again. */ int
[PATCH 05/10] drm/radeon: document radeon_fence.c (v2)
From: Alex DeucherAdds documentation to most of the functions in radeon_fence.c v2: address Christian's comments: - split common concept description into it's own comment - fix description of intr parameter - Improve description of -EDEADLK error Signed-off-by: Alex Deucher --- drivers/gpu/drm/radeon/radeon_fence.c | 242 - 1 files changed, 240 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_fence.c b/drivers/gpu/drm/radeon/radeon_fence.c index 7a181c3..7b737b9 100644 --- a/drivers/gpu/drm/radeon/radeon_fence.c +++ b/drivers/gpu/drm/radeon/radeon_fence.c @@ -40,6 +40,26 @@ #include "radeon.h" #include "radeon_trace.h" +/* + * Fences + * Fences mark an event in the GPUs pipeline and are used + * for GPU/CPU synchronization. When the fence is written, + * it is expected that all buffers associated with that fence + * are no longer in use by the associated ring on the GPU and + * that the the relevant GPU caches have been flushed. Whether + * we use a scratch register or memory location depends on the asic + * and whether writeback is enabled. + */ + +/** + * radeon_fence_write - write a fence value + * + * @rdev: radeon_device pointer + * @seq: sequence number to write + * @ring: ring index the fence is associated with + * + * Writes a fence value to memory or a scratch register (all asics). + */ static void radeon_fence_write(struct radeon_device *rdev, u32 seq, int ring) { struct radeon_fence_driver *drv = >fence_drv[ring]; @@ -50,6 +70,15 @@ static void radeon_fence_write(struct radeon_device *rdev, u32 seq, int ring) } } +/** + * radeon_fence_read - read a fence value + * + * @rdev: radeon_device pointer + * @ring: ring index the fence is associated with + * + * Reads a fence value from memory or a scratch register (all asics). + * Returns the value of the fence read from memory or register. + */ static u32 radeon_fence_read(struct radeon_device *rdev, int ring) { struct radeon_fence_driver *drv = >fence_drv[ring]; @@ -63,6 +92,16 @@ static u32 radeon_fence_read(struct radeon_device *rdev, int ring) return seq; } +/** + * radeon_fence_emit - emit a fence on the requested ring + * + * @rdev: radeon_device pointer + * @fence: radeon fence object + * @ring: ring index the fence is associated with + * + * Emits a fence command on the requested ring (all asics). + * Returns 0 on success, -ENOMEM on failure. + */ int radeon_fence_emit(struct radeon_device *rdev, struct radeon_fence **fence, int ring) @@ -81,6 +120,15 @@ int radeon_fence_emit(struct radeon_device *rdev, return 0; } +/** + * radeon_fence_process - process a fence + * + * @rdev: radeon_device pointer + * @ring: ring index the fence is associated with + * + * Checks the current fence value and wakes the fence queue + * if the sequence number has increased (all asics). + */ void radeon_fence_process(struct radeon_device *rdev, int ring) { uint64_t seq, last_seq; @@ -141,6 +189,13 @@ void radeon_fence_process(struct radeon_device *rdev, int ring) } } +/** + * radeon_fence_destroy - destroy a fence + * + * @kref: fence kref + * + * Frees the fence object (all asics). + */ static void radeon_fence_destroy(struct kref *kref) { struct radeon_fence *fence; @@ -149,6 +204,20 @@ static void radeon_fence_destroy(struct kref *kref) kfree(fence); } +/** + * radeon_fence_seq_signaled - check if a fence sequeuce number has signaled + * + * @rdev: radeon device pointer + * @seq: sequence number + * @ring: ring index the fence is associated with + * + * Check if the last singled fence sequnce number is >= the requested + * sequence number (all asics). + * Returns true if the fence has signaled (current fence value + * is >= requested value) or false if it has not (current fence + * value is < the requested value. Helper function for + * radeon_fence_signaled(). + */ static bool radeon_fence_seq_signaled(struct radeon_device *rdev, u64 seq, unsigned ring) { @@ -163,6 +232,14 @@ static bool radeon_fence_seq_signaled(struct radeon_device *rdev, return false; } +/** + * radeon_fence_signaled - check if a fence has signaled + * + * @fence: radeon fence object + * + * Check if the requested fence has signaled (all asics). + * Returns true if the fence has signaled or false if it has not. + */ bool radeon_fence_signaled(struct radeon_fence *fence) { if (!fence) { @@ -178,6 +255,24 @@ bool radeon_fence_signaled(struct radeon_fence *fence) return false; } +/** + * radeon_fence_wait_seq - wait for a specific sequence number + * + * @rdev: radeon device pointer + * @target_seq: sequence number we want to wait for + * @ring: ring index the fence is associated with + * @intr: use interruptable sleep + * @lock_ring: whether the ring should be locked or not + * + * Wait for
[PATCH 04/10] drm/radeon: document radeon_asic.c
From: Alex DeucherAdds documentation to most of the functions in radeon_asic.c Signed-off-by: Alex Deucher --- drivers/gpu/drm/radeon/radeon_asic.c | 46 ++ 1 files changed, 46 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_asic.c b/drivers/gpu/drm/radeon/radeon_asic.c index f533df5..973417c 100644 --- a/drivers/gpu/drm/radeon/radeon_asic.c +++ b/drivers/gpu/drm/radeon/radeon_asic.c @@ -40,6 +40,16 @@ /* * Registers accessors functions. */ +/** + * radeon_invalid_rreg - dummy reg read function + * + * @rdev: radeon device pointer + * @reg: offset of register + * + * Dummy register read function. Used for register blocks + * that certain asics don't have (all asics). + * Returns the value in the register. + */ static uint32_t radeon_invalid_rreg(struct radeon_device *rdev, uint32_t reg) { DRM_ERROR("Invalid callback to read register 0x%04X\n", reg); @@ -47,6 +57,16 @@ static uint32_t radeon_invalid_rreg(struct radeon_device *rdev, uint32_t reg) return 0; } +/** + * radeon_invalid_wreg - dummy reg write function + * + * @rdev: radeon device pointer + * @reg: offset of register + * @v: value to write to the register + * + * Dummy register read function. Used for register blocks + * that certain asics don't have (all asics). + */ static void radeon_invalid_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v) { DRM_ERROR("Invalid callback to write register 0x%04X with 0x%08X\n", @@ -54,6 +74,14 @@ static void radeon_invalid_wreg(struct radeon_device *rdev, uint32_t reg, uint32 BUG_ON(1); } +/** + * radeon_register_accessor_init - sets up the register accessor callbacks + * + * @rdev: radeon device pointer + * + * Sets up the register accessor callbacks for various register + * apertures. Not all asics have all apertures (all asics). + */ static void radeon_register_accessor_init(struct radeon_device *rdev) { rdev->mc_rreg = _invalid_rreg; @@ -102,6 +130,14 @@ static void radeon_register_accessor_init(struct radeon_device *rdev) /* helper to disable agp */ +/** + * radeon_agp_disable - AGP disable helper function + * + * @rdev: radeon device pointer + * + * Removes AGP flags and changes the gart callbacks on AGP + * cards when using the internal gart rather than AGP (all asics). + */ void radeon_agp_disable(struct radeon_device *rdev) { rdev->flags &= ~RADEON_IS_AGP; @@ -1608,6 +1644,16 @@ static struct radeon_asic si_asic = { }, }; +/** + * radeon_asic_init - register asic specific callbacks + * + * @rdev: radeon device pointer + * + * Registers the appropriate asic specific callbacks for each + * chip family. Also sets other asics specific info like the number + * of crtcs and the register aperture accessors (all asics). + * Returns 0 for success. + */ int radeon_asic_init(struct radeon_device *rdev) { radeon_register_accessor_init(rdev); -- 1.7.7.5
[PATCH 03/10] drm/radeon: document radeon_irq_kms.c
From: Alex DeucherAdds documentation to most of the functions in radeon_irq_kms.c Signed-off-by: Alex Deucher --- drivers/gpu/drm/radeon/radeon_irq_kms.c | 150 +++ 1 files changed, 150 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_irq_kms.c b/drivers/gpu/drm/radeon/radeon_irq_kms.c index 6664514..afaa172 100644 --- a/drivers/gpu/drm/radeon/radeon_irq_kms.c +++ b/drivers/gpu/drm/radeon/radeon_irq_kms.c @@ -34,6 +34,15 @@ #define RADEON_WAIT_IDLE_TIMEOUT 200 +/** + * radeon_driver_irq_handler_kms - irq handler for KMS + * + * @DRM_IRQ_ARGS: args + * + * This is the irq handler for the radeon KMS driver (all asics). + * radeon_irq_process is a macro that points to the per-asic + * irq handler callback. + */ irqreturn_t radeon_driver_irq_handler_kms(DRM_IRQ_ARGS) { struct drm_device *dev = (struct drm_device *) arg; @@ -45,6 +54,17 @@ irqreturn_t radeon_driver_irq_handler_kms(DRM_IRQ_ARGS) /* * Handle hotplug events outside the interrupt handler proper. */ +/** + * radeon_hotplug_work_func - display hotplug work handler + * + * @work: work struct + * + * This is the hot plug event work handler (all asics). + * The work gets scheduled from the irq handler if there + * was a hot plug interrupt. It walks the connector table + * and calls the hotplug handler for each one, then sends + * a drm hotplug event to alert userspace. + */ static void radeon_hotplug_work_func(struct work_struct *work) { struct radeon_device *rdev = container_of(work, struct radeon_device, @@ -61,6 +81,14 @@ static void radeon_hotplug_work_func(struct work_struct *work) drm_helper_hpd_irq_event(dev); } +/** + * radeon_driver_irq_preinstall_kms - drm irq preinstall callback + * + * @dev: drm dev pointer + * + * Gets the hw ready to enable irqs (all asics). + * This function disables all interrupt sources on the GPU. + */ void radeon_driver_irq_preinstall_kms(struct drm_device *dev) { struct radeon_device *rdev = dev->dev_private; @@ -85,12 +113,27 @@ void radeon_driver_irq_preinstall_kms(struct drm_device *dev) radeon_irq_process(rdev); } +/** + * radeon_driver_irq_postinstall_kms - drm irq preinstall callback + * + * @dev: drm dev pointer + * + * Handles stuff to be done after enabling irqs (all asics). + * Returns 0 on success. + */ int radeon_driver_irq_postinstall_kms(struct drm_device *dev) { dev->max_vblank_count = 0x001f; return 0; } +/** + * radeon_driver_irq_uninstall_kms - drm irq uninstall callback + * + * @dev: drm dev pointer + * + * This function disables all interrupt sources on the GPU (all asics). + */ void radeon_driver_irq_uninstall_kms(struct drm_device *dev) { struct radeon_device *rdev = dev->dev_private; @@ -116,6 +159,16 @@ void radeon_driver_irq_uninstall_kms(struct drm_device *dev) spin_unlock_irqrestore(>irq.lock, irqflags); } +/** + * radeon_msi_ok - asic specific msi checks + * + * @rdev: radeon device pointer + * + * Handles asic specific MSI checks to determine if + * MSIs should be enabled on a particular chip (all asics). + * Returns true if MSIs should be enabled, false if MSIs + * should not be enabled. + */ static bool radeon_msi_ok(struct radeon_device *rdev) { /* RV370/RV380 was first asic with MSI support */ @@ -168,6 +221,14 @@ static bool radeon_msi_ok(struct radeon_device *rdev) return true; } +/** + * radeon_irq_kms_init - init driver interrupt info + * + * @rdev: radeon device pointer + * + * Sets up the work irq handlers, vblank init, MSIs, etc. (all asics). + * Returns 0 for success, error for failure. + */ int radeon_irq_kms_init(struct radeon_device *rdev) { int r = 0; @@ -200,6 +261,13 @@ int radeon_irq_kms_init(struct radeon_device *rdev) return 0; } +/** + * radeon_irq_kms_fini - tear down driver interrrupt info + * + * @rdev: radeon device pointer + * + * Tears down the work irq handlers, vblank handlers, MSIs, etc. (all asics). + */ void radeon_irq_kms_fini(struct radeon_device *rdev) { drm_vblank_cleanup(rdev->ddev); @@ -212,6 +280,16 @@ void radeon_irq_kms_fini(struct radeon_device *rdev) flush_work_sync(>hotplug_work); } +/** + * radeon_irq_kms_sw_irq_get - enable software interrupt + * + * @rdev: radeon device pointer + * @ring: ring whose interrupt you want to enable + * + * Enables the software interrupt for a specific ring (all asics). + * The software interrupt is generally used to signal a fence on + * a particular ring. + */ void radeon_irq_kms_sw_irq_get(struct radeon_device *rdev, int ring) { unsigned long irqflags; @@ -226,6 +304,16 @@ void radeon_irq_kms_sw_irq_get(struct radeon_device *rdev, int ring) } } +/** + * radeon_irq_kms_sw_irq_put - disable software interrupt + * + * @rdev: radeon device pointer + * @ring: ring whose interrupt you want to disable + * + * Disables the software interrupt for a
[PATCH 02/10] drm/radeon: document radeon_kms.c
From: Alex DeucherAdds documentation to most of the functions in radeon_kms.c Signed-off-by: Alex Deucher --- drivers/gpu/drm/radeon/radeon_kms.c | 126 +++ 1 files changed, 126 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c index 18b81d6..1d73f16 100644 --- a/drivers/gpu/drm/radeon/radeon_kms.c +++ b/drivers/gpu/drm/radeon/radeon_kms.c @@ -33,6 +33,17 @@ #include #include +/** + * radeon_driver_unload_kms - Main unload function for KMS. + * + * @dev: drm dev pointer + * + * This is the main unload function for KMS (all asics). + * It calls radeon_modeset_fini() to tear down the + * displays, and radeon_device_fini() to tear down + * the rest of the device (CP, writeback, etc.). + * Returns 0 on success. + */ int radeon_driver_unload_kms(struct drm_device *dev) { struct radeon_device *rdev = dev->dev_private; @@ -46,6 +57,19 @@ int radeon_driver_unload_kms(struct drm_device *dev) return 0; } +/** + * radeon_driver_load_kms - Main load function for KMS. + * + * @dev: drm dev pointer + * @flags: device flags + * + * This is the main load function for KMS (all asics). + * It calls radeon_device_init() to set up the non-display + * parts of the chip (asic init, CP, writeback, etc.), and + * radeon_modeset_init() to set up the display parts + * (crtcs, encoders, hotplug detect, etc.). + * Returns 0 on success, error on failure. + */ int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags) { struct radeon_device *rdev; @@ -96,6 +120,16 @@ out: return r; } +/** + * radeon_set_filp_rights - Set filp right. + * + * @dev: drm dev pointer + * @owner: drm file + * @applier: drm file + * @value: value + * + * Sets the filp rights for the device (all asics). + */ static void radeon_set_filp_rights(struct drm_device *dev, struct drm_file **owner, struct drm_file *applier, @@ -118,6 +152,18 @@ static void radeon_set_filp_rights(struct drm_device *dev, /* * Userspace get information ioctl */ +/** + * radeon_info_ioctl - answer a device specific request. + * + * @rdev: radeon device pointer + * @data: request object + * @filp: drm filp + * + * This function is used to pass device specific parameters to the userspace + * drivers. Examples include: pci device id, pipeline parms, tiling params, + * etc. (all asics). + * Returns 0 on success, -EINVAL on failure. + */ int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp) { struct radeon_device *rdev = dev->dev_private; @@ -301,16 +347,40 @@ int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp) /* * Outdated mess for old drm with Xorg being in charge (void function now). */ +/** + * radeon_driver_firstopen_kms - drm callback for first open + * + * @dev: drm dev pointer + * + * Nothing to be done for KMS (all asics). + * Returns 0 on success. + */ int radeon_driver_firstopen_kms(struct drm_device *dev) { return 0; } +/** + * radeon_driver_firstopen_kms - drm callback for last close + * + * @dev: drm dev pointer + * + * Switch vga switcheroo state after last close (all asics). + */ void radeon_driver_lastclose_kms(struct drm_device *dev) { vga_switcheroo_process_delayed_switch(); } +/** + * radeon_driver_open_kms - drm callback for open + * + * @dev: drm dev pointer + * @file_priv: drm file + * + * On device open, init vm on cayman+ (all asics). + * Returns 0 on success, error on failure. + */ int radeon_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv) { struct radeon_device *rdev = dev->dev_private; @@ -339,6 +409,14 @@ int radeon_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv) return 0; } +/** + * radeon_driver_postclose_kms - drm callback for post close + * + * @dev: drm dev pointer + * @file_priv: drm file + * + * On device post close, tear down vm on cayman+ (all asics). + */ void radeon_driver_postclose_kms(struct drm_device *dev, struct drm_file *file_priv) { @@ -354,6 +432,15 @@ void radeon_driver_postclose_kms(struct drm_device *dev, } } +/** + * radeon_driver_preclose_kms - drm callback for pre close + * + * @dev: drm dev pointer + * @file_priv: drm file + * + * On device pre close, tear down hyperz and cmask filps on r1xx-r5xx + * (all asics). + */ void radeon_driver_preclose_kms(struct drm_device *dev, struct drm_file *file_priv) { @@ -367,6 +454,15 @@ void radeon_driver_preclose_kms(struct drm_device *dev, /* * VBlank related functions. */ +/** + * radeon_get_vblank_counter_kms - get frame count + * + * @dev: drm dev pointer + * @crtc: crtc to get the frame count from + * + * Gets the frame count on the requested crtc (all asics). + * Returns frame count on
[PATCH 01/10] drm/radeon: document radeon_device.c (v2)
From: Alex DeucherAdds documentation to most of the functions in radeon_device.c v2: split out general descriptions as per Christian's comments. Signed-off-by: Alex Deucher --- drivers/gpu/drm/radeon/radeon_device.c | 313 +++- 1 files changed, 310 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c index 0302a9f..528dab1 100644 --- a/drivers/gpu/drm/radeon/radeon_device.c +++ b/drivers/gpu/drm/radeon/radeon_device.c @@ -96,8 +96,12 @@ static const char radeon_family_name[][16] = { "LAST", }; -/* - * Clear GPU surface registers. +/** + * radeon_surface_init - Clear GPU surface registers. + * + * @rdev: radeon_device pointer + * + * Clear GPU surface registers (r1xx-r5xx). */ void radeon_surface_init(struct radeon_device *rdev) { @@ -119,6 +123,13 @@ void radeon_surface_init(struct radeon_device *rdev) /* * GPU scratch registers helpers function. */ +/** + * radeon_scratch_init - Init scratch register driver information. + * + * @rdev: radeon_device pointer + * + * Init CP scratch register driver information (r1xx-r5xx) + */ void radeon_scratch_init(struct radeon_device *rdev) { int i; @@ -136,6 +147,15 @@ void radeon_scratch_init(struct radeon_device *rdev) } } +/** + * radeon_scratch_get - Allocate a scratch register + * + * @rdev: radeon_device pointer + * @reg: scratch register mmio offset + * + * Allocate a CP scratch register for use by the driver (all asics). + * Returns 0 on success or -EINVAL on failure. + */ int radeon_scratch_get(struct radeon_device *rdev, uint32_t *reg) { int i; @@ -150,6 +170,14 @@ int radeon_scratch_get(struct radeon_device *rdev, uint32_t *reg) return -EINVAL; } +/** + * radeon_scratch_free - Free a scratch register + * + * @rdev: radeon_device pointer + * @reg: scratch register mmio offset + * + * Free a CP scratch register allocated for use by the driver (all asics) + */ void radeon_scratch_free(struct radeon_device *rdev, uint32_t reg) { int i; @@ -162,6 +190,20 @@ void radeon_scratch_free(struct radeon_device *rdev, uint32_t reg) } } +/* + * radeon_wb_*() + * Writeback is the the method by which the the GPU updates special pages + * in memory with the status of certain GPU events (fences, ring pointers, + * etc.). + */ + +/** + * radeon_wb_disable - Disable Writeback + * + * @rdev: radeon_device pointer + * + * Disables Writeback (all asics). Used for suspend. + */ void radeon_wb_disable(struct radeon_device *rdev) { int r; @@ -177,6 +219,14 @@ void radeon_wb_disable(struct radeon_device *rdev) rdev->wb.enabled = false; } +/** + * radeon_wb_fini - Disable Writeback and free memory + * + * @rdev: radeon_device pointer + * + * Disables Writeback and frees the Writeback memory (all asics). + * Used at driver shutdown. + */ void radeon_wb_fini(struct radeon_device *rdev) { radeon_wb_disable(rdev); @@ -187,6 +237,15 @@ void radeon_wb_fini(struct radeon_device *rdev) } } +/** + * radeon_wb_init- Init Writeback driver info and allocate memory + * + * @rdev: radeon_device pointer + * + * Disables Writeback and frees the Writeback memory (all asics). + * Used at driver startup. + * Returns 0 on success or an -error on failure. + */ int radeon_wb_init(struct radeon_device *rdev) { int r; @@ -355,6 +414,15 @@ void radeon_gtt_location(struct radeon_device *rdev, struct radeon_mc *mc) /* * GPU helpers function. */ +/** + * radeon_card_posted - check if the hw has already been initialized + * + * @rdev: radeon_device pointer + * + * Check if the asic has been initialized (all asics). + * Used at driver startup. + * Returns true if initialized or false if not. + */ bool radeon_card_posted(struct radeon_device *rdev) { uint32_t reg; @@ -404,6 +472,14 @@ bool radeon_card_posted(struct radeon_device *rdev) } +/** + * radeon_update_bandwidth_info - update display bandwidth params + * + * @rdev: radeon_device pointer + * + * Used when sclk/mclk are switched or display modes are set. + * params are used to calculate display watermarks (all asics) + */ void radeon_update_bandwidth_info(struct radeon_device *rdev) { fixed20_12 a; @@ -424,6 +500,15 @@ void radeon_update_bandwidth_info(struct radeon_device *rdev) } } +/** + * radeon_boot_test_post_card - check and possibly initialize the hw + * + * @rdev: radeon_device pointer + * + * Check if the asic is initialized and if not, attempt to initialize + * it (all asics). + * Returns true if initialized or false if not. + */ bool radeon_boot_test_post_card(struct radeon_device *rdev) { if (radeon_card_posted(rdev)) @@ -442,6 +527,16 @@ bool radeon_boot_test_post_card(struct radeon_device *rdev) } } +/** + * radeon_dummy_page_init - init dummy page used by the driver + * + * @rdev: radeon_device pointer + * + * Allocate the
[PATCH 00/10] Radeon documentation updates for drm-next
From: Alex DeucherSame as my previous set, but rebased on Christian's latest ring changes for drm-next: http://cgit.freedesktop.org/~deathsimple/linux/log/?h=wip Alex Deucher (10): drm/radeon: document radeon_device.c (v2) drm/radeon: document radeon_kms.c drm/radeon: document radeon_irq_kms.c drm/radeon: document radeon_asic.c drm/radeon: document radeon_fence.c (v2) drm/radeon: document radeon_ring.c (v3) drm/radeon: document non-VM functions in radeon_gart.c (v2) drm/radeon: document VM functions in radeon_gart.c (v3) drm/radeon: start to document the functions r100.c drm/radeon: start to document evergreen.c drivers/gpu/drm/radeon/evergreen.c | 120 drivers/gpu/drm/radeon/r100.c | 127 - drivers/gpu/drm/radeon/radeon_asic.c| 46 + drivers/gpu/drm/radeon/radeon_device.c | 313 ++- drivers/gpu/drm/radeon/radeon_fence.c | 242 +++- drivers/gpu/drm/radeon/radeon_gart.c| 267 ++- drivers/gpu/drm/radeon/radeon_irq_kms.c | 150 +++ drivers/gpu/drm/radeon/radeon_kms.c | 126 + drivers/gpu/drm/radeon/radeon_ring.c| 207 - 9 files changed, 1584 insertions(+), 14 deletions(-) -- 1.7.7.5
[PATCH] drm/radeon: update ib_execute for SI
From: Alex DeucherWhen submitting a CONST_IB, emit a SWITCH_BUFFER packet before the CONST_IB. This isn't strictly necessary (the driver will work fine without it), but is good practice and allows for more flexible DE/CE sychronization options in the future. Current userspace drivers do not take advantage of the CE yet. Signed-off-by: Alex Deucher --- drivers/gpu/drm/radeon/si.c |6 ++ drivers/gpu/drm/radeon/sid.h |1 + 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c index 53e313b..191a3cd 100644 --- a/drivers/gpu/drm/radeon/si.c +++ b/drivers/gpu/drm/radeon/si.c @@ -1778,6 +1778,12 @@ void si_ring_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib) else header = PACKET3(PACKET3_INDIRECT_BUFFER, 2); + if (ib->is_const_ib) { + /* set switch buffer packet before const IB */ + radeon_ring_write(ring, PACKET3(PACKET3_SWITCH_BUFFER, 0)); + radeon_ring_write(ring, 0); + } + radeon_ring_write(ring, header); radeon_ring_write(ring, #ifdef __BIG_ENDIAN diff --git a/drivers/gpu/drm/radeon/sid.h b/drivers/gpu/drm/radeon/sid.h index db40679..7869089 100644 --- a/drivers/gpu/drm/radeon/sid.h +++ b/drivers/gpu/drm/radeon/sid.h @@ -901,5 +901,6 @@ #definePACKET3_WAIT_ON_DE_COUNTER_DIFF 0x88 #definePACKET3_SET_CE_DE_COUNTERS 0x89 #definePACKET3_WAIT_ON_AVAIL_BUFFER0x8A +#definePACKET3_SWITCH_BUFFER 0x8B #endif -- 1.7.7.5
[PATCH 8/8] Update .gitignore
--- .gitignore |3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 243457e..eb348fc 100644 --- a/.gitignore +++ b/.gitignore @@ -39,8 +39,10 @@ i915.kld install-sh libdrm/config.h.in libdrm.pc +libdrm_exynos.pc libdrm_intel.pc libdrm_nouveau.pc +libdrm_omap.pc libdrm_radeon.pc libkms.pc libtool @@ -70,6 +72,7 @@ tests/gem_flink tests/gem_mmap tests/gem_readwrite tests/openclose +tests/radeon/radeon_ttm tests/setversion tests/updatedraw tests/modeprint/modeprint -- 1.7.10.4
[PATCH 7/8] Always use width in scanf
--- tests/modetest/modetest.c |8 xf86drm.c |8 xf86drmMode.c |2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c index dff40d1..4540aa0 100644 --- a/tests/modetest/modetest.c +++ b/tests/modetest/modetest.c @@ -1215,10 +1215,10 @@ int main(int argc, char **argv) break; case 's': con_args[count].crtc = -1; - if (sscanf(optarg, "%d:%64s", + if (sscanf(optarg, "%20d:%64s", _args[count].id, con_args[count].mode_str) != 2 && - sscanf(optarg, "%d@%d:%64s", + sscanf(optarg, "%20d@%20d:%64s", _args[count].id, _args[count].crtc, con_args[count].mode_str) != 3) @@ -1227,12 +1227,12 @@ int main(int argc, char **argv) break; case 'P': strcpy(plane_args[plane_count].format_str, "XR24"); - if (sscanf(optarg, "%d:%dx%d@%4s", + if (sscanf(optarg, "%20d:%20dx%20d@%4s", _args[plane_count].con_id, _args[plane_count].w, _args[plane_count].h, plane_args[plane_count].format_str) != 4 && - sscanf(optarg, "%d:%dx%d", + sscanf(optarg, "%20d:%20dx%20d", _args[plane_count].con_id, _args[plane_count].w, _args[plane_count].h) != 3) diff --git a/xf86drm.c b/xf86drm.c index 94f634d..bcb9fbf 100644 --- a/xf86drm.c +++ b/xf86drm.c @@ -224,18 +224,18 @@ static int drmMatchBusID(const char *id1, const char *id2, int pci_domain_ok) unsigned int o2, b2, d2, f2; int ret; - ret = sscanf(id1, "pci:%04x:%02x:%02x.%u", , , , ); + ret = sscanf(id1, "pci:%04x:%02x:%02x.%20u", , , , ); if (ret != 4) { o1 = 0; - ret = sscanf(id1, "PCI:%u:%u:%u", , , ); + ret = sscanf(id1, "PCI:%20u:%20u:%20u", , , ); if (ret != 3) return 0; } - ret = sscanf(id2, "pci:%04x:%02x:%02x.%u", , , , ); + ret = sscanf(id2, "pci:%04x:%02x:%02x.%20u", , , , ); if (ret != 4) { o2 = 0; - ret = sscanf(id2, "PCI:%u:%u:%u", , , ); + ret = sscanf(id2, "PCI:%20u:%20u:%20u", , , ); if (ret != 3) return 0; } diff --git a/xf86drmMode.c b/xf86drmMode.c index 04fdf1f..31b5abd 100644 --- a/xf86drmMode.c +++ b/xf86drmMode.c @@ -693,7 +693,7 @@ int drmCheckModesettingSupported(const char *busid) struct dirent *dent; int found = 0, ret; - ret = sscanf(busid, "pci:%04x:%02x:%02x.%d", , , , ); + ret = sscanf(busid, "pci:%04x:%02x:%02x.%20d", , , , ); if (ret != 4) return -EINVAL; -- 1.7.10.4
[PATCH 6/8] Remove never used assignments
--- xf86drm.c |2 ++ xf86drmSL.c |1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/xf86drm.c b/xf86drm.c index 6ea068f..94f634d 100644 --- a/xf86drm.c +++ b/xf86drm.c @@ -304,7 +304,9 @@ static int drmOpenDevice(long dev, int minor, int type) charbuf[64]; int fd; mode_t devmode = DRM_DEV_MODE, serv_mode; +#if !defined(UDEV) int isroot = !geteuid(); +#endif uid_t user= DRM_DEV_UID; gid_t group = DRM_DEV_GID, serv_group; diff --git a/xf86drmSL.c b/xf86drmSL.c index acddb54..0d639aa 100644 --- a/xf86drmSL.c +++ b/xf86drmSL.c @@ -263,7 +263,6 @@ int drmSLLookupNeighbors(void *l, unsigned long key, unsigned long *prev_key, void **prev_value, unsigned long *next_key, void **next_value) { -SkipListPtr list = (SkipListPtr)l; SLEntryPtrupdate[SL_MAX_LEVEL + 1]; int retcode = 0; -- 1.7.10.4
[PATCH 5/8] Fix possible null pointer dereferences
--- intel/intel_bufmgr_gem.c |3 ++- intel/intel_decode.c |3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c index 28f8887..8ca6d43 100644 --- a/intel/intel_bufmgr_gem.c +++ b/intel/intel_bufmgr_gem.c @@ -1338,13 +1338,14 @@ int drm_intel_gem_bo_map_unsynchronized(drm_intel_bo *bo) static int drm_intel_gem_bo_unmap(drm_intel_bo *bo) { - drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bo->bufmgr; drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo; + drm_intel_bufmgr_gem *bufmgr_gem; int ret = 0; if (bo == NULL) return 0; + bufmgr_gem = (drm_intel_bufmgr_gem *) bo->bufmgr; pthread_mutex_lock(_gem->lock); if (bo_gem->map_count <= 0) { diff --git a/intel/intel_decode.c b/intel/intel_decode.c index 19a8d36..e8daf6a 100644 --- a/intel/intel_decode.c +++ b/intel/intel_decode.c @@ -3893,7 +3893,7 @@ drm_intel_decode(struct drm_intel_decode *ctx) int ret; unsigned int index = 0; uint32_t devid; - int size = ctx->base_count * 4; + int size; void *temp; if (!ctx) @@ -3903,6 +3903,7 @@ drm_intel_decode(struct drm_intel_decode *ctx) * the batchbuffer. This lets us avoid a bunch of length * checking in statically sized packets. */ + size = ctx->base_count * 4; temp = malloc(size + 4096); memcpy(temp, ctx->base_data, size); memset((char *)temp + size, 0xd0, 4096); -- 1.7.10.4
[PATCH 4/8] Fix memory leaks
--- libkms/intel.c |3 ++- libkms/nouveau.c |3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libkms/intel.c b/libkms/intel.c index 8b8249b..238bec7 100644 --- a/libkms/intel.c +++ b/libkms/intel.c @@ -101,7 +101,8 @@ intel_bo_create(struct kms_driver *kms, pitch = (pitch + 512 - 1) & ~(512 - 1); size = pitch * ((height + 4 - 1) & ~(4 - 1)); } else { - return -EINVAL; + ret = -EINVAL; + goto err_free; } memset(, 0, sizeof(arg)); diff --git a/libkms/nouveau.c b/libkms/nouveau.c index 0e24a15..f12c672 100644 --- a/libkms/nouveau.c +++ b/libkms/nouveau.c @@ -102,7 +102,8 @@ nouveau_bo_create(struct kms_driver *kms, pitch = (pitch + 512 - 1) & ~(512 - 1); size = pitch * height; } else { - return -EINVAL; + ret = -EINVAL; + goto err_free; } memset(, 0, sizeof(arg)); -- 1.7.10.4
[PATCH 3/8] Cleanup includes
--- intel/intel_bufmgr_gem.c|4 ++-- tests/kmstest/main.c|3 ++- tests/modetest/modetest.c |2 +- tests/ttmtest/src/ttmtest.c |6 +++--- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c index 57319fb..28f8887 100644 --- a/intel/intel_bufmgr_gem.c +++ b/intel/intel_bufmgr_gem.c @@ -40,6 +40,7 @@ #include #include +#include #include #include #include @@ -53,13 +54,12 @@ #include #include -#include "errno.h" #include "libdrm_lists.h" #include "intel_bufmgr.h" #include "intel_bufmgr_priv.h" #include "intel_chipset.h" #include "intel_aub.h" -#include "string.h" + #include "i915_drm.h" diff --git a/tests/kmstest/main.c b/tests/kmstest/main.c index 5df0a38..616162d 100644 --- a/tests/kmstest/main.c +++ b/tests/kmstest/main.c @@ -26,10 +26,11 @@ **/ +#include #include #include #include "xf86drm.h" -#include "libkms.h" + #define CHECK_RET_RETURN(ret, str) \ if (ret < 0) { \ diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c index ec3121e..dff40d1 100644 --- a/tests/modetest/modetest.c +++ b/tests/modetest/modetest.c @@ -40,6 +40,7 @@ #include "config.h" #include +#include #include #include #include @@ -53,7 +54,6 @@ #include "xf86drm.h" #include "xf86drmMode.h" #include "drm_fourcc.h" -#include "libkms.h" #ifdef HAVE_CAIRO #include diff --git a/tests/ttmtest/src/ttmtest.c b/tests/ttmtest/src/ttmtest.c index c94e940..59e9623 100644 --- a/tests/ttmtest/src/ttmtest.c +++ b/tests/ttmtest/src/ttmtest.c @@ -39,13 +39,13 @@ #include #include "xf86dri.h" #include "xf86drm.h" -#include "stdio.h" -#include "sys/types.h" +#include +#include #include #include #include #include -#include "sys/mman.h" +#include typedef struct { -- 1.7.10.4
[PATCH 2/8] Remove unused variables
--- intel/intel_bufmgr_gem.c|3 +-- tests/lock.c|2 +- tests/name_from_fd.c|3 +-- tests/ttmtest/src/ttmtest.c |2 +- tests/updatedraw.c |2 +- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c index 12a3197..57319fb 100644 --- a/intel/intel_bufmgr_gem.c +++ b/intel/intel_bufmgr_gem.c @@ -2845,9 +2845,8 @@ drm_intel_gem_context_create(drm_intel_bufmgr *bufmgr) { drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *)bufmgr; struct drm_i915_gem_context_create create; - drm_i915_getparam_t gp; drm_intel_context *context = NULL; - int tmp = 0, ret; + int ret; ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GEM_CONTEXT_CREATE, ); if (ret != 0) { diff --git a/tests/lock.c b/tests/lock.c index 86caa28..a6704f2 100644 --- a/tests/lock.c +++ b/tests/lock.c @@ -205,7 +205,7 @@ static void client() static void server() { - int drmfd, tempfd, ret; + int drmfd, ret; unsigned int client_time, unlock_time; drmfd = drm_open_any_master(); diff --git a/tests/name_from_fd.c b/tests/name_from_fd.c index 330c8ff..4813557 100644 --- a/tests/name_from_fd.c +++ b/tests/name_from_fd.c @@ -39,8 +39,7 @@ */ int main(int argc, char **argv) { - int fd, ret; - drm_set_version_t sv, version; + int fd; const char *name = "/dev/dri/card0"; char *v; diff --git a/tests/ttmtest/src/ttmtest.c b/tests/ttmtest/src/ttmtest.c index 36df242..c94e940 100644 --- a/tests/ttmtest/src/ttmtest.c +++ b/tests/ttmtest/src/ttmtest.c @@ -347,7 +347,7 @@ testAGP(TinyDRIContext * ctx) int main() { -int ret, screen, isCapable; +int ret, isCapable; char *displayName = ":0"; TinyDRIContext ctx; unsigned magic; diff --git a/tests/updatedraw.c b/tests/updatedraw.c index a61eb15..0922740 100644 --- a/tests/updatedraw.c +++ b/tests/updatedraw.c @@ -121,7 +121,7 @@ static int rm_drawable(int fd, int drawable, int fail) */ int main(int argc, char **argv) { - int fd, ret, d1, d2; + int fd, d1, d2; if (getuid() != 0) { fprintf(stderr, "updatedraw test requires root, skipping\n"); -- 1.7.10.4
[PATCH 1/8] Silence function defined but not used warning
--- radeon/radeon_cs_gem.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/radeon/radeon_cs_gem.c b/radeon/radeon_cs_gem.c index 9834bcf..b963140 100644 --- a/radeon/radeon_cs_gem.c +++ b/radeon/radeon_cs_gem.c @@ -330,6 +330,7 @@ static int cs_gem_end(struct radeon_cs_int *cs, return 0; } +#if CS_BOF_DUMP static void cs_gem_dump_bof(struct radeon_cs_int *cs) { struct cs_gem *csg = (struct cs_gem*)cs; @@ -415,6 +416,7 @@ out_err: bof_decref(device_id); bof_decref(root); } +#endif static int cs_gem_emit(struct radeon_cs_int *cs) { -- 1.7.10.4
[Bug 52140] Ubuntu Unity - Launcher and switcher icons disappeared
https://bugs.freedesktop.org/show_bug.cgi?id=52140 Marius Kjeldahl changed: What|Removed |Added Summary|Launcher and switcher icons |Ubuntu Unity - Launcher and |disappeared |switcher icons disappeared -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug.
[Bug 52140] New: Launcher and switcher icons disappeared
https://bugs.freedesktop.org/show_bug.cgi?id=52140 Bug #: 52140 Summary: Launcher and switcher icons disappeared Classification: Unclassified Product: DRI Version: XOrg CVS Platform: Other OS/Version: All Status: NEW Severity: normal Priority: medium Component: DRM/Radeon AssignedTo: dri-devel at lists.freedesktop.org ReportedBy: marius.kjeldahl at gmail.com People are piling on reporting it here: http://askubuntu.com/questions/163546/icons-from-unity-launcher-and-app-switcher-disappeared-after-update I do not know exactly which package broke it, but it seems most if not all are on Radeon systems with kernel 3.5 which I guess is an indication that they got it pulled in through the xorg-edgers PPA (my speculation at least). -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug.
[PATCH] gma500: Fix lid related crash
On Wed, Jul 4, 2012 at 6:15 PM, Alan Cox wrote: > From: Alan Cox > > We set up the lid timer before we set up the backlight. On some devices > that causes a crash as we do a backlight change before or during the setup. > > As this fixes a crash on boot on some setups it ought to go in ASAP. > > Signed-off-by: Alan Cox > Tested-by: Mattia Dongili > --- Dave, just a reminder. This really needs to go into 3.5 Thanks Patrik
[Bug 52136] New: Mesa fails to link r600_dri.so with LLVM
https://bugs.freedesktop.org/show_bug.cgi?id=52136 Bug #: 52136 Summary: Mesa fails to link r600_dri.so with LLVM Classification: Unclassified Product: Mesa Version: git Platform: x86-64 (AMD64) OS/Version: Linux (All) Status: NEW Severity: normal Priority: medium Component: Drivers/Gallium/r600 AssignedTo: dri-devel at lists.freedesktop.org ReportedBy: niels_ole at salscheider-online.de Created attachment 64258 --> https://bugs.freedesktop.org/attachment.cgi?id=64258 Full build log When I try to build Mesa, it fails with the following error: make[3]: Entering directory `/var/tmp/paludis/build/x11-dri-mesa-scm/work/C/64/mesa-scm/src/gallium/targets/dri-r600' rm -f depend touch depend /usr/bin/makedepend -fdepend -I/usr/lib64/gcc/x86_64-pc-linux-gnu/4.7.1/include -I/usr/lib64/gcc/x86_64-pc-linux-gnu/4.7.1/include-fixed -DGALLIUM_RBUG -DGALLIUM_TRACE -DGALLIUM_NOOP -I. -I../../../../src/mesa/drivers/dri/common -Iserver -I../../../../include -I../../../../include/GL/internal -I../../../../src/mapi -I../../../../src/gallium/include -I../../../../src/gallium/auxiliary -I../../../../src/gallium/drivers -I../../../../src/gallium/winsys -I../../../../src/mesa -I../../../../src/mesa/main -I../../../../src/mesa/math -I../../../../src/mesa/transform -I../../../../src/mesa/shader -I../../../../src/mesa/swrast -I../../../../src/mesa/swrast_setup -I../../../../src/egl/main -I../../../../src/egl/drivers/dri -I/usr/include/libdrmtarget.c ../../../../src/mesa/drivers/dri/common/utils.c ../../../../src/mesa/drivers/dri/common/dri_util.c ../../../../src/mesa/drivers/dri/common/xmlconfig.c \ 2> /dev/null ../Makefile.dri:110: depend: No such file or directory make[3]: Leaving directory `/var/tmp/paludis/build/x11-dri-mesa-scm/work/C/64/mesa-scm/src/gallium/targets/dri-r600' make[3]: Entering directory `/var/tmp/paludis/build/x11-dri-mesa-scm/work/C/64/mesa-scm/src/gallium/targets/dri-r600' x86_64-pc-linux-gnu-gcc -c -I. -I../../../../src/mesa/drivers/dri/common -Iserver -I../../../../include -I../../../../include/GL/internal -I../../../../src/mapi -I../../../../src/gallium/include -I../../../../src/gallium/auxiliary -I../../../../src/gallium/drivers -I../../../../src/gallium/winsys -I../../../../src/mesa -I../../../../src/mesa/main -I../../../../src/mesa/math -I../../../../src/mesa/transform -I../../../../src/mesa/shader -I../../../../src/mesa/swrast -I../../../../src/mesa/swrast_setup -I../../../../src/egl/main -I../../../../src/egl/drivers/dri -I/usr/include/libdrm-march=native -pipe -O2 -Wall -std=c99 -Werror=implicit-function-declaration -Werror=missing-prototypes -fno-strict-aliasing -fno-builtin-memcmp -m64 -march=native -pipe -O2 -fPIC -D_GNU_SOURCE -DPTHREADS -DTEXTURE_FLOAT_ENABLED -DUSE_X86_64_ASM -DHAVE_POSIX_MEMALIGN -DIN_DRI_DRIVER -DUSE_XCB -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING -DGLX_USE_TLS -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER -DHAVE_ALIAS -DHAVE_MINCORE -DHAVE_LIBUDEV -DHAVE_LLVM=0x0301 -fvisibility=hidden -DGALLIUM_RBUG -DGALLIUM_TRACE -DGALLIUM_NOOP target.c -o target.o /bin/sh ../../../../bin/mklib -o r600_dri.so.tmp -noprefix -linker 'x86_64-pc-linux-gnu-g++' -ldflags ' -L/usr/lib -ldl -lpthread' \ target.o ../../../../src/mesa/drivers/dri/common/utils.o ../../../../src/mesa/drivers/dri/common/dri_util.o ../../../../src/mesa/drivers/dri/common/xmlconfig.o ../../../../src/gallium/drivers/r600/libr600.a ../../../../src/gallium/state_trackers/dri/drm/libdridrm.a ../../../../src/gallium/winsys/radeon/drm/libradeonwinsys.a ../../../../src/gallium/drivers/trace/libtrace.a ../../../../src/gallium/drivers/rbug/librbug.a ../../../../src/gallium/drivers/noop/libnoop.a \ -Wl,--start-group ../../../../src/mesa/libmesagallium.a ../../../../src/gallium/auxiliary/libgallium.a -Wl,--end-group \ ../../../../lib64/libdricore8.1.0.so -ldrm -lexpat -lm -lpthread -ldl -ldrm_radeon -lLLVMBitWriter -lLLVMX86AsmParser -lLLVMX86Disassembler -lLLVMX86CodeGen -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMMCParser -lLLVMX86Desc -lLLVMX86Info -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMJIT -lLLVMRuntimeDyld -lLLVMExecutionEngine -lLLVMCodeGen -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMTarget -lLLVMMC -lLLVMObject -lLLVMCore -lLLVMSupport -lLLVMInstrumentation -lLLVMLinker -lLLVMArchive -lLLVMBitReader -lLLVMipo -lLLVMVectorize -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMTarget -lLLVMMC -lLLVMObject -lLLVMCore -lLLVMSupport -lLLVMAsmParser -lLLVMBitReader -lLLVMCore -lLLVMSupport mklib: Making Linux shared library: r600_dri.so.tmp x86_64-pc-linux-gnu-g++ -march=native -pipe -O2 -Wall -std=c99 -Werror=implicit-function-declaration -Werror=missing-prototypes -fno-strict-aliasing -fno-builtin-memcmp -m64 -march=native -pipe -O2 -fPIC
[Bug 44851] resume to black screen
https://bugzilla.kernel.org/show_bug.cgi?id=44851 --- Comment #4 from Peter 2012-07-16 13:59:38 --- Sorry if I've used the wrong terminology. This is a standard iMac. When I used the AMD proprietary fglrx driver some time ago on ubuntu 11.04 it showed two display screens detected. The main one is the iMac display and the other is for the display port to attach an external monitor. Now I use the radeon kernel driver at boot time and the xf86 fbdev module for X. If I do a text-only boot without telling the kernel 'nomodeset', I get a black screen; but it has booted - I presume the other 'display port' (or 'connector'? not my main screen) has been chosen for text output. Assuming I boot with nomodeset then I can start X OK, provided I use the xf86 fbdev driver (the xf86 ati driver just gives me a black screen - but rebootable, etc). Then I can suspend the system and it goes quiet. If I then awaken it using a keypress, I can hear it starting up, but the screen stays black. I can reboot from here with Ctl-Alt-Del. My assumption is that, on resume, the system tries to run a modeset from the kernel module and decides to turn off the main screen. I would like to avoid it doing that because essentially I cannot use suspend/resume. -- Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are watching the assignee of the bug.
[Bug 44851] resume to black screen
https://bugzilla.kernel.org/show_bug.cgi?id=44851 --- Comment #3 from Peter 2012-07-16 13:57:00 --- Created an attachment (id=75491) --> (https://bugzilla.kernel.org/attachment.cgi?id=75491) dmesg dmesg log from when kernel starts with nomodeset and X video driver is fbdev. -- Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are watching the assignee of the bug.
[Bug 44851] resume to black screen
https://bugzilla.kernel.org/show_bug.cgi?id=44851 --- Comment #2 from Peter 2012-07-16 13:55:04 --- Created an attachment (id=75481) --> (https://bugzilla.kernel.org/attachment.cgi?id=75481) X windows log This log is from when the system is started using nomodeset and X video driver is fbdev. -- Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are watching the assignee of the bug.
[git pull] drm gma500 fixes
On Mon, Jul 16, 2012 at 12:42 PM, Dave Airlie wrote: > > Sorry been travelling and a bit neglectful of some of Alan's > patches, I actually took the three Alan sent me already, exactly because they seemed harmless and I didn't know your schedule. Your pull has a "gma500: Fix frequency detection" patch that I haven't seen though, which makes me wonder if Alan wants that one too. He only sent me a series of the three other patches.. Alan? Linus
[PATCH] Documentation: DocBook DRM framework documentation
On Thu, Jul 12, 2012 at 7:00 PM, Laurent Pinchart wrote: > Signed-off-by: Laurent Pinchart > --- > Documentation/DocBook/drm.tmpl | 2835 > +++- > 1 files changed, 2226 insertions(+), 609 deletions(-) > > Hi everybody, > > Here's the DRM kernel framework documentation previously posted to the > dri-devel mailing list. The documentation has been reworked, converted to > DocBook and merged with the existing DocBook DRM documentation stub. The > result doesn't cover the whole DRM API but should hopefully be good enough > for a start. > > I've done my best to follow a natural flow starting at initialization and > covering the major DRM internal topics. As I'm not a native English speaker > I'm not totally happy with the result, so if anyone wants to edit the text > please feel free to do so. Review will as usual be appreciated, and acks will > be even more welcome (I've been working on this document for longer than I > feel comfortable with). btw, thanks for this! One minor typo below.. with that, Reviewed-by: Rob Clark > diff --git a/Documentation/DocBook/drm.tmpl b/Documentation/DocBook/drm.tmpl > index 196b8b9..44a2c66 100644 [snip] > + > + Output Polling > + void (*output_poll_changed)(struct drm_device > *dev); > + > +This operation notifies the driver that the status of one or more > +connectors has changed. Drivers that use the fbdev helper can just > call s/fbdev/fb/ > +the drm_fb_helper_hotplug_event function to > handle > +this operation. BR, -R
quirk for Samsung 2443BW
Op 16-07-12 13:00, Baurzhan Ismagulov schreef: > On Mon, Jul 16, 2012 at 12:13:14PM +0200, Maarten Lankhorst wrote: > Samsung 2443BW is 1920x1200 but reports 1920x1080 in the EDID. Attached > is a proof-of-concept implementation of a quirk. It works on my i686 PC. > > The patch is against the latest linux-2.6. An attempt to clone > git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6.git (as > listed in MAINTAINERS) resulted in "fatal: The remote end hung up > unexpectedly". > I actually own a 2443BW and don't have the problem you're referring to? >>> Samsung might have fixed the data. If you care to send me your EDID >>> data, I can compare it with mine. Still, there are many users who have >>> broken monitors; it would be nice to provide a fix for them. >> Attached. > You have product code 0x0587 and vactive of 1200 in the first detailed > mode. I have 0x06b0 and 1080, respectively. So, a fix is needed for the > latter model. > > How did you obtain the file? > I was running the nvidia drivers, nvidia-settings allows you to save it. But open source drivers allow you to copy it from /sys/class/drm/card*/*/edid ~Maarten
quirk for Samsung 2443BW
On Mon, Jul 16, 2012 at 12:13:14PM +0200, Maarten Lankhorst wrote: > >>> Samsung 2443BW is 1920x1200 but reports 1920x1080 in the EDID. Attached > >>> is a proof-of-concept implementation of a quirk. It works on my i686 PC. > >>> > >>> The patch is against the latest linux-2.6. An attempt to clone > >>> git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6.git (as > >>> listed in MAINTAINERS) resulted in "fatal: The remote end hung up > >>> unexpectedly". > >>> > >> I actually own a 2443BW and don't have the problem you're referring to? > > Samsung might have fixed the data. If you care to send me your EDID > > data, I can compare it with mine. Still, there are many users who have > > broken monitors; it would be nice to provide a fix for them. > Attached. You have product code 0x0587 and vactive of 1200 in the first detailed mode. I have 0x06b0 and 1080, respectively. So, a fix is needed for the latter model. How did you obtain the file? With kind regards, Baurzhan.
[Bug 44851] resume to black screen
https://bugzilla.kernel.org/show_bug.cgi?id=44851 Alex Deucher changed: What|Removed |Added CC||alexdeucher at gmail.com --- Comment #1 from Alex Deucher 2012-07-16 12:52:46 --- Please attach your xorg log and dmesg output. What do you mean by wrong display port? Is this a hybrid laptop with multiple GPUs? -- Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are watching the assignee of the bug.
3.5-rc6 nouveau and no text/graphics
Hi, I have here some old classy laptop (Dell Precision M40 PP01X, Pentium3 Mobile CPU) which has, according to lspci, 01:00.0 VGA compatible controller: nVidia Corporation NV11GL [Quadro2 MXR/EX/Go] (rev b2) 01:00.0 0300: 10de:0113 (rev b2) Unfortunately, when loading nouveaufb.ko, all that happens is that the screen goes blank. This occurs on both 2.6.37, 3.1.0, 3.4.4 . The backlight remains on, but there is no more tty1 text or X showing, though, the machine is running and ssh-able. "nomodeset" is possible as a boot option, but of course does not get me the luxury of framebuffer or Xorg. Anything to try? thanks, Jan -- full dmesg -- [0.00] Initializing cgroup subsys cpuset [0.00] Initializing cgroup subsys cpu [0.00] Linux version 3.5.0-rc6-2-desktop (geeko at buildhost) (gcc version 4.7.1 20120615 [gcc-4_7-branch revision 188649] (SUSE Linux) ) #1 SMP PREEMPT Tue Jul 10 18:52:42 UTC 2012 (8442da0) [0.00] e820: BIOS-provided physical RAM map: [0.00] BIOS-e820: [mem 0x-0x0009fbff] usable [0.00] BIOS-e820: [mem 0x0009fc00-0x0009] reserved [0.00] BIOS-e820: [mem 0x0010-0x1ffea7ff] usable [0.00] BIOS-e820: [mem 0x1ffea800-0x1fff] reserved [0.00] BIOS-e820: [mem 0xfeea-0xfeef] reserved [0.00] BIOS-e820: [mem 0xffb8-0x] reserved [0.00] Notice: NX (Execute Disable) protection missing in CPU! [0.00] DMI 2.3 present. [0.00] DMI: Dell Computer Corporation Precision M40 /Precision M40, BIOS A04 09/13/2001 [0.00] e820: update [mem 0x-0x] usable ==> reserved [0.00] e820: remove [mem 0x000a-0x000f] usable [0.00] e820: last_pfn = 0x1ffea max_arch_pfn = 0x100 [0.00] MTRR default type: uncachable [0.00] MTRR fixed ranges enabled: [0.00] 0-9 write-back [0.00] A-B uncachable [0.00] C-CBFFF write-protect [0.00] CC000-E uncachable [0.00] F-F write-protect [0.00] MTRR variable ranges enabled: [0.00] 0 base 0 mask FE000 write-back [0.00] 1 base 0FEEA mask E write-through [0.00] 2 disabled [0.00] 3 disabled [0.00] 4 disabled [0.00] 5 disabled [0.00] 6 disabled [0.00] 7 disabled [0.00] PAT not supported by CPU. [0.00] initial memory mapped: [mem 0x-0x011f] [0.00] Base memory trampoline at [c009b000] 9b000 size 16384 [0.00] init_memory_mapping: [mem 0x-0x1ffe9fff] [0.00] [mem 0x-0x001f] page 4k [0.00] [mem 0x0020-0x1fdf] page 2M [0.00] [mem 0x1fe0-0x1ffe9fff] page 4k [0.00] kernel direct mapping tables up to 0x1ffe9fff @ [mem 0x011f5000-0x011f] [0.00] RAMDISK: [mem 0x1f6df000-0x1ffd9fff] [0.00] ACPI: RSDP 000fde50 00014 (v00 DELL ) [0.00] ACPI: RSDT 000fde64 00028 (v01 DELLCPi R 27D1090D ASL 0061) [0.00] ACPI: FACP 000fde90 00074 (v01 DELLCPi R 27D1090D ASL 0061) [0.00] ACPI: DSDT fffe4000 02BB7 (v01 INT430 SYSFexxx 1001 MSFT 010D) [0.00] ACPI: FACS 1800 00040 [0.00] No NUMA configuration found [0.00] Faking a node at [mem 0x-0x1ffe9fff] [0.00] node 0 pfn: [0 - 1ffea] [0.00] remap_alloc: node 0 [1f00-1f60) -> [dea0-df00) [0.00] Initmem setup node 0 [mem 0x-0x1ffe9fff] [0.00] NODE_DATA [mem 0x1ea0-0x1ea01fff] (remapped) [0.00] 0MB HIGHMEM available. [0.00] 511MB LOWMEM available. [0.00] max_low_pfn = 1ffea, highstart_pfn = 1ffea [0.00] Low memory ends at vaddr dffea000 [0.00] High memory starts at vaddr dffea000 [0.00] mapped low ram: 0 - 1ffea000 [0.00] low ram: 0 - 1ffea000 [0.00] Node: 0, start_pfn: 10, end_pfn: 9f [0.00] Setting physnode_map array to node 0 for pfns: [0.00] 10 [0.00] Node: 0, start_pfn: 100, end_pfn: 1ffea [0.00] Setting physnode_map array to node 0 for pfns: [0.00] 100 4100 8100 c100 10100 14100 18100 1c100 [0.00] Zone ranges: [0.00] DMA [mem 0x0001-0x00ff] [0.00] Normal [mem 0x0100-0x1ffe9fff] [0.00] HighMem empty [0.00] Movable zone start for each node [0.00] Early memory node ranges [0.00] node 0: [mem 0x0001-0x0009efff] [0.00] node 0: [mem 0x0010-0x1ffe9fff] [0.00] On node 0 totalpages: 130937 [0.00] free_area_init_node: node 0, pgdat dea0, node_mem_map dea02200 [0.00] DMA zone: 32 pages used for memmap [0.00]
quirk for Samsung 2443BW
Op 16-07-12 11:49, Baurzhan Ismagulov schreef: > On Mon, Jul 16, 2012 at 11:13:09AM +0200, Maarten Lankhorst wrote: >>> Samsung 2443BW is 1920x1200 but reports 1920x1080 in the EDID. Attached >>> is a proof-of-concept implementation of a quirk. It works on my i686 PC. >>> >>> The patch is against the latest linux-2.6. An attempt to clone >>> git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6.git (as >>> listed in MAINTAINERS) resulted in "fatal: The remote end hung up >>> unexpectedly". >>> >> I actually own a 2443BW and don't have the problem you're referring to? > Samsung might have fixed the data. If you care to send me your EDID > data, I can compare it with mine. Still, there are many users who have > broken monitors; it would be nice to provide a fix for them. Attached. ~Maarten -- next part -- A non-text attachment was scrubbed... Name: edid.bin Type: application/octet-stream Size: 256 bytes Desc: not available URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20120716/af5ae31d/attachment-0001.bin>
[RFC] dma-fence: dma-buf synchronization (v2)
Hey Rob, Op 13-07-12 17:38, Rob Clark schreef: > ... > +/** > + * dma_buf_attach_fence - Attach a fence to a dma-buf. > + * > + * @buf: the dma-buf to attach to > + * @fence: the fence to attach > + * > + * A fence can only be attached to a single dma-buf. The dma-buf takes > + * ownership of the fence, which is unref'd when the fence is signaled. > + * The fence takes a reference to the dma-buf so the buffer will not be > + * freed while there is a pending fence. > + */ > +int dma_buf_attach_fence(struct dma_buf *buf, struct dma_fence *fence) > +{ > + unsigned long flags; > + int ret = -EINVAL; > + > + if (WARN_ON(!buf || !fence)) > + return -EINVAL; > + > + spin_lock_irqsave(>event_queue.lock, flags); > + if (!fence->attached) { > + get_dma_buf(buf); > + fence->attached = true; > + list_add(>list_node, >fence_list); > + ret = 0; > + } > + spin_unlock_irqrestore(>event_queue.lock, flags); > + > + return ret; > +} > +EXPORT_SYMBOL_GPL(dma_buf_attach_fence); This design that a fence can only be attached to 1 dmabuf? Wouldn't it be better to kill the fence_list and just create an array of pointers to all the fences attached to current dmabuf? Or some other design that would allow multiple fences to be attached to a single dmabuf, and a single fence to multiple dma-bufs without being attached to all and without too many memory allocations. Maybe we should add a limit in a #define to how many fences can be attached to a single dmabuf? More than 4 fences on a single dma-buf is likely overkill, but I don't want to place a limit yet on how many dma-bufs can attach to a single fence. > +/** > + * dma_buf_get_fence - Get the most recent pending fence attached to the > + * dma-buf. > + * > + * @buf: the dma-buf whose fence to get > + * > + * If this returns NULL, there are no pending fences. Otherwise this > + * takes a reference to the returned fence, so the caller must later > + * call dma_fence_put() to release the reference. > + */ > +struct dma_fence *dma_buf_get_fence(struct dma_buf *buf) > +{ > + struct dma_fence *fence = NULL; > + unsigned long flags; > + > + if (WARN_ON(!buf)) > + return ERR_PTR(-EINVAL); > + > + spin_lock_irqsave(>event_queue.lock, flags); > + if (!list_empty(>fence_list)) { > + fence = list_first_entry(>fence_list, > + struct dma_fence, list_node); > + dma_fence_get(fence); > + } > + spin_unlock_irqrestore(>event_queue.lock, flags); > + > + return fence; > +} > +EXPORT_SYMBOL_GPL(dma_buf_get_fence); Would mean obsoleting this function, since there's no longer a single fence. > + * dma_fence_put - Release a reference to the fence. > + */ > +void dma_fence_put(struct dma_fence *fence) > +{ > + WARN_ON(!fence); > + kref_put(>refcount, release_fence); > +} > +EXPORT_SYMBOL_GPL(dma_fence_put); Make this inline? > +/** > + * dma_fence_get - Take a reference to the fence. > + * > + * In most cases this is used only internally by dma-fence. > + */ > +void dma_fence_get(struct dma_fence *fence) > +{ > + WARN_ON(!fence); > + kref_get(>refcount); > +} > +EXPORT_SYMBOL_GPL(dma_fence_get); Same. > +/** > + * dma_fence_add_callback - Add a callback to be called when the fence > + * is signaled. > + * > + * @fence: The fence to wait on > + * @cb: The callback to register > + * > + * Any number of callbacks can be registered to a fence, but a callback > + * can only be registered to once fence at a time. > + * > + * Note that the callback can be called from an atomic context. If > + * fence is already signaled, this function will return -ENOENT (and > + * *not* call the callback) > + */ > +int dma_fence_add_callback(struct dma_fence *fence, > + struct dma_fence_cb *cb) > +{ > + unsigned long flags; > + int ret; > + > + if (WARN_ON(!fence || !cb)) > + return -EINVAL; > + > + ret = check_signaling(fence); > + > + spin_lock_irqsave(>event_queue.lock, flags); > + if (ret == -ENOENT) { > + /* if state changed while we dropped the lock, dispatch now */ > + signal_fence(fence); > + } else if (!fence->signaled && !ret) { > + dma_fence_get(fence); > + cb->fence = fence; > + __add_wait_queue(>event_queue, >base); > + ret = 0; > + } else { > + ret = -EINVAL; > + } > + spin_unlock_irqrestore(>event_queue.lock, flags); Unconditionally taking same spinlock twice seems a bit overkill, maybe just drop it in check_signalling if needed? Some standardized base for hardware dma-buf fence objects would also be nice, it will make implementing it for drm a lot easier. ~Maarten
quirk for Samsung 2443BW
On Mon, Jul 16, 2012 at 11:13:09AM +0200, Maarten Lankhorst wrote: > > Samsung 2443BW is 1920x1200 but reports 1920x1080 in the EDID. Attached > > is a proof-of-concept implementation of a quirk. It works on my i686 PC. > > > > The patch is against the latest linux-2.6. An attempt to clone > > git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6.git (as > > listed in MAINTAINERS) resulted in "fatal: The remote end hung up > > unexpectedly". > > > I actually own a 2443BW and don't have the problem you're referring to? Samsung might have fixed the data. If you care to send me your EDID data, I can compare it with mine. Still, there are many users who have broken monitors; it would be nice to provide a fix for them. With kind regards, Baurzhan.
quirk for Samsung 2443BW
Hey, Op 14-07-12 23:42, Baurzhan Ismagulov schreef: > Hello David, > > Samsung 2443BW is 1920x1200 but reports 1920x1080 in the EDID. Attached > is a proof-of-concept implementation of a quirk. It works on my i686 PC. > > The patch is against the latest linux-2.6. An attempt to clone > git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6.git (as > listed in MAINTAINERS) resulted in "fatal: The remote end hung up > unexpectedly". > I actually own a 2443BW and don't have the problem you're referring to? ~Maarten
[Bug 44851] New: resume to black screen
https://bugzilla.kernel.org/show_bug.cgi?id=44851 Summary: resume to black screen Product: Drivers Version: 2.5 Kernel Version: 3.5.0-3 Platform: All OS/Version: Linux Tree: Mainline Status: NEW Severity: normal Priority: P1 Component: Video(DRI - non Intel) AssignedTo: drivers_video-dri at kernel-bugs.osdl.org ReportedBy: energonic at gmail.com Regression: No System: iMac 11,2 (mid2010) with AMD radeon 4670. kernel 3.5.0-3 used on ubuntu 12.10. No swap partition. Boot requires nomodeset on kernel command line, else black screen (even for text-only boot. Radeon module disconnects wrong display port). Resume after suspend shows black screen, but reboots using Ctl-Alt-Del, so has resumed from suspend. Suspect kms invoked on resume and radeon disconnects wrong display port. Same behaviour on archlinux using kernel 3.4.4-1. -- Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are watching the assignee of the bug.
si_mc_load_microcode function and blackout
On Sun, Jul 15, 2012 at 5:11 PM, Sylvain BERTRAND wrote: > Blackout mc microcode thingy useless? > > ... > if (running == 0) { > if (running) { > ...blackout thingy... > } > ... When I wrote the code, the code in the running == 0 block was originally a separate function, but since it was only called when loading the ucode, I ended up just integrating it into the function, but I left the running checks as a reminder that you need to set those regs if you update the ucode while the vram controller ucode is already running. Alex > ___ > dri-devel mailing list > dri-devel at lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH] intel: add prime interface for getting/setting a prime bo. (v3)
On Mon, 16 Jul 2012 02:51:17 +0100, Dave Airlie wrote: > This adds interfaces for the X driver to use to create a > prime handle from a buffer, and create a bo from a handle. > > v2: use Chris's suggested naming (well from at least for consistency) > v3: git commit --amend fail > > Signed-off-by: Dave Airlie > --- > intel/intel_bufmgr.h |4 > intel/intel_bufmgr_gem.c | 46 > ++ > 2 files changed, 50 insertions(+) > > diff --git a/intel/intel_bufmgr.h b/intel/intel_bufmgr.h > index 9b3a483..2167e43 100644 > --- a/intel/intel_bufmgr.h > +++ b/intel/intel_bufmgr.h > @@ -192,6 +192,10 @@ void drm_intel_gem_context_destroy(drm_intel_context > *ctx); > int drm_intel_gem_bo_context_exec(drm_intel_bo *bo, drm_intel_context *ctx, > int used, unsigned int flags); > > +int drm_intel_bo_gem_export_to_prime(drm_intel_bo *bo, int *prime_fd); > +drm_intel_bo *drm_intel_bo_gem_create_from_prime(drm_intel_bufmgr *bufmgr, > + int prime_fd, int size); > + > /* drm_intel_bufmgr_fake.c */ > drm_intel_bufmgr *drm_intel_bufmgr_fake_init(int fd, >unsigned long low_offset, > diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c > index 12a3197..7966924 100644 > --- a/intel/intel_bufmgr_gem.c > +++ b/intel/intel_bufmgr_gem.c > @@ -2413,6 +2413,52 @@ drm_intel_gem_bo_get_tiling(drm_intel_bo *bo, uint32_t > * tiling_mode, > return 0; > } > > +drm_intel_bo * > +drm_intel_bo_gem_create_from_prime(drm_intel_bufmgr *bufmgr, int prime_fd, > int size) > +{ > + drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bufmgr; > + int ret; > + uint32_t handle; > + drm_intel_bo_gem *bo_gem; > + ret = drmPrimeFDToHandle(bufmgr_gem->fd, prime_fd, ); > + if (ret) { > + fprintf(stderr,"ret is %d %d\n", ret, errno); > + return NULL; > + } > + > + bo_gem = calloc(1, sizeof(*bo_gem)); > + if (!bo_gem) > + return NULL; > + > + bo_gem->bo.size = size; > + bo_gem->name = "prime"; > + atomic_set(_gem->refcount, 1); > + bo_gem->validate_index = -1; > + bo_gem->reloc_tree_fences = 0; > + bo_gem->used_as_reloc_target = false; > + bo_gem->has_error = false; > + bo_gem->reusable = false; > + > + bo_gem->bo.handle = handle; > + bo_gem->bo.bufmgr = bufmgr; Can you group the 3 bo_gem->bo initialisation together, and move the bo_gem->gem_handle initialisation closer. Perhaps: bo_gem->bo = bo_gem->gem_handle = bo_gem->* = > + > + DRMINITLISTHEAD(_gem->name_list); > + DRMINITLISTHEAD(_gem->vma_list); > + > + bo_gem->gem_handle = handle; Comparing with create_from_name(), we should query the tiling at this point - DRM_IOCTL_i915_GEM_GET_TILING. That's the only thing missing that I could spot. -Chris -- Chris Wilson, Intel Open Source Technology Centre
[Bug 39832] HDA ATI HDMI: no sound with 3.0 - 2.6.39.3 works
https://bugzilla.kernel.org/show_bug.cgi?id=39832 --- Comment #25 from Santiago Garcia Mantinan 2012-07-16 06:54:36 --- I have just tested 3.4.4 and I got no sound again, however this time the kernel said this: [ 81.186129] hda-intel: IRQ timing workaround is activated for card #0. Suggest a bigger bdl_pos_adj. I hope this helps! -- Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are watching the assignee of the bug.
[PATCH] libdrm/nouveau: add prime handle->bo and bo->handle support.
From: Dave AirlieThis adds prime support to nouveau libdrm. Signed-off-by: Dave Airlie --- nouveau/nouveau.c | 35 +++ nouveau/nouveau.h |3 +++ 2 files changed, 38 insertions(+) diff --git a/nouveau/nouveau.c b/nouveau/nouveau.c index 5aa4107..940d933 100644 --- a/nouveau/nouveau.c +++ b/nouveau/nouveau.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -442,6 +443,40 @@ nouveau_bo_ref(struct nouveau_bo *bo, struct nouveau_bo **pref) } int +nouveau_bo_prime_handle_ref(struct nouveau_device *dev, int prime_fd, + struct nouveau_bo **bo) +{ + int ret; + unsigned int handle; + + ret = drmPrimeFDToHandle(dev->fd, prime_fd, ); + if (ret) { + nouveau_bo_ref(NULL, bo); + return ret; + } + + ret = nouveau_bo_wrap(dev, handle, bo); + if (ret) { + nouveau_bo_ref(NULL, bo); + return ret; + } + + return 0; +} + +int +nouveau_bo_set_prime(struct nouveau_bo *bo, int *prime_fd) +{ + struct nouveau_bo_priv *nvbo = nouveau_bo(bo); + int ret; + + ret = drmPrimeHandleToFD(bo->device->fd, nvbo->base.handle, DRM_CLOEXEC, prime_fd); + if (ret) + return ret; + return 0; +} + +int nouveau_bo_wait(struct nouveau_bo *bo, uint32_t access, struct nouveau_client *client) { diff --git a/nouveau/nouveau.h b/nouveau/nouveau.h index 51a9598..c42eea7 100644 --- a/nouveau/nouveau.h +++ b/nouveau/nouveau.h @@ -135,6 +135,9 @@ int nouveau_bo_map(struct nouveau_bo *, uint32_t access, struct nouveau_client *); int nouveau_bo_wait(struct nouveau_bo *, uint32_t access, struct nouveau_client *); +int nouveau_bo_prime_handle_ref(struct nouveau_device *dev, int prime_fd, +struct nouveau_bo **); +int nouveau_bo_set_prime(struct nouveau_bo *bo, int *prime_fd); struct nouveau_bufref { struct nouveau_list thead; -- 1.7.10.2
[PATCH] intel: add prime interface for getting/setting a prime bo. (v3)
This adds interfaces for the X driver to use to create a prime handle from a buffer, and create a bo from a handle. v2: use Chris's suggested naming (well from at least for consistency) v3: git commit --amend fail Signed-off-by: Dave Airlie --- intel/intel_bufmgr.h |4 intel/intel_bufmgr_gem.c | 46 ++ 2 files changed, 50 insertions(+) diff --git a/intel/intel_bufmgr.h b/intel/intel_bufmgr.h index 9b3a483..2167e43 100644 --- a/intel/intel_bufmgr.h +++ b/intel/intel_bufmgr.h @@ -192,6 +192,10 @@ void drm_intel_gem_context_destroy(drm_intel_context *ctx); int drm_intel_gem_bo_context_exec(drm_intel_bo *bo, drm_intel_context *ctx, int used, unsigned int flags); +int drm_intel_bo_gem_export_to_prime(drm_intel_bo *bo, int *prime_fd); +drm_intel_bo *drm_intel_bo_gem_create_from_prime(drm_intel_bufmgr *bufmgr, + int prime_fd, int size); + /* drm_intel_bufmgr_fake.c */ drm_intel_bufmgr *drm_intel_bufmgr_fake_init(int fd, unsigned long low_offset, diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c index 12a3197..7966924 100644 --- a/intel/intel_bufmgr_gem.c +++ b/intel/intel_bufmgr_gem.c @@ -2413,6 +2413,52 @@ drm_intel_gem_bo_get_tiling(drm_intel_bo *bo, uint32_t * tiling_mode, return 0; } +drm_intel_bo * +drm_intel_bo_gem_create_from_prime(drm_intel_bufmgr *bufmgr, int prime_fd, int size) +{ + drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bufmgr; + int ret; + uint32_t handle; + drm_intel_bo_gem *bo_gem; + ret = drmPrimeFDToHandle(bufmgr_gem->fd, prime_fd, ); + if (ret) { + fprintf(stderr,"ret is %d %d\n", ret, errno); + return NULL; + } + + bo_gem = calloc(1, sizeof(*bo_gem)); + if (!bo_gem) + return NULL; + + bo_gem->bo.size = size; + bo_gem->name = "prime"; + atomic_set(_gem->refcount, 1); + bo_gem->validate_index = -1; + bo_gem->reloc_tree_fences = 0; + bo_gem->used_as_reloc_target = false; + bo_gem->has_error = false; + bo_gem->reusable = false; + + bo_gem->bo.handle = handle; + bo_gem->bo.bufmgr = bufmgr; + + DRMINITLISTHEAD(_gem->name_list); + DRMINITLISTHEAD(_gem->vma_list); + + bo_gem->gem_handle = handle; + + return _gem->bo; +} + +int +drm_intel_bo_gem_export_to_prime(drm_intel_bo *bo, int *prime_fd) +{ + drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bo->bufmgr; + drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo; + + return drmPrimeHandleToFD(bufmgr_gem->fd, bo_gem->gem_handle, DRM_CLOEXEC, prime_fd); +} + static int drm_intel_gem_bo_flink(drm_intel_bo *bo, uint32_t * name) { -- 1.7.10.2
[PATCH] intel: add prime interface for getting/setting a prime bo. (v2)
This adds interfaces for the X driver to use to create a prime handle from a buffer, and create a bo from a handle. v2: use Chris's suggested naming (well from at least for consistency) Signed-off-by: Dave Airlie --- intel/intel_bufmgr.h |4 intel/intel_bufmgr_gem.c | 46 ++ 2 files changed, 50 insertions(+) diff --git a/intel/intel_bufmgr.h b/intel/intel_bufmgr.h index 9b3a483..bf9ad5c 100644 --- a/intel/intel_bufmgr.h +++ b/intel/intel_bufmgr.h @@ -192,6 +192,10 @@ void drm_intel_gem_context_destroy(drm_intel_context *ctx); int drm_intel_gem_bo_context_exec(drm_intel_bo *bo, drm_intel_context *ctx, int used, unsigned int flags); +int drm_intel_bufmgr_gem_set_bo_prime(drm_intel_bo *bo, int *prime_fd); +drm_intel_bo *drm_intel_bufmgr_gem_get_bo_prime(drm_intel_bufmgr *bufmgr, + int prime_fd, int size); + /* drm_intel_bufmgr_fake.c */ drm_intel_bufmgr *drm_intel_bufmgr_fake_init(int fd, unsigned long low_offset, diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c index 12a3197..dfba4e4 100644 --- a/intel/intel_bufmgr_gem.c +++ b/intel/intel_bufmgr_gem.c @@ -2413,6 +2413,52 @@ drm_intel_gem_bo_get_tiling(drm_intel_bo *bo, uint32_t * tiling_mode, return 0; } +drm_intel_bo * +drm_intel_bufmgr_gem_get_bo_prime(drm_intel_bufmgr *bufmgr, int prime_fd, int size) +{ + drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bufmgr; + int ret; + uint32_t handle; + drm_intel_bo_gem *bo_gem; + ret = drmPrimeFDToHandle(bufmgr_gem->fd, prime_fd, ); + if (ret) { + fprintf(stderr,"ret is %d %d\n", ret, errno); + return NULL; + } + + bo_gem = calloc(1, sizeof(*bo_gem)); + if (!bo_gem) + return NULL; + + bo_gem->bo.size = size; + bo_gem->name = "prime"; + atomic_set(_gem->refcount, 1); + bo_gem->validate_index = -1; + bo_gem->reloc_tree_fences = 0; + bo_gem->used_as_reloc_target = false; + bo_gem->has_error = false; + bo_gem->reusable = false; + + bo_gem->bo.handle = handle; + bo_gem->bo.bufmgr = bufmgr; + + DRMINITLISTHEAD(_gem->name_list); + DRMINITLISTHEAD(_gem->vma_list); + + bo_gem->gem_handle = handle; + + return _gem->bo; +} + +int +drm_intel_bufmgr_gem_set_bo_prime(drm_intel_bo *bo, int *prime_fd) +{ + drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bo->bufmgr; + drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo; + + return drmPrimeHandleToFD(bufmgr_gem->fd, bo_gem->gem_handle, DRM_CLOEXEC, prime_fd); +} + static int drm_intel_gem_bo_flink(drm_intel_bo *bo, uint32_t * name) { -- 1.7.10.2
si_mc_load_microcode function and blackout
Blackout mc microcode thingy useless? ... if (running == 0) { if (running) { ...blackout thingy... } ...
P-state switching on Lenovo X121e / AMD E-450
Hi, I have a Lenovo X121e notebook, and the model variant in question uses the E-450 APU. I have various problems with the GPU part of it. The most severe seems to be that switching between power states does not work correctly. First off, the PowerPlay table looks rather strange. Here's what the Linux kernel (3.5.0rc5) tells me about it: > [2.447536] [drm:radeon_pm_print_states], 6 Power State(s) > [2.447540] [drm:radeon_pm_print_states], State 0: Default > [2.447544] [drm:radeon_pm_print_states],1 Clock Mode(s) > [2.447547] [drm:radeon_pm_print_states],0 e: 275000 > [2.447551] [drm:radeon_pm_print_states], State 1: Default > [2.447595] [drm:radeon_pm_print_states],1 Clock Mode(s) > [2.447598] [drm:radeon_pm_print_states],0 e: 507700 > [2.447601] [drm:radeon_pm_print_states], State 2: Battery > [2.447604] [drm:radeon_pm_print_states],1 Clock Mode(s) > [2.447607] [drm:radeon_pm_print_states],0 e: 275000 > [2.447611] [drm:radeon_pm_print_states], State 3: Performance > [2.447614] [drm:radeon_pm_print_states],2 Clock Mode(s) > [2.447616] [drm:radeon_pm_print_states],0 e: 275000 No > display only > [2.447620] [drm:radeon_pm_print_states],1 e: 507700 > [2.447623] [drm:radeon_pm_print_states], State 4: Default > [2.447626] [drm:radeon_pm_print_states],Default > [2.447629] [drm:radeon_pm_print_states], > [2.447631] 2 Clock Mode(s) > [2.447633] [drm:radeon_pm_print_states],0 e: 20 No > display only > [2.447636] [drm:radeon_pm_print_states],1 e: 20 > [2.447639] [drm:radeon_pm_print_states], State 5: Default > [2.447642] [drm:radeon_pm_print_states],1 Clock Mode(s) > [2.447645] [drm:radeon_pm_print_states],0 e: 173690 I don't understand why there are so many different "default" states, and why there are so many states altogether. I wonder, does the driver actually parse the table correctly? Nonetheless, the frequencies the power management code picks from that for profile-based power management make some sense. low/mid use 275 MHz, high uses 507 MHz, and default is 200 MHz. However, the default clock reported by another of the AtomBIOS tables (I forgot its name) is 200 MHz, and that is exactly where the trouble is: radeon_set_power_state in radeon_pm.c [1] restricts the maximum clock to the default clock! So essentially, I am limited to just 200 MHz. I removed the checks and can now use up to 507 MHz without any problems. IMHO, this limitation makes little sense, and it is fine to have a default clock that is lower than the maximum clock. The driver should limit the maximum clock to the maximum encountered in the PowerPlay tables. Best regards, Grigori [1] http://lxr.free-electrons.com/source/drivers/gpu/drm/radeon/radeon_pm.c#L194
Re: [PATCH] intel: add prime interface for getting/setting a prime bo. (v3)
On Mon, 16 Jul 2012 02:51:17 +0100, Dave Airlie airl...@gmail.com wrote: This adds interfaces for the X driver to use to create a prime handle from a buffer, and create a bo from a handle. v2: use Chris's suggested naming (well from at least for consistency) v3: git commit --amend fail Signed-off-by: Dave Airlie airl...@redhat.com --- intel/intel_bufmgr.h |4 intel/intel_bufmgr_gem.c | 46 ++ 2 files changed, 50 insertions(+) diff --git a/intel/intel_bufmgr.h b/intel/intel_bufmgr.h index 9b3a483..2167e43 100644 --- a/intel/intel_bufmgr.h +++ b/intel/intel_bufmgr.h @@ -192,6 +192,10 @@ void drm_intel_gem_context_destroy(drm_intel_context *ctx); int drm_intel_gem_bo_context_exec(drm_intel_bo *bo, drm_intel_context *ctx, int used, unsigned int flags); +int drm_intel_bo_gem_export_to_prime(drm_intel_bo *bo, int *prime_fd); +drm_intel_bo *drm_intel_bo_gem_create_from_prime(drm_intel_bufmgr *bufmgr, + int prime_fd, int size); + /* drm_intel_bufmgr_fake.c */ drm_intel_bufmgr *drm_intel_bufmgr_fake_init(int fd, unsigned long low_offset, diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c index 12a3197..7966924 100644 --- a/intel/intel_bufmgr_gem.c +++ b/intel/intel_bufmgr_gem.c @@ -2413,6 +2413,52 @@ drm_intel_gem_bo_get_tiling(drm_intel_bo *bo, uint32_t * tiling_mode, return 0; } +drm_intel_bo * +drm_intel_bo_gem_create_from_prime(drm_intel_bufmgr *bufmgr, int prime_fd, int size) +{ + drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bufmgr; + int ret; + uint32_t handle; + drm_intel_bo_gem *bo_gem; + ret = drmPrimeFDToHandle(bufmgr_gem-fd, prime_fd, handle); + if (ret) { + fprintf(stderr,ret is %d %d\n, ret, errno); + return NULL; + } + + bo_gem = calloc(1, sizeof(*bo_gem)); + if (!bo_gem) + return NULL; + + bo_gem-bo.size = size; + bo_gem-name = prime; + atomic_set(bo_gem-refcount, 1); + bo_gem-validate_index = -1; + bo_gem-reloc_tree_fences = 0; + bo_gem-used_as_reloc_target = false; + bo_gem-has_error = false; + bo_gem-reusable = false; + + bo_gem-bo.handle = handle; + bo_gem-bo.bufmgr = bufmgr; Can you group the 3 bo_gem-bo initialisation together, and move the bo_gem-gem_handle initialisation closer. Perhaps: bo_gem-bo = bo_gem-gem_handle = bo_gem-* = + + DRMINITLISTHEAD(bo_gem-name_list); + DRMINITLISTHEAD(bo_gem-vma_list); + + bo_gem-gem_handle = handle; Comparing with create_from_name(), we should query the tiling at this point - DRM_IOCTL_i915_GEM_GET_TILING. That's the only thing missing that I could spot. -Chris -- Chris Wilson, Intel Open Source Technology Centre ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 39832] HDA ATI HDMI: no sound with 3.0 - 2.6.39.3 works
https://bugzilla.kernel.org/show_bug.cgi?id=39832 --- Comment #25 from Santiago Garcia Mantinan ma...@manty.net 2012-07-16 06:54:36 --- I have just tested 3.4.4 and I got no sound again, however this time the kernel said this: [ 81.186129] hda-intel: IRQ timing workaround is activated for card #0. Suggest a bigger bdl_pos_adj. I hope this helps! -- Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are watching the assignee of the bug. ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 52136] New: Mesa fails to link r600_dri.so with LLVM
https://bugs.freedesktop.org/show_bug.cgi?id=52136 Bug #: 52136 Summary: Mesa fails to link r600_dri.so with LLVM Classification: Unclassified Product: Mesa Version: git Platform: x86-64 (AMD64) OS/Version: Linux (All) Status: NEW Severity: normal Priority: medium Component: Drivers/Gallium/r600 AssignedTo: dri-devel@lists.freedesktop.org ReportedBy: niels_...@salscheider-online.de Created attachment 64258 -- https://bugs.freedesktop.org/attachment.cgi?id=64258 Full build log When I try to build Mesa, it fails with the following error: make[3]: Entering directory `/var/tmp/paludis/build/x11-dri-mesa-scm/work/C/64/mesa-scm/src/gallium/targets/dri-r600' rm -f depend touch depend /usr/bin/makedepend -fdepend -I/usr/lib64/gcc/x86_64-pc-linux-gnu/4.7.1/include -I/usr/lib64/gcc/x86_64-pc-linux-gnu/4.7.1/include-fixed -DGALLIUM_RBUG -DGALLIUM_TRACE -DGALLIUM_NOOP -I. -I../../../../src/mesa/drivers/dri/common -Iserver -I../../../../include -I../../../../include/GL/internal -I../../../../src/mapi -I../../../../src/gallium/include -I../../../../src/gallium/auxiliary -I../../../../src/gallium/drivers -I../../../../src/gallium/winsys -I../../../../src/mesa -I../../../../src/mesa/main -I../../../../src/mesa/math -I../../../../src/mesa/transform -I../../../../src/mesa/shader -I../../../../src/mesa/swrast -I../../../../src/mesa/swrast_setup -I../../../../src/egl/main -I../../../../src/egl/drivers/dri -I/usr/include/libdrmtarget.c ../../../../src/mesa/drivers/dri/common/utils.c ../../../../src/mesa/drivers/dri/common/dri_util.c ../../../../src/mesa/drivers/dri/common/xmlconfig.c \ 2 /dev/null ../Makefile.dri:110: depend: No such file or directory make[3]: Leaving directory `/var/tmp/paludis/build/x11-dri-mesa-scm/work/C/64/mesa-scm/src/gallium/targets/dri-r600' make[3]: Entering directory `/var/tmp/paludis/build/x11-dri-mesa-scm/work/C/64/mesa-scm/src/gallium/targets/dri-r600' x86_64-pc-linux-gnu-gcc -c -I. -I../../../../src/mesa/drivers/dri/common -Iserver -I../../../../include -I../../../../include/GL/internal -I../../../../src/mapi -I../../../../src/gallium/include -I../../../../src/gallium/auxiliary -I../../../../src/gallium/drivers -I../../../../src/gallium/winsys -I../../../../src/mesa -I../../../../src/mesa/main -I../../../../src/mesa/math -I../../../../src/mesa/transform -I../../../../src/mesa/shader -I../../../../src/mesa/swrast -I../../../../src/mesa/swrast_setup -I../../../../src/egl/main -I../../../../src/egl/drivers/dri -I/usr/include/libdrm-march=native -pipe -O2 -Wall -std=c99 -Werror=implicit-function-declaration -Werror=missing-prototypes -fno-strict-aliasing -fno-builtin-memcmp -m64 -march=native -pipe -O2 -fPIC -D_GNU_SOURCE -DPTHREADS -DTEXTURE_FLOAT_ENABLED -DUSE_X86_64_ASM -DHAVE_POSIX_MEMALIGN -DIN_DRI_DRIVER -DUSE_XCB -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING -DGLX_USE_TLS -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER -DHAVE_ALIAS -DHAVE_MINCORE -DHAVE_LIBUDEV -DHAVE_LLVM=0x0301 -fvisibility=hidden -DGALLIUM_RBUG -DGALLIUM_TRACE -DGALLIUM_NOOP target.c -o target.o /bin/sh ../../../../bin/mklib -o r600_dri.so.tmp -noprefix -linker 'x86_64-pc-linux-gnu-g++' -ldflags ' -L/usr/lib -ldl -lpthread' \ target.o ../../../../src/mesa/drivers/dri/common/utils.o ../../../../src/mesa/drivers/dri/common/dri_util.o ../../../../src/mesa/drivers/dri/common/xmlconfig.o ../../../../src/gallium/drivers/r600/libr600.a ../../../../src/gallium/state_trackers/dri/drm/libdridrm.a ../../../../src/gallium/winsys/radeon/drm/libradeonwinsys.a ../../../../src/gallium/drivers/trace/libtrace.a ../../../../src/gallium/drivers/rbug/librbug.a ../../../../src/gallium/drivers/noop/libnoop.a \ -Wl,--start-group ../../../../src/mesa/libmesagallium.a ../../../../src/gallium/auxiliary/libgallium.a -Wl,--end-group \ ../../../../lib64/libdricore8.1.0.so -ldrm -lexpat -lm -lpthread -ldl -ldrm_radeon -lLLVMBitWriter -lLLVMX86AsmParser -lLLVMX86Disassembler -lLLVMX86CodeGen -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMMCParser -lLLVMX86Desc -lLLVMX86Info -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMJIT -lLLVMRuntimeDyld -lLLVMExecutionEngine -lLLVMCodeGen -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMTarget -lLLVMMC -lLLVMObject -lLLVMCore -lLLVMSupport -lLLVMInstrumentation -lLLVMLinker -lLLVMArchive -lLLVMBitReader -lLLVMipo -lLLVMVectorize -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMTarget -lLLVMMC -lLLVMObject -lLLVMCore -lLLVMSupport -lLLVMAsmParser -lLLVMBitReader -lLLVMCore -lLLVMSupport mklib: Making Linux shared library: r600_dri.so.tmp x86_64-pc-linux-gnu-g++ -march=native -pipe -O2 -Wall -std=c99 -Werror=implicit-function-declaration -Werror=missing-prototypes -fno-strict-aliasing -fno-builtin-memcmp -m64 -march=native -pipe -O2 -fPIC
[Bug 52140] New: Launcher and switcher icons disappeared
https://bugs.freedesktop.org/show_bug.cgi?id=52140 Bug #: 52140 Summary: Launcher and switcher icons disappeared Classification: Unclassified Product: DRI Version: XOrg CVS Platform: Other OS/Version: All Status: NEW Severity: normal Priority: medium Component: DRM/Radeon AssignedTo: dri-devel@lists.freedesktop.org ReportedBy: marius.kjeld...@gmail.com People are piling on reporting it here: http://askubuntu.com/questions/163546/icons-from-unity-launcher-and-app-switcher-disappeared-after-update I do not know exactly which package broke it, but it seems most if not all are on Radeon systems with kernel 3.5 which I guess is an indication that they got it pulled in through the xorg-edgers PPA (my speculation at least). -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 52140] Ubuntu Unity - Launcher and switcher icons disappeared
https://bugs.freedesktop.org/show_bug.cgi?id=52140 Marius Kjeldahl marius.kjeld...@gmail.com changed: What|Removed |Added Summary|Launcher and switcher icons |Ubuntu Unity - Launcher and |disappeared |switcher icons disappeared -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: quirk for Samsung 2443BW
Hey, Op 14-07-12 23:42, Baurzhan Ismagulov schreef: Hello David, Samsung 2443BW is 1920x1200 but reports 1920x1080 in the EDID. Attached is a proof-of-concept implementation of a quirk. It works on my i686 PC. The patch is against the latest linux-2.6. An attempt to clone git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6.git (as listed in MAINTAINERS) resulted in fatal: The remote end hung up unexpectedly. I actually own a 2443BW and don't have the problem you're referring to? ~Maarten ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 44851] New: resume to black screen
https://bugzilla.kernel.org/show_bug.cgi?id=44851 Summary: resume to black screen Product: Drivers Version: 2.5 Kernel Version: 3.5.0-3 Platform: All OS/Version: Linux Tree: Mainline Status: NEW Severity: normal Priority: P1 Component: Video(DRI - non Intel) AssignedTo: drivers_video-...@kernel-bugs.osdl.org ReportedBy: energo...@gmail.com Regression: No System: iMac 11,2 (mid2010) with AMD radeon 4670. kernel 3.5.0-3 used on ubuntu 12.10. No swap partition. Boot requires nomodeset on kernel command line, else black screen (even for text-only boot. Radeon module disconnects wrong display port). Resume after suspend shows black screen, but reboots using Ctl-Alt-Del, so has resumed from suspend. Suspect kms invoked on resume and radeon disconnects wrong display port. Same behaviour on archlinux using kernel 3.4.4-1. -- Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are watching the assignee of the bug. ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: quirk for Samsung 2443BW
On Mon, Jul 16, 2012 at 11:13:09AM +0200, Maarten Lankhorst wrote: Samsung 2443BW is 1920x1200 but reports 1920x1080 in the EDID. Attached is a proof-of-concept implementation of a quirk. It works on my i686 PC. The patch is against the latest linux-2.6. An attempt to clone git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6.git (as listed in MAINTAINERS) resulted in fatal: The remote end hung up unexpectedly. I actually own a 2443BW and don't have the problem you're referring to? Samsung might have fixed the data. If you care to send me your EDID data, I can compare it with mine. Still, there are many users who have broken monitors; it would be nice to provide a fix for them. With kind regards, Baurzhan. ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: quirk for Samsung 2443BW
Op 16-07-12 11:49, Baurzhan Ismagulov schreef: On Mon, Jul 16, 2012 at 11:13:09AM +0200, Maarten Lankhorst wrote: Samsung 2443BW is 1920x1200 but reports 1920x1080 in the EDID. Attached is a proof-of-concept implementation of a quirk. It works on my i686 PC. The patch is against the latest linux-2.6. An attempt to clone git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6.git (as listed in MAINTAINERS) resulted in fatal: The remote end hung up unexpectedly. I actually own a 2443BW and don't have the problem you're referring to? Samsung might have fixed the data. If you care to send me your EDID data, I can compare it with mine. Still, there are many users who have broken monitors; it would be nice to provide a fix for them. Attached. ~Maarten edid.bin Description: Binary data ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: quirk for Samsung 2443BW
On Mon, Jul 16, 2012 at 12:13:14PM +0200, Maarten Lankhorst wrote: Samsung 2443BW is 1920x1200 but reports 1920x1080 in the EDID. Attached is a proof-of-concept implementation of a quirk. It works on my i686 PC. The patch is against the latest linux-2.6. An attempt to clone git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6.git (as listed in MAINTAINERS) resulted in fatal: The remote end hung up unexpectedly. I actually own a 2443BW and don't have the problem you're referring to? Samsung might have fixed the data. If you care to send me your EDID data, I can compare it with mine. Still, there are many users who have broken monitors; it would be nice to provide a fix for them. Attached. You have product code 0x0587 and vactive of 1200 in the first detailed mode. I have 0x06b0 and 1080, respectively. So, a fix is needed for the latter model. How did you obtain the file? With kind regards, Baurzhan. ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: quirk for Samsung 2443BW
Op 16-07-12 13:00, Baurzhan Ismagulov schreef: On Mon, Jul 16, 2012 at 12:13:14PM +0200, Maarten Lankhorst wrote: Samsung 2443BW is 1920x1200 but reports 1920x1080 in the EDID. Attached is a proof-of-concept implementation of a quirk. It works on my i686 PC. The patch is against the latest linux-2.6. An attempt to clone git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6.git (as listed in MAINTAINERS) resulted in fatal: The remote end hung up unexpectedly. I actually own a 2443BW and don't have the problem you're referring to? Samsung might have fixed the data. If you care to send me your EDID data, I can compare it with mine. Still, there are many users who have broken monitors; it would be nice to provide a fix for them. Attached. You have product code 0x0587 and vactive of 1200 in the first detailed mode. I have 0x06b0 and 1080, respectively. So, a fix is needed for the latter model. How did you obtain the file? I was running the nvidia drivers, nvidia-settings allows you to save it. But open source drivers allow you to copy it from /sys/class/drm/card*/*/edid ~Maarten ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 52140] Ubuntu Unity - Launcher and switcher icons disappeared
https://bugs.freedesktop.org/show_bug.cgi?id=52140 --- Comment #1 from black_painkil...@yahoo.it 2012-07-16 11:45:37 PDT --- same for me. ubuntu 12.04, 64bit. xorg-edgers ppa but with nouveau driver. -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] gma500: Fix lid related crash
On Wed, Jul 4, 2012 at 6:15 PM, Alan Cox a...@lxorguk.ukuu.org.uk wrote: From: Alan Cox a...@linux.intel.com We set up the lid timer before we set up the backlight. On some devices that causes a crash as we do a backlight change before or during the setup. As this fixes a crash on boot on some setups it ought to go in ASAP. Signed-off-by: Alan Cox a...@linux.intel.com Tested-by: Mattia Dongili malat...@linux.it --- Dave, just a reminder. This really needs to go into 3.5 Thanks Patrik ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 52140] Ubuntu Unity - Launcher and switcher icons disappeared
https://bugs.freedesktop.org/show_bug.cgi?id=52140 --- Comment #2 from Alex Deucher ag...@yahoo.com 2012-07-16 12:42:34 PDT --- Please attach your xorg log, dmesg output, and glxinfo output. Also, it would be helpful if you could track down what package(s) caused the problem. -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 52140] Ubuntu Unity - Launcher and switcher icons disappeared
https://bugs.freedesktop.org/show_bug.cgi?id=52140 --- Comment #3 from Alex Deucher ag...@yahoo.com 2012-07-16 12:44:43 PDT --- If it broke both AMD and NV hw, it's most likely an Ubuntu specific packaging issue rather than an upstream driver issue and should probably be opened as an ubuntu bug. -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: si_mc_load_microcode function and blackout
On Sun, Jul 15, 2012 at 5:11 PM, Sylvain BERTRAND sylw...@legeek.net wrote: Blackout mc microcode thingy useless? ... if (running == 0) { if (running) { ...blackout thingy... } ... When I wrote the code, the code in the running == 0 block was originally a separate function, but since it was only called when loading the ucode, I ended up just integrating it into the function, but I left the running checks as a reminder that you need to set those regs if you update the ucode while the vram controller ucode is already running. Alex ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 44851] resume to black screen
https://bugzilla.kernel.org/show_bug.cgi?id=44851 Alex Deucher alexdeuc...@gmail.com changed: What|Removed |Added CC||alexdeuc...@gmail.com --- Comment #1 from Alex Deucher alexdeuc...@gmail.com 2012-07-16 12:52:46 --- Please attach your xorg log and dmesg output. What do you mean by wrong display port? Is this a hybrid laptop with multiple GPUs? -- Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are watching the assignee of the bug. ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 52136] Mesa fails to link r600_dri.so with LLVM
https://bugs.freedesktop.org/show_bug.cgi?id=52136 --- Comment #1 from Tom Stellard tstel...@gmail.com 2012-07-16 13:41:13 PDT --- I've seen this before. The problem is mismatched CXXFLAGS in mesa and llvm. The typeinfo errors are caused the -fno-rtti flag (or the absence of it) and the isCurrentDebugType and DebugFlag errors are cause by -DNDEBUG. The problem with -DNDEBUG is that LLVM defines DNDEBUG in public headers, so if you compiled LLVM with it, you have have to compile Mesa with it as well. If you play with your configure flags you should be able to get this to work. I'll try to look into a proper solution when I get a chance. -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
RE: [PATCH 0/7] [RFC] drm/exynos: Add IOMMU support to DRM
-Original Message- From: Subash Patel [mailto:subash.ramasw...@linaro.org] Sent: Friday, July 13, 2012 3:58 PM To: Inki Dae Cc: 'Prathyush K'; dri-devel@lists.freedesktop.org; prathy...@chromium.org; m.szyprow...@samsung.com Subject: Re: [PATCH 0/7] [RFC] drm/exynos: Add IOMMU support to DRM On 07/13/2012 12:09 PM, Inki Dae wrote: -Original Message- From: Prathyush K [mailto:prathyus...@samsung.com] Sent: Wednesday, July 11, 2012 6:40 PM To: dri-devel@lists.freedesktop.org Cc: prathy...@chromium.org; m.szyprow...@samsung.com; inki@samsung.com; subash.ramasw...@linaro.org Subject: [PATCH 0/7] [RFC] drm/exynos: Add IOMMU support to DRM The dma-mapping framework needs a IOMMU mapping to be created for the device which allocates/maps/frees the non-contig buffer. In the DRM framework, a gem buffer is created by the DRM virtual device and not directly by any of the physical devices (FIMD, HDMI etc). Each gem object can be set as a framebuffer to one or many of the drm devices. So a gem object cannot be allocated for any one device. All the DRM devices should be able to access this buffer. It's good to use unified iommu table so I agree to your opinion but we don't decide whether we use dma mapping api or not. now dma mapping api has one issue. in case of using iommu with dma mapping api, we couldn't use physically contiguous memory region with iommu. for this, there is a case that we should use physically contiguous memory region with iommu. it is because we sometime may use mfc(hw video codec) with secure zone such as ARM TrustZone. Then, it needs physically contiguous memory region. Thanks, Inki Dae I agree. In the mainline code, as of now only the arm_dma_ops has the support allocating from the CMA. But in the function arm_iommu_alloc_attrs(), there is no way to know if the device had declared a contiguous memory range. The reason, we don't store that cookie into the device during the dma_declare_contiguous(). So is it advisable to store such information like mapping(in the iommu operations) in the device.archdata? Regards, Subash There was my missing point. dma mapping api with iommu tries to allocate pages contiguously if possible. as HW Video codec above, there is the case that physically contiguous memory region is need necessarily but it seems like that now dma mapping api doesn't guarantee fully physically contiguous memory region(for example, if physically contiguous memory allocation is failed then it should return an error so that we can check it) Marek, for this, could you please give us comments? Thanks, Inki Dae The proposed method is to create a common IOMMU mapping during drm init. This mapping is then attached to all of the drm devices including the drm device. [PATCH 1/7] drm/exynos: create common IOMMU mapping for DRM During the probe of drm fimd, the driver retrieves a 'sysmmu' field in the device node for fimd. If such a field exists, the driver retrieves the platform device of the sysmmu device. This sysmmu is set as the sysmmu for fimd. The common mapping created is then attached to fimd. This needs to be done for all the other devices (hdmi, vidi etc). [PATCH 2/7] ARM: EXYNOS5: add sysmmu field to fimd device node [PATCH 3/7] drm/exynos: add IOMMU support to drm fimd During DRM's probe which happens last, the common mapping is set to its archdata and iommu ops are set as its dma ops. This requires a modification in the dma-mapping framework so that the iommu ops can be visible to all drivers. [PATCH 4/7] ARM: dma-mapping: rename and export iommu_ops [PATCH 5/7] drm/exynos: attach drm device with common drm mapping Currently allocation and free use the iommu framework by calling dma_alloc_writecombine and dma_free_writecombine respectively. For mapping the buffers to user space, the mmap functions assume that the buffer is contiguous. This is modified by calling dma_mmap_writecombine. [PATCH 6/7] drm/exynos: Add exynos drm specific fb_mmap function [PATCH 7/7] Add IOMMU support for mapping gem object The device tree based patches are based on Leela's patch which was posted last week for adding DT support to DRM FIMD. The patch to add sysmmu field is for reference only and will be posted to the device tree mailing list. Same with the rename and export iommu_ops patch. These patches are tested on Exynos5250 SMDK board and tested with modetest from libdrm tests. Prathyush K (7): drm/exynos: create common IOMMU mapping for DRM ARM: EXYNOS5: add sysmmu field to fimd device node drm/exynos: add IOMMU support to drm fimd ARM: dma-mapping: rename and export iommu_ops drm/exynos: attach drm device with common drm mapping drm/exynos: Add exynos drm specific fb_mmap function drm/exynos: Add IOMMU support for mapping gem object arch/arm/boot/dts/exynos5250.dtsi
[Bug 44851] resume to black screen
https://bugzilla.kernel.org/show_bug.cgi?id=44851 --- Comment #2 from Peter energo...@gmail.com 2012-07-16 13:55:04 --- Created an attachment (id=75481) -- (https://bugzilla.kernel.org/attachment.cgi?id=75481) X windows log This log is from when the system is started using nomodeset and X video driver is fbdev. -- Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are watching the assignee of the bug. ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 44851] resume to black screen
https://bugzilla.kernel.org/show_bug.cgi?id=44851 --- Comment #3 from Peter energo...@gmail.com 2012-07-16 13:57:00 --- Created an attachment (id=75491) -- (https://bugzilla.kernel.org/attachment.cgi?id=75491) dmesg dmesg log from when kernel starts with nomodeset and X video driver is fbdev. -- Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are watching the assignee of the bug. ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 44851] resume to black screen
https://bugzilla.kernel.org/show_bug.cgi?id=44851 --- Comment #4 from Peter energo...@gmail.com 2012-07-16 13:59:38 --- Sorry if I've used the wrong terminology. This is a standard iMac. When I used the AMD proprietary fglrx driver some time ago on ubuntu 11.04 it showed two display screens detected. The main one is the iMac display and the other is for the display port to attach an external monitor. Now I use the radeon kernel driver at boot time and the xf86 fbdev module for X. If I do a text-only boot without telling the kernel 'nomodeset', I get a black screen; but it has booted - I presume the other 'display port' (or 'connector'? not my main screen) has been chosen for text output. Assuming I boot with nomodeset then I can start X OK, provided I use the xf86 fbdev driver (the xf86 ati driver just gives me a black screen - but rebootable, etc). Then I can suspend the system and it goes quiet. If I then awaken it using a keypress, I can hear it starting up, but the screen stays black. I can reboot from here with Ctl-Alt-Del. My assumption is that, on resume, the system tries to run a modeset from the kernel module and decides to turn off the main screen. I would like to avoid it doing that because essentially I cannot use suspend/resume. -- Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are watching the assignee of the bug. ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 1/8] Silence function defined but not used warning
--- radeon/radeon_cs_gem.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/radeon/radeon_cs_gem.c b/radeon/radeon_cs_gem.c index 9834bcf..b963140 100644 --- a/radeon/radeon_cs_gem.c +++ b/radeon/radeon_cs_gem.c @@ -330,6 +330,7 @@ static int cs_gem_end(struct radeon_cs_int *cs, return 0; } +#if CS_BOF_DUMP static void cs_gem_dump_bof(struct radeon_cs_int *cs) { struct cs_gem *csg = (struct cs_gem*)cs; @@ -415,6 +416,7 @@ out_err: bof_decref(device_id); bof_decref(root); } +#endif static int cs_gem_emit(struct radeon_cs_int *cs) { -- 1.7.10.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 2/8] Remove unused variables
--- intel/intel_bufmgr_gem.c|3 +-- tests/lock.c|2 +- tests/name_from_fd.c|3 +-- tests/ttmtest/src/ttmtest.c |2 +- tests/updatedraw.c |2 +- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c index 12a3197..57319fb 100644 --- a/intel/intel_bufmgr_gem.c +++ b/intel/intel_bufmgr_gem.c @@ -2845,9 +2845,8 @@ drm_intel_gem_context_create(drm_intel_bufmgr *bufmgr) { drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *)bufmgr; struct drm_i915_gem_context_create create; - drm_i915_getparam_t gp; drm_intel_context *context = NULL; - int tmp = 0, ret; + int ret; ret = drmIoctl(bufmgr_gem-fd, DRM_IOCTL_I915_GEM_CONTEXT_CREATE, create); if (ret != 0) { diff --git a/tests/lock.c b/tests/lock.c index 86caa28..a6704f2 100644 --- a/tests/lock.c +++ b/tests/lock.c @@ -205,7 +205,7 @@ static void client() static void server() { - int drmfd, tempfd, ret; + int drmfd, ret; unsigned int client_time, unlock_time; drmfd = drm_open_any_master(); diff --git a/tests/name_from_fd.c b/tests/name_from_fd.c index 330c8ff..4813557 100644 --- a/tests/name_from_fd.c +++ b/tests/name_from_fd.c @@ -39,8 +39,7 @@ */ int main(int argc, char **argv) { - int fd, ret; - drm_set_version_t sv, version; + int fd; const char *name = /dev/dri/card0; char *v; diff --git a/tests/ttmtest/src/ttmtest.c b/tests/ttmtest/src/ttmtest.c index 36df242..c94e940 100644 --- a/tests/ttmtest/src/ttmtest.c +++ b/tests/ttmtest/src/ttmtest.c @@ -347,7 +347,7 @@ testAGP(TinyDRIContext * ctx) int main() { -int ret, screen, isCapable; +int ret, isCapable; char *displayName = :0; TinyDRIContext ctx; unsigned magic; diff --git a/tests/updatedraw.c b/tests/updatedraw.c index a61eb15..0922740 100644 --- a/tests/updatedraw.c +++ b/tests/updatedraw.c @@ -121,7 +121,7 @@ static int rm_drawable(int fd, int drawable, int fail) */ int main(int argc, char **argv) { - int fd, ret, d1, d2; + int fd, d1, d2; if (getuid() != 0) { fprintf(stderr, updatedraw test requires root, skipping\n); -- 1.7.10.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 3/8] Cleanup includes
--- intel/intel_bufmgr_gem.c|4 ++-- tests/kmstest/main.c|3 ++- tests/modetest/modetest.c |2 +- tests/ttmtest/src/ttmtest.c |6 +++--- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c index 57319fb..28f8887 100644 --- a/intel/intel_bufmgr_gem.c +++ b/intel/intel_bufmgr_gem.c @@ -40,6 +40,7 @@ #include xf86drm.h #include xf86atomic.h +#include errno.h #include fcntl.h #include stdio.h #include stdlib.h @@ -53,13 +54,12 @@ #include sys/types.h #include stdbool.h -#include errno.h #include libdrm_lists.h #include intel_bufmgr.h #include intel_bufmgr_priv.h #include intel_chipset.h #include intel_aub.h -#include string.h + #include i915_drm.h diff --git a/tests/kmstest/main.c b/tests/kmstest/main.c index 5df0a38..616162d 100644 --- a/tests/kmstest/main.c +++ b/tests/kmstest/main.c @@ -26,10 +26,11 @@ **/ +#include libkms.h #include stdio.h #include string.h #include xf86drm.h -#include libkms.h + #define CHECK_RET_RETURN(ret, str) \ if (ret 0) { \ diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c index ec3121e..dff40d1 100644 --- a/tests/modetest/modetest.c +++ b/tests/modetest/modetest.c @@ -40,6 +40,7 @@ #include config.h #include assert.h +#include libkms.h #include stdio.h #include stdlib.h #include stdint.h @@ -53,7 +54,6 @@ #include xf86drm.h #include xf86drmMode.h #include drm_fourcc.h -#include libkms.h #ifdef HAVE_CAIRO #include math.h diff --git a/tests/ttmtest/src/ttmtest.c b/tests/ttmtest/src/ttmtest.c index c94e940..59e9623 100644 --- a/tests/ttmtest/src/ttmtest.c +++ b/tests/ttmtest/src/ttmtest.c @@ -39,13 +39,13 @@ #include drm/drm.h #include xf86dri.h #include xf86drm.h -#include stdio.h -#include sys/types.h +#include stdio.h +#include sys/types.h #include unistd.h #include string.h #include errno.h #include stdlib.h -#include sys/mman.h +#include sys/mman.h typedef struct { -- 1.7.10.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 4/8] Fix memory leaks
--- libkms/intel.c |3 ++- libkms/nouveau.c |3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libkms/intel.c b/libkms/intel.c index 8b8249b..238bec7 100644 --- a/libkms/intel.c +++ b/libkms/intel.c @@ -101,7 +101,8 @@ intel_bo_create(struct kms_driver *kms, pitch = (pitch + 512 - 1) ~(512 - 1); size = pitch * ((height + 4 - 1) ~(4 - 1)); } else { - return -EINVAL; + ret = -EINVAL; + goto err_free; } memset(arg, 0, sizeof(arg)); diff --git a/libkms/nouveau.c b/libkms/nouveau.c index 0e24a15..f12c672 100644 --- a/libkms/nouveau.c +++ b/libkms/nouveau.c @@ -102,7 +102,8 @@ nouveau_bo_create(struct kms_driver *kms, pitch = (pitch + 512 - 1) ~(512 - 1); size = pitch * height; } else { - return -EINVAL; + ret = -EINVAL; + goto err_free; } memset(arg, 0, sizeof(arg)); -- 1.7.10.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 5/8] Fix possible null pointer dereferences
--- intel/intel_bufmgr_gem.c |3 ++- intel/intel_decode.c |3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c index 28f8887..8ca6d43 100644 --- a/intel/intel_bufmgr_gem.c +++ b/intel/intel_bufmgr_gem.c @@ -1338,13 +1338,14 @@ int drm_intel_gem_bo_map_unsynchronized(drm_intel_bo *bo) static int drm_intel_gem_bo_unmap(drm_intel_bo *bo) { - drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bo-bufmgr; drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo; + drm_intel_bufmgr_gem *bufmgr_gem; int ret = 0; if (bo == NULL) return 0; + bufmgr_gem = (drm_intel_bufmgr_gem *) bo-bufmgr; pthread_mutex_lock(bufmgr_gem-lock); if (bo_gem-map_count = 0) { diff --git a/intel/intel_decode.c b/intel/intel_decode.c index 19a8d36..e8daf6a 100644 --- a/intel/intel_decode.c +++ b/intel/intel_decode.c @@ -3893,7 +3893,7 @@ drm_intel_decode(struct drm_intel_decode *ctx) int ret; unsigned int index = 0; uint32_t devid; - int size = ctx-base_count * 4; + int size; void *temp; if (!ctx) @@ -3903,6 +3903,7 @@ drm_intel_decode(struct drm_intel_decode *ctx) * the batchbuffer. This lets us avoid a bunch of length * checking in statically sized packets. */ + size = ctx-base_count * 4; temp = malloc(size + 4096); memcpy(temp, ctx-base_data, size); memset((char *)temp + size, 0xd0, 4096); -- 1.7.10.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 6/8] Remove never used assignments
--- xf86drm.c |2 ++ xf86drmSL.c |1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/xf86drm.c b/xf86drm.c index 6ea068f..94f634d 100644 --- a/xf86drm.c +++ b/xf86drm.c @@ -304,7 +304,9 @@ static int drmOpenDevice(long dev, int minor, int type) charbuf[64]; int fd; mode_t devmode = DRM_DEV_MODE, serv_mode; +#if !defined(UDEV) int isroot = !geteuid(); +#endif uid_t user= DRM_DEV_UID; gid_t group = DRM_DEV_GID, serv_group; diff --git a/xf86drmSL.c b/xf86drmSL.c index acddb54..0d639aa 100644 --- a/xf86drmSL.c +++ b/xf86drmSL.c @@ -263,7 +263,6 @@ int drmSLLookupNeighbors(void *l, unsigned long key, unsigned long *prev_key, void **prev_value, unsigned long *next_key, void **next_value) { -SkipListPtr list = (SkipListPtr)l; SLEntryPtrupdate[SL_MAX_LEVEL + 1]; int retcode = 0; -- 1.7.10.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 8/8] Update .gitignore
--- .gitignore |3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 243457e..eb348fc 100644 --- a/.gitignore +++ b/.gitignore @@ -39,8 +39,10 @@ i915.kld install-sh libdrm/config.h.in libdrm.pc +libdrm_exynos.pc libdrm_intel.pc libdrm_nouveau.pc +libdrm_omap.pc libdrm_radeon.pc libkms.pc libtool @@ -70,6 +72,7 @@ tests/gem_flink tests/gem_mmap tests/gem_readwrite tests/openclose +tests/radeon/radeon_ttm tests/setversion tests/updatedraw tests/modeprint/modeprint -- 1.7.10.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 7/8] Always use width in scanf
--- tests/modetest/modetest.c |8 xf86drm.c |8 xf86drmMode.c |2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c index dff40d1..4540aa0 100644 --- a/tests/modetest/modetest.c +++ b/tests/modetest/modetest.c @@ -1215,10 +1215,10 @@ int main(int argc, char **argv) break; case 's': con_args[count].crtc = -1; - if (sscanf(optarg, %d:%64s, + if (sscanf(optarg, %20d:%64s, con_args[count].id, con_args[count].mode_str) != 2 - sscanf(optarg, %d@%d:%64s, + sscanf(optarg, %20d@%20d:%64s, con_args[count].id, con_args[count].crtc, con_args[count].mode_str) != 3) @@ -1227,12 +1227,12 @@ int main(int argc, char **argv) break; case 'P': strcpy(plane_args[plane_count].format_str, XR24); - if (sscanf(optarg, %d:%dx%d@%4s, + if (sscanf(optarg, %20d:%20dx%20d@%4s, plane_args[plane_count].con_id, plane_args[plane_count].w, plane_args[plane_count].h, plane_args[plane_count].format_str) != 4 - sscanf(optarg, %d:%dx%d, + sscanf(optarg, %20d:%20dx%20d, plane_args[plane_count].con_id, plane_args[plane_count].w, plane_args[plane_count].h) != 3) diff --git a/xf86drm.c b/xf86drm.c index 94f634d..bcb9fbf 100644 --- a/xf86drm.c +++ b/xf86drm.c @@ -224,18 +224,18 @@ static int drmMatchBusID(const char *id1, const char *id2, int pci_domain_ok) unsigned int o2, b2, d2, f2; int ret; - ret = sscanf(id1, pci:%04x:%02x:%02x.%u, o1, b1, d1, f1); + ret = sscanf(id1, pci:%04x:%02x:%02x.%20u, o1, b1, d1, f1); if (ret != 4) { o1 = 0; - ret = sscanf(id1, PCI:%u:%u:%u, b1, d1, f1); + ret = sscanf(id1, PCI:%20u:%20u:%20u, b1, d1, f1); if (ret != 3) return 0; } - ret = sscanf(id2, pci:%04x:%02x:%02x.%u, o2, b2, d2, f2); + ret = sscanf(id2, pci:%04x:%02x:%02x.%20u, o2, b2, d2, f2); if (ret != 4) { o2 = 0; - ret = sscanf(id2, PCI:%u:%u:%u, b2, d2, f2); + ret = sscanf(id2, PCI:%20u:%20u:%20u, b2, d2, f2); if (ret != 3) return 0; } diff --git a/xf86drmMode.c b/xf86drmMode.c index 04fdf1f..31b5abd 100644 --- a/xf86drmMode.c +++ b/xf86drmMode.c @@ -693,7 +693,7 @@ int drmCheckModesettingSupported(const char *busid) struct dirent *dent; int found = 0, ret; - ret = sscanf(busid, pci:%04x:%02x:%02x.%d, domain, bus, dev, func); + ret = sscanf(busid, pci:%04x:%02x:%02x.%20d, domain, bus, dev, func); if (ret != 4) return -EINVAL; -- 1.7.10.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] Documentation: DocBook DRM framework documentation
On Thu, Jul 12, 2012 at 7:00 PM, Laurent Pinchart laurent.pinch...@ideasonboard.com wrote: Signed-off-by: Laurent Pinchart laurent.pinch...@ideasonboard.com --- Documentation/DocBook/drm.tmpl | 2835 +++- 1 files changed, 2226 insertions(+), 609 deletions(-) Hi everybody, Here's the DRM kernel framework documentation previously posted to the dri-devel mailing list. The documentation has been reworked, converted to DocBook and merged with the existing DocBook DRM documentation stub. The result doesn't cover the whole DRM API but should hopefully be good enough for a start. I've done my best to follow a natural flow starting at initialization and covering the major DRM internal topics. As I'm not a native English speaker I'm not totally happy with the result, so if anyone wants to edit the text please feel free to do so. Review will as usual be appreciated, and acks will be even more welcome (I've been working on this document for longer than I feel comfortable with). btw, thanks for this! One minor typo below.. with that, Reviewed-by: Rob Clark rob.cl...@linaro.org diff --git a/Documentation/DocBook/drm.tmpl b/Documentation/DocBook/drm.tmpl index 196b8b9..44a2c66 100644 [snip] +sect2 + titleOutput Polling/title + synopsisvoid (*output_poll_changed)(struct drm_device *dev);/synopsis + para +This operation notifies the driver that the status of one or more +connectors has changed. Drivers that use the fbdev helper can just call s/fbdev/fb/ +the functiondrm_fb_helper_hotplug_event/function function to handle +this operation. BR, -R ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[drm-intel:drm-intel-next-queued 58/59] drivers/gpu/drm/i915/i915_gem_context.c:454:6: warning: unused variable 'ret'
Hi Chris, There are new compile warnings show up in tree: git://people.freedesktop.org/~danvet/drm-intel.git drm-intel-next-queued head: 3cbf0ed71c262c2f07b3386e3c07c8d41440e050 commit: 289513fe7d347ce23f4f45906324601bf7df01af [58/59] drm/i915: fix invalid reference handling of the default ctx obj All warnings: drivers/gpu/drm/i915/i915_gem_context.c: In function 'i915_switch_context': drivers/gpu/drm/i915/i915_gem_context.c:454:6: warning: unused variable 'ret' [-Wunused-variable] vim +454 drivers/gpu/drm/i915/i915_gem_context.c 451 struct drm_i915_file_private *file_priv = NULL; 452 struct i915_hw_context *to; 453 struct drm_i915_gem_object *from_obj = ring-last_context_obj; 454 int ret; 455 456 if (dev_priv-hw_contexts_disabled) 457 return 0; --- 0-DAY kernel build testing backend Open Source Technology Centre Fengguang Wu w...@linux.intel.com Intel Corporation ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[git pull] drm gma500 fixes
Hi Linus, Sorry been travelling and a bit neglectful of some of Alan's patches, These all look necessary for -fixes, Dave. The following changes since commit ac7d181e323a888015e19e2e4d776095a0433787: Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging (2012-07-13 11:01:03 -0700) are available in the git repository at: ssh://people.freedesktop.org/~airlied/linux.git drm-fixes for you to fetch changes up to a3928c6b5f43bcd561802b52049b6024b8da675f: gma500,cdv: Fix the brightness base (2012-07-17 04:35:06 +1000) Alan Cox (4): gma500: Fix frequency detection gma500: Fix lid related crash gma500: move the ASLE enable gma500,cdv: Fix the brightness base drivers/gpu/drm/gma500/cdv_device.c | 36 +++ drivers/gpu/drm/gma500/opregion.c |8 +++- drivers/gpu/drm/gma500/opregion.h |5 + drivers/gpu/drm/gma500/psb_device.c | 13 + drivers/gpu/drm/gma500/psb_drv.c|1 + 5 files changed, 34 insertions(+), 29 deletions(-) ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [git pull] drm gma500 fixes
On Mon, Jul 16, 2012 at 12:42 PM, Dave Airlie airl...@linux.ie wrote: Sorry been travelling and a bit neglectful of some of Alan's patches, I actually took the three Alan sent me already, exactly because they seemed harmless and I didn't know your schedule. Your pull has a gma500: Fix frequency detection patch that I haven't seen though, which makes me wonder if Alan wants that one too. He only sent me a series of the three other patches.. Alan? Linus ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [git pull] drm gma500 fixes
On Mon, 16 Jul 2012 13:44:32 -0700 Linus Torvalds torva...@linux-foundation.org wrote: On Mon, Jul 16, 2012 at 12:42 PM, Dave Airlie airl...@linux.ie wrote: Sorry been travelling and a bit neglectful of some of Alan's patches, I actually took the three Alan sent me already, exactly because they seemed harmless and I didn't know your schedule. Your pull has a gma500: Fix frequency detection patch that I haven't seen though, which makes me wonder if Alan wants that one too. He only sent me a series of the three other patches.. Alan? The frequency detect bug isn't a regression, indeed its not clear it's a path ever taken. Alan ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [git pull] drm gma500 fixes
On Tue, Jul 17, 2012 at 7:07 AM, Alan Cox a...@lxorguk.ukuu.org.uk wrote: On Mon, 16 Jul 2012 13:44:32 -0700 Linus Torvalds torva...@linux-foundation.org wrote: On Mon, Jul 16, 2012 at 12:42 PM, Dave Airlie airl...@linux.ie wrote: Sorry been travelling and a bit neglectful of some of Alan's patches, I actually took the three Alan sent me already, exactly because they seemed harmless and I didn't know your schedule. Your pull has a gma500: Fix frequency detection patch that I haven't seen though, which makes me wonder if Alan wants that one too. He only sent me a series of the three other patches.. Alan? The frequency detect bug isn't a regression, indeed its not clear it's a path ever taken. Cool then drop it, I just found it in my INBOX, anyways I also sent a dodgy URL in the pull, since I wasn't on my usual machine I hadn't updated stuff. So yeah ignore this one and I'll add the extra patch into -next. Thanks, Dave. ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH] drm/radeon: update ib_execute for SI
From: Alex Deucher alexander.deuc...@amd.com When submitting a CONST_IB, emit a SWITCH_BUFFER packet before the CONST_IB. This isn't strictly necessary (the driver will work fine without it), but is good practice and allows for more flexible DE/CE sychronization options in the future. Current userspace drivers do not take advantage of the CE yet. Signed-off-by: Alex Deucher alexander.deuc...@amd.com --- drivers/gpu/drm/radeon/si.c |6 ++ drivers/gpu/drm/radeon/sid.h |1 + 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c index 53e313b..191a3cd 100644 --- a/drivers/gpu/drm/radeon/si.c +++ b/drivers/gpu/drm/radeon/si.c @@ -1778,6 +1778,12 @@ void si_ring_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib) else header = PACKET3(PACKET3_INDIRECT_BUFFER, 2); + if (ib-is_const_ib) { + /* set switch buffer packet before const IB */ + radeon_ring_write(ring, PACKET3(PACKET3_SWITCH_BUFFER, 0)); + radeon_ring_write(ring, 0); + } + radeon_ring_write(ring, header); radeon_ring_write(ring, #ifdef __BIG_ENDIAN diff --git a/drivers/gpu/drm/radeon/sid.h b/drivers/gpu/drm/radeon/sid.h index db40679..7869089 100644 --- a/drivers/gpu/drm/radeon/sid.h +++ b/drivers/gpu/drm/radeon/sid.h @@ -901,5 +901,6 @@ #definePACKET3_WAIT_ON_DE_COUNTER_DIFF 0x88 #definePACKET3_SET_CE_DE_COUNTERS 0x89 #definePACKET3_WAIT_ON_AVAIL_BUFFER0x8A +#definePACKET3_SWITCH_BUFFER 0x8B #endif -- 1.7.7.5 ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 52171] New: [gallium/r600/clover] Simple benchmarks failed to run
https://bugs.freedesktop.org/show_bug.cgi?id=52171 Bug #: 52171 Summary: [gallium/r600/clover] Simple benchmarks failed to run Classification: Unclassified Product: Mesa Version: git Platform: Other OS/Version: Linux (All) Status: NEW Severity: normal Priority: medium Component: Drivers/Gallium/r600 AssignedTo: dri-devel@lists.freedesktop.org ReportedBy: ale...@gentoo.org I get benchmarks from here http://www.bealto.com/gpu-benchmarks.html CPU ones runs fine while all gpu benchmarks failed with: Build failed, errors: clGetProgramInfo NUM_DEVICES failed HW is 01:00.0 VGA compatible controller: Advanced Micro Devices [AMD] nee ATI Turks [Radeon HD 6670] -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 00/10] Radeon documentation updates for drm-next
From: Alex Deucher alexander.deuc...@amd.com Same as my previous set, but rebased on Christian's latest ring changes for drm-next: http://cgit.freedesktop.org/~deathsimple/linux/log/?h=wip Alex Deucher (10): drm/radeon: document radeon_device.c (v2) drm/radeon: document radeon_kms.c drm/radeon: document radeon_irq_kms.c drm/radeon: document radeon_asic.c drm/radeon: document radeon_fence.c (v2) drm/radeon: document radeon_ring.c (v3) drm/radeon: document non-VM functions in radeon_gart.c (v2) drm/radeon: document VM functions in radeon_gart.c (v3) drm/radeon: start to document the functions r100.c drm/radeon: start to document evergreen.c drivers/gpu/drm/radeon/evergreen.c | 120 drivers/gpu/drm/radeon/r100.c | 127 - drivers/gpu/drm/radeon/radeon_asic.c| 46 + drivers/gpu/drm/radeon/radeon_device.c | 313 ++- drivers/gpu/drm/radeon/radeon_fence.c | 242 +++- drivers/gpu/drm/radeon/radeon_gart.c| 267 ++- drivers/gpu/drm/radeon/radeon_irq_kms.c | 150 +++ drivers/gpu/drm/radeon/radeon_kms.c | 126 + drivers/gpu/drm/radeon/radeon_ring.c| 207 - 9 files changed, 1584 insertions(+), 14 deletions(-) -- 1.7.7.5 ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 01/10] drm/radeon: document radeon_device.c (v2)
From: Alex Deucher alexander.deuc...@amd.com Adds documentation to most of the functions in radeon_device.c v2: split out general descriptions as per Christian's comments. Signed-off-by: Alex Deucher alexander.deuc...@amd.com --- drivers/gpu/drm/radeon/radeon_device.c | 313 +++- 1 files changed, 310 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c index 0302a9f..528dab1 100644 --- a/drivers/gpu/drm/radeon/radeon_device.c +++ b/drivers/gpu/drm/radeon/radeon_device.c @@ -96,8 +96,12 @@ static const char radeon_family_name[][16] = { LAST, }; -/* - * Clear GPU surface registers. +/** + * radeon_surface_init - Clear GPU surface registers. + * + * @rdev: radeon_device pointer + * + * Clear GPU surface registers (r1xx-r5xx). */ void radeon_surface_init(struct radeon_device *rdev) { @@ -119,6 +123,13 @@ void radeon_surface_init(struct radeon_device *rdev) /* * GPU scratch registers helpers function. */ +/** + * radeon_scratch_init - Init scratch register driver information. + * + * @rdev: radeon_device pointer + * + * Init CP scratch register driver information (r1xx-r5xx) + */ void radeon_scratch_init(struct radeon_device *rdev) { int i; @@ -136,6 +147,15 @@ void radeon_scratch_init(struct radeon_device *rdev) } } +/** + * radeon_scratch_get - Allocate a scratch register + * + * @rdev: radeon_device pointer + * @reg: scratch register mmio offset + * + * Allocate a CP scratch register for use by the driver (all asics). + * Returns 0 on success or -EINVAL on failure. + */ int radeon_scratch_get(struct radeon_device *rdev, uint32_t *reg) { int i; @@ -150,6 +170,14 @@ int radeon_scratch_get(struct radeon_device *rdev, uint32_t *reg) return -EINVAL; } +/** + * radeon_scratch_free - Free a scratch register + * + * @rdev: radeon_device pointer + * @reg: scratch register mmio offset + * + * Free a CP scratch register allocated for use by the driver (all asics) + */ void radeon_scratch_free(struct radeon_device *rdev, uint32_t reg) { int i; @@ -162,6 +190,20 @@ void radeon_scratch_free(struct radeon_device *rdev, uint32_t reg) } } +/* + * radeon_wb_*() + * Writeback is the the method by which the the GPU updates special pages + * in memory with the status of certain GPU events (fences, ring pointers, + * etc.). + */ + +/** + * radeon_wb_disable - Disable Writeback + * + * @rdev: radeon_device pointer + * + * Disables Writeback (all asics). Used for suspend. + */ void radeon_wb_disable(struct radeon_device *rdev) { int r; @@ -177,6 +219,14 @@ void radeon_wb_disable(struct radeon_device *rdev) rdev-wb.enabled = false; } +/** + * radeon_wb_fini - Disable Writeback and free memory + * + * @rdev: radeon_device pointer + * + * Disables Writeback and frees the Writeback memory (all asics). + * Used at driver shutdown. + */ void radeon_wb_fini(struct radeon_device *rdev) { radeon_wb_disable(rdev); @@ -187,6 +237,15 @@ void radeon_wb_fini(struct radeon_device *rdev) } } +/** + * radeon_wb_init- Init Writeback driver info and allocate memory + * + * @rdev: radeon_device pointer + * + * Disables Writeback and frees the Writeback memory (all asics). + * Used at driver startup. + * Returns 0 on success or an -error on failure. + */ int radeon_wb_init(struct radeon_device *rdev) { int r; @@ -355,6 +414,15 @@ void radeon_gtt_location(struct radeon_device *rdev, struct radeon_mc *mc) /* * GPU helpers function. */ +/** + * radeon_card_posted - check if the hw has already been initialized + * + * @rdev: radeon_device pointer + * + * Check if the asic has been initialized (all asics). + * Used at driver startup. + * Returns true if initialized or false if not. + */ bool radeon_card_posted(struct radeon_device *rdev) { uint32_t reg; @@ -404,6 +472,14 @@ bool radeon_card_posted(struct radeon_device *rdev) } +/** + * radeon_update_bandwidth_info - update display bandwidth params + * + * @rdev: radeon_device pointer + * + * Used when sclk/mclk are switched or display modes are set. + * params are used to calculate display watermarks (all asics) + */ void radeon_update_bandwidth_info(struct radeon_device *rdev) { fixed20_12 a; @@ -424,6 +500,15 @@ void radeon_update_bandwidth_info(struct radeon_device *rdev) } } +/** + * radeon_boot_test_post_card - check and possibly initialize the hw + * + * @rdev: radeon_device pointer + * + * Check if the asic is initialized and if not, attempt to initialize + * it (all asics). + * Returns true if initialized or false if not. + */ bool radeon_boot_test_post_card(struct radeon_device *rdev) { if (radeon_card_posted(rdev)) @@ -442,6 +527,16 @@ bool radeon_boot_test_post_card(struct radeon_device *rdev) } } +/** + * radeon_dummy_page_init - init dummy page used by the driver + * + * @rdev: radeon_device
[PATCH 02/10] drm/radeon: document radeon_kms.c
From: Alex Deucher alexander.deuc...@amd.com Adds documentation to most of the functions in radeon_kms.c Signed-off-by: Alex Deucher alexander.deuc...@amd.com --- drivers/gpu/drm/radeon/radeon_kms.c | 126 +++ 1 files changed, 126 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c index 18b81d6..1d73f16 100644 --- a/drivers/gpu/drm/radeon/radeon_kms.c +++ b/drivers/gpu/drm/radeon/radeon_kms.c @@ -33,6 +33,17 @@ #include linux/vga_switcheroo.h #include linux/slab.h +/** + * radeon_driver_unload_kms - Main unload function for KMS. + * + * @dev: drm dev pointer + * + * This is the main unload function for KMS (all asics). + * It calls radeon_modeset_fini() to tear down the + * displays, and radeon_device_fini() to tear down + * the rest of the device (CP, writeback, etc.). + * Returns 0 on success. + */ int radeon_driver_unload_kms(struct drm_device *dev) { struct radeon_device *rdev = dev-dev_private; @@ -46,6 +57,19 @@ int radeon_driver_unload_kms(struct drm_device *dev) return 0; } +/** + * radeon_driver_load_kms - Main load function for KMS. + * + * @dev: drm dev pointer + * @flags: device flags + * + * This is the main load function for KMS (all asics). + * It calls radeon_device_init() to set up the non-display + * parts of the chip (asic init, CP, writeback, etc.), and + * radeon_modeset_init() to set up the display parts + * (crtcs, encoders, hotplug detect, etc.). + * Returns 0 on success, error on failure. + */ int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags) { struct radeon_device *rdev; @@ -96,6 +120,16 @@ out: return r; } +/** + * radeon_set_filp_rights - Set filp right. + * + * @dev: drm dev pointer + * @owner: drm file + * @applier: drm file + * @value: value + * + * Sets the filp rights for the device (all asics). + */ static void radeon_set_filp_rights(struct drm_device *dev, struct drm_file **owner, struct drm_file *applier, @@ -118,6 +152,18 @@ static void radeon_set_filp_rights(struct drm_device *dev, /* * Userspace get information ioctl */ +/** + * radeon_info_ioctl - answer a device specific request. + * + * @rdev: radeon device pointer + * @data: request object + * @filp: drm filp + * + * This function is used to pass device specific parameters to the userspace + * drivers. Examples include: pci device id, pipeline parms, tiling params, + * etc. (all asics). + * Returns 0 on success, -EINVAL on failure. + */ int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp) { struct radeon_device *rdev = dev-dev_private; @@ -301,16 +347,40 @@ int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp) /* * Outdated mess for old drm with Xorg being in charge (void function now). */ +/** + * radeon_driver_firstopen_kms - drm callback for first open + * + * @dev: drm dev pointer + * + * Nothing to be done for KMS (all asics). + * Returns 0 on success. + */ int radeon_driver_firstopen_kms(struct drm_device *dev) { return 0; } +/** + * radeon_driver_firstopen_kms - drm callback for last close + * + * @dev: drm dev pointer + * + * Switch vga switcheroo state after last close (all asics). + */ void radeon_driver_lastclose_kms(struct drm_device *dev) { vga_switcheroo_process_delayed_switch(); } +/** + * radeon_driver_open_kms - drm callback for open + * + * @dev: drm dev pointer + * @file_priv: drm file + * + * On device open, init vm on cayman+ (all asics). + * Returns 0 on success, error on failure. + */ int radeon_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv) { struct radeon_device *rdev = dev-dev_private; @@ -339,6 +409,14 @@ int radeon_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv) return 0; } +/** + * radeon_driver_postclose_kms - drm callback for post close + * + * @dev: drm dev pointer + * @file_priv: drm file + * + * On device post close, tear down vm on cayman+ (all asics). + */ void radeon_driver_postclose_kms(struct drm_device *dev, struct drm_file *file_priv) { @@ -354,6 +432,15 @@ void radeon_driver_postclose_kms(struct drm_device *dev, } } +/** + * radeon_driver_preclose_kms - drm callback for pre close + * + * @dev: drm dev pointer + * @file_priv: drm file + * + * On device pre close, tear down hyperz and cmask filps on r1xx-r5xx + * (all asics). + */ void radeon_driver_preclose_kms(struct drm_device *dev, struct drm_file *file_priv) { @@ -367,6 +454,15 @@ void radeon_driver_preclose_kms(struct drm_device *dev, /* * VBlank related functions. */ +/** + * radeon_get_vblank_counter_kms - get frame count + * + * @dev: drm dev pointer + * @crtc: crtc to get the frame count from + * + * Gets the frame count on the
[PATCH 03/10] drm/radeon: document radeon_irq_kms.c
From: Alex Deucher alexander.deuc...@amd.com Adds documentation to most of the functions in radeon_irq_kms.c Signed-off-by: Alex Deucher alexander.deuc...@amd.com --- drivers/gpu/drm/radeon/radeon_irq_kms.c | 150 +++ 1 files changed, 150 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_irq_kms.c b/drivers/gpu/drm/radeon/radeon_irq_kms.c index 6664514..afaa172 100644 --- a/drivers/gpu/drm/radeon/radeon_irq_kms.c +++ b/drivers/gpu/drm/radeon/radeon_irq_kms.c @@ -34,6 +34,15 @@ #define RADEON_WAIT_IDLE_TIMEOUT 200 +/** + * radeon_driver_irq_handler_kms - irq handler for KMS + * + * @DRM_IRQ_ARGS: args + * + * This is the irq handler for the radeon KMS driver (all asics). + * radeon_irq_process is a macro that points to the per-asic + * irq handler callback. + */ irqreturn_t radeon_driver_irq_handler_kms(DRM_IRQ_ARGS) { struct drm_device *dev = (struct drm_device *) arg; @@ -45,6 +54,17 @@ irqreturn_t radeon_driver_irq_handler_kms(DRM_IRQ_ARGS) /* * Handle hotplug events outside the interrupt handler proper. */ +/** + * radeon_hotplug_work_func - display hotplug work handler + * + * @work: work struct + * + * This is the hot plug event work handler (all asics). + * The work gets scheduled from the irq handler if there + * was a hot plug interrupt. It walks the connector table + * and calls the hotplug handler for each one, then sends + * a drm hotplug event to alert userspace. + */ static void radeon_hotplug_work_func(struct work_struct *work) { struct radeon_device *rdev = container_of(work, struct radeon_device, @@ -61,6 +81,14 @@ static void radeon_hotplug_work_func(struct work_struct *work) drm_helper_hpd_irq_event(dev); } +/** + * radeon_driver_irq_preinstall_kms - drm irq preinstall callback + * + * @dev: drm dev pointer + * + * Gets the hw ready to enable irqs (all asics). + * This function disables all interrupt sources on the GPU. + */ void radeon_driver_irq_preinstall_kms(struct drm_device *dev) { struct radeon_device *rdev = dev-dev_private; @@ -85,12 +113,27 @@ void radeon_driver_irq_preinstall_kms(struct drm_device *dev) radeon_irq_process(rdev); } +/** + * radeon_driver_irq_postinstall_kms - drm irq preinstall callback + * + * @dev: drm dev pointer + * + * Handles stuff to be done after enabling irqs (all asics). + * Returns 0 on success. + */ int radeon_driver_irq_postinstall_kms(struct drm_device *dev) { dev-max_vblank_count = 0x001f; return 0; } +/** + * radeon_driver_irq_uninstall_kms - drm irq uninstall callback + * + * @dev: drm dev pointer + * + * This function disables all interrupt sources on the GPU (all asics). + */ void radeon_driver_irq_uninstall_kms(struct drm_device *dev) { struct radeon_device *rdev = dev-dev_private; @@ -116,6 +159,16 @@ void radeon_driver_irq_uninstall_kms(struct drm_device *dev) spin_unlock_irqrestore(rdev-irq.lock, irqflags); } +/** + * radeon_msi_ok - asic specific msi checks + * + * @rdev: radeon device pointer + * + * Handles asic specific MSI checks to determine if + * MSIs should be enabled on a particular chip (all asics). + * Returns true if MSIs should be enabled, false if MSIs + * should not be enabled. + */ static bool radeon_msi_ok(struct radeon_device *rdev) { /* RV370/RV380 was first asic with MSI support */ @@ -168,6 +221,14 @@ static bool radeon_msi_ok(struct radeon_device *rdev) return true; } +/** + * radeon_irq_kms_init - init driver interrupt info + * + * @rdev: radeon device pointer + * + * Sets up the work irq handlers, vblank init, MSIs, etc. (all asics). + * Returns 0 for success, error for failure. + */ int radeon_irq_kms_init(struct radeon_device *rdev) { int r = 0; @@ -200,6 +261,13 @@ int radeon_irq_kms_init(struct radeon_device *rdev) return 0; } +/** + * radeon_irq_kms_fini - tear down driver interrrupt info + * + * @rdev: radeon device pointer + * + * Tears down the work irq handlers, vblank handlers, MSIs, etc. (all asics). + */ void radeon_irq_kms_fini(struct radeon_device *rdev) { drm_vblank_cleanup(rdev-ddev); @@ -212,6 +280,16 @@ void radeon_irq_kms_fini(struct radeon_device *rdev) flush_work_sync(rdev-hotplug_work); } +/** + * radeon_irq_kms_sw_irq_get - enable software interrupt + * + * @rdev: radeon device pointer + * @ring: ring whose interrupt you want to enable + * + * Enables the software interrupt for a specific ring (all asics). + * The software interrupt is generally used to signal a fence on + * a particular ring. + */ void radeon_irq_kms_sw_irq_get(struct radeon_device *rdev, int ring) { unsigned long irqflags; @@ -226,6 +304,16 @@ void radeon_irq_kms_sw_irq_get(struct radeon_device *rdev, int ring) } } +/** + * radeon_irq_kms_sw_irq_put - disable software interrupt + * + * @rdev: radeon device pointer + * @ring: ring whose interrupt you want to disable + * + *
[PATCH 04/10] drm/radeon: document radeon_asic.c
From: Alex Deucher alexander.deuc...@amd.com Adds documentation to most of the functions in radeon_asic.c Signed-off-by: Alex Deucher alexander.deuc...@amd.com --- drivers/gpu/drm/radeon/radeon_asic.c | 46 ++ 1 files changed, 46 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_asic.c b/drivers/gpu/drm/radeon/radeon_asic.c index f533df5..973417c 100644 --- a/drivers/gpu/drm/radeon/radeon_asic.c +++ b/drivers/gpu/drm/radeon/radeon_asic.c @@ -40,6 +40,16 @@ /* * Registers accessors functions. */ +/** + * radeon_invalid_rreg - dummy reg read function + * + * @rdev: radeon device pointer + * @reg: offset of register + * + * Dummy register read function. Used for register blocks + * that certain asics don't have (all asics). + * Returns the value in the register. + */ static uint32_t radeon_invalid_rreg(struct radeon_device *rdev, uint32_t reg) { DRM_ERROR(Invalid callback to read register 0x%04X\n, reg); @@ -47,6 +57,16 @@ static uint32_t radeon_invalid_rreg(struct radeon_device *rdev, uint32_t reg) return 0; } +/** + * radeon_invalid_wreg - dummy reg write function + * + * @rdev: radeon device pointer + * @reg: offset of register + * @v: value to write to the register + * + * Dummy register read function. Used for register blocks + * that certain asics don't have (all asics). + */ static void radeon_invalid_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v) { DRM_ERROR(Invalid callback to write register 0x%04X with 0x%08X\n, @@ -54,6 +74,14 @@ static void radeon_invalid_wreg(struct radeon_device *rdev, uint32_t reg, uint32 BUG_ON(1); } +/** + * radeon_register_accessor_init - sets up the register accessor callbacks + * + * @rdev: radeon device pointer + * + * Sets up the register accessor callbacks for various register + * apertures. Not all asics have all apertures (all asics). + */ static void radeon_register_accessor_init(struct radeon_device *rdev) { rdev-mc_rreg = radeon_invalid_rreg; @@ -102,6 +130,14 @@ static void radeon_register_accessor_init(struct radeon_device *rdev) /* helper to disable agp */ +/** + * radeon_agp_disable - AGP disable helper function + * + * @rdev: radeon device pointer + * + * Removes AGP flags and changes the gart callbacks on AGP + * cards when using the internal gart rather than AGP (all asics). + */ void radeon_agp_disable(struct radeon_device *rdev) { rdev-flags = ~RADEON_IS_AGP; @@ -1608,6 +1644,16 @@ static struct radeon_asic si_asic = { }, }; +/** + * radeon_asic_init - register asic specific callbacks + * + * @rdev: radeon device pointer + * + * Registers the appropriate asic specific callbacks for each + * chip family. Also sets other asics specific info like the number + * of crtcs and the register aperture accessors (all asics). + * Returns 0 for success. + */ int radeon_asic_init(struct radeon_device *rdev) { radeon_register_accessor_init(rdev); -- 1.7.7.5 ___ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 05/10] drm/radeon: document radeon_fence.c (v2)
From: Alex Deucher alexander.deuc...@amd.com Adds documentation to most of the functions in radeon_fence.c v2: address Christian's comments: - split common concept description into it's own comment - fix description of intr parameter - Improve description of -EDEADLK error Signed-off-by: Alex Deucher alexander.deuc...@amd.com --- drivers/gpu/drm/radeon/radeon_fence.c | 242 - 1 files changed, 240 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_fence.c b/drivers/gpu/drm/radeon/radeon_fence.c index 7a181c3..7b737b9 100644 --- a/drivers/gpu/drm/radeon/radeon_fence.c +++ b/drivers/gpu/drm/radeon/radeon_fence.c @@ -40,6 +40,26 @@ #include radeon.h #include radeon_trace.h +/* + * Fences + * Fences mark an event in the GPUs pipeline and are used + * for GPU/CPU synchronization. When the fence is written, + * it is expected that all buffers associated with that fence + * are no longer in use by the associated ring on the GPU and + * that the the relevant GPU caches have been flushed. Whether + * we use a scratch register or memory location depends on the asic + * and whether writeback is enabled. + */ + +/** + * radeon_fence_write - write a fence value + * + * @rdev: radeon_device pointer + * @seq: sequence number to write + * @ring: ring index the fence is associated with + * + * Writes a fence value to memory or a scratch register (all asics). + */ static void radeon_fence_write(struct radeon_device *rdev, u32 seq, int ring) { struct radeon_fence_driver *drv = rdev-fence_drv[ring]; @@ -50,6 +70,15 @@ static void radeon_fence_write(struct radeon_device *rdev, u32 seq, int ring) } } +/** + * radeon_fence_read - read a fence value + * + * @rdev: radeon_device pointer + * @ring: ring index the fence is associated with + * + * Reads a fence value from memory or a scratch register (all asics). + * Returns the value of the fence read from memory or register. + */ static u32 radeon_fence_read(struct radeon_device *rdev, int ring) { struct radeon_fence_driver *drv = rdev-fence_drv[ring]; @@ -63,6 +92,16 @@ static u32 radeon_fence_read(struct radeon_device *rdev, int ring) return seq; } +/** + * radeon_fence_emit - emit a fence on the requested ring + * + * @rdev: radeon_device pointer + * @fence: radeon fence object + * @ring: ring index the fence is associated with + * + * Emits a fence command on the requested ring (all asics). + * Returns 0 on success, -ENOMEM on failure. + */ int radeon_fence_emit(struct radeon_device *rdev, struct radeon_fence **fence, int ring) @@ -81,6 +120,15 @@ int radeon_fence_emit(struct radeon_device *rdev, return 0; } +/** + * radeon_fence_process - process a fence + * + * @rdev: radeon_device pointer + * @ring: ring index the fence is associated with + * + * Checks the current fence value and wakes the fence queue + * if the sequence number has increased (all asics). + */ void radeon_fence_process(struct radeon_device *rdev, int ring) { uint64_t seq, last_seq; @@ -141,6 +189,13 @@ void radeon_fence_process(struct radeon_device *rdev, int ring) } } +/** + * radeon_fence_destroy - destroy a fence + * + * @kref: fence kref + * + * Frees the fence object (all asics). + */ static void radeon_fence_destroy(struct kref *kref) { struct radeon_fence *fence; @@ -149,6 +204,20 @@ static void radeon_fence_destroy(struct kref *kref) kfree(fence); } +/** + * radeon_fence_seq_signaled - check if a fence sequeuce number has signaled + * + * @rdev: radeon device pointer + * @seq: sequence number + * @ring: ring index the fence is associated with + * + * Check if the last singled fence sequnce number is = the requested + * sequence number (all asics). + * Returns true if the fence has signaled (current fence value + * is = requested value) or false if it has not (current fence + * value is the requested value. Helper function for + * radeon_fence_signaled(). + */ static bool radeon_fence_seq_signaled(struct radeon_device *rdev, u64 seq, unsigned ring) { @@ -163,6 +232,14 @@ static bool radeon_fence_seq_signaled(struct radeon_device *rdev, return false; } +/** + * radeon_fence_signaled - check if a fence has signaled + * + * @fence: radeon fence object + * + * Check if the requested fence has signaled (all asics). + * Returns true if the fence has signaled or false if it has not. + */ bool radeon_fence_signaled(struct radeon_fence *fence) { if (!fence) { @@ -178,6 +255,24 @@ bool radeon_fence_signaled(struct radeon_fence *fence) return false; } +/** + * radeon_fence_wait_seq - wait for a specific sequence number + * + * @rdev: radeon device pointer + * @target_seq: sequence number we want to wait for + * @ring: ring index the fence is associated with + * @intr: use interruptable sleep + * @lock_ring: whether the ring should
[PATCH 06/10] drm/radeon: document radeon_ring.c (v3)
From: Alex Deucher alexander.deuc...@amd.com Adds documentation to most of the functions in radeon_ring.c v2: adjust per Christian's suggestions v3: adjust per Christian's latest patches Signed-off-by: Alex Deucher alexander.deuc...@amd.com --- drivers/gpu/drm/radeon/radeon_ring.c | 207 +- 1 files changed, 204 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_ring.c b/drivers/gpu/drm/radeon/radeon_ring.c index c48c354..3a487cd 100644 --- a/drivers/gpu/drm/radeon/radeon_ring.c +++ b/drivers/gpu/drm/radeon/radeon_ring.c @@ -35,10 +35,28 @@ #include atom.h /* - * IB. + * IB + * IBs (Indirect Buffers) and areas of GPU accessible memory where + * commands are stored. You can put a pointer to the IB in the + * command ring and the hw will fetch the commands from the IB + * and execute them. Generally userspace acceleration drivers + * produce command buffers which are send to the kernel and + * put in IBs for execution by the requested ring. */ int radeon_debugfs_sa_init(struct radeon_device *rdev); +/** + * radeon_ib_get - request an IB (Indirect Buffer) + * + * @rdev: radeon_device pointer + * @ring: ring index the IB is associated with + * @ib: IB object returned + * @size: requested IB size + * + * Request an IB (all asics). IBs are allocated using the + * suballocator. + * Returns 0 on success, error on failure. + */ int radeon_ib_get(struct radeon_device *rdev, int ring, struct radeon_ib *ib, unsigned size) { @@ -67,6 +85,14 @@ int radeon_ib_get(struct radeon_device *rdev, int ring, return 0; } +/** + * radeon_ib_free - free an IB (Indirect Buffer) + * + * @rdev: radeon_device pointer + * @ib: IB object to free + * + * Free an IB (all asics). + */ void radeon_ib_free(struct radeon_device *rdev, struct radeon_ib *ib) { radeon_semaphore_free(rdev, ib-semaphore, ib-fence); @@ -74,6 +100,26 @@ void radeon_ib_free(struct radeon_device *rdev, struct radeon_ib *ib) radeon_fence_unref(ib-fence); } +/** + * radeon_ib_schedule - schedule an IB (Indirect Buffer) on the ring + * + * @rdev: radeon_device pointer + * @ib: IB object to schedule + * @const_ib: Const IB to schedule (SI only) + * + * Schedule an IB on the associated ring (all asics). + * Returns 0 on success, error on failure. + * + * On SI, there are two parallel engines fed from the primary ring, + * the CE (Constant Engine) and the DE (Drawing Engine). Since + * resource descriptors have moved to memory, the CE allows you to + * prime the caches while the DE is updating register state so that + * the resource descriptors will be already in cache when the draw is + * processed. To accomplish this, the userspace driver submits two + * IBs, one for the CE and one for the DE. If there is a CE IB (called + * a CONST_IB), it will be put on the ring prior to the DE IB. Prior + * to SI there was just a DE IB. + */ int radeon_ib_schedule(struct radeon_device *rdev, struct radeon_ib *ib, struct radeon_ib *const_ib) { @@ -124,6 +170,15 @@ int radeon_ib_schedule(struct radeon_device *rdev, struct radeon_ib *ib, return 0; } +/** + * radeon_ib_pool_init - Init the IB (Indirect Buffer) pool + * + * @rdev: radeon_device pointer + * + * Initialize the suballocator to manage a pool of memory + * for use as IBs (all asics). + * Returns 0 on success, error on failure. + */ int radeon_ib_pool_init(struct radeon_device *rdev) { int r; @@ -150,6 +205,14 @@ int radeon_ib_pool_init(struct radeon_device *rdev) return 0; } +/** + * radeon_ib_pool_fini - Free the IB (Indirect Buffer) pool + * + * @rdev: radeon_device pointer + * + * Tear down the suballocator managing the pool of memory + * for use as IBs (all asics). + */ void radeon_ib_pool_fini(struct radeon_device *rdev) { if (rdev-ib_pool_ready) { @@ -159,6 +222,16 @@ void radeon_ib_pool_fini(struct radeon_device *rdev) } } +/** + * radeon_ib_ring_tests - test IBs on the rings + * + * @rdev: radeon_device pointer + * + * Test an IB (Indirect Buffer) on each ring. + * If the test fails, disable the ring. + * Returns 0 on success, error if the primary GFX ring + * IB test fails. + */ int radeon_ib_ring_tests(struct radeon_device *rdev) { unsigned i; @@ -190,10 +263,28 @@ int radeon_ib_ring_tests(struct radeon_device *rdev) } /* - * Ring. + * Rings + * Most engines on the GPU are fed via ring buffers. Ring + * buffers are areas of GPU accessible memory that the host + * writes commands into and the GPU reads commands out of. + * There is a rptr (read pointer) that determines where the + * GPU is currently reading, and a wptr (write pointer) + * which determines where the host has written. When the + * pointers are equal, the ring is idle. When the host + * writes commands to the ring buffer, it increments the + * wptr. The GPU then starts fetching commands and executes + * them until the pointers are