Skip to contentSkip to conversation

Intel-gfx Digest, Vol 61, Issue 10

DISCUSSION Geisler, Florence 1 participant 1 message Feb 3, 2013 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Can you remove me from this mailing list?

Thanks,

Florence

-----Original Message-----
From: intel-gfx-bounces+florence.geisler=intel.com@lists.freedesktop.org [mailto:intel-gfx-bounces+florence.geisler=intel.com@lists.freedesktop.org] On Behalf Of [email protected]
Sent: Sunday, February 03, 2013 12:01 PM
To: [email protected]
Subject: Intel-gfx Digest, Vol 61, Issue 10

Send Intel-gfx mailing list submissions to
[email protected]

To subscribe or unsubscribe via the World Wide Web, visit
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
or, via email, send a message with subject or body 'help' to
[email protected]

You can reach the person managing the list at
[email protected]

When replying, please edit your Subject line so it is more specific than "Re: Contents of Intel-gfx digest..."

Today's Topics:

1. Re: [PATCH] PM: make VT switching to the suspend console
optional v2 (Rafael J. Wysocki)
2. Re: Advanced Deinterlacers (Jochen Heuer)
3. Re: [PATCH 00/10] [RFC v2] quick dump (Ben Widawsky)
4. Re: [PATCH 09/10] quick_dump: Connect libpciaccess and other
utils (Ben Widawsky)

----------------------------------------------------------------------

Message: 1
Date: Sun, 03 Feb 2013 13:59:49 +0100
From: "Rafael J. Wysocki" <[email protected]>
To: Jesse Barnes <[email protected]>
Cc: [email protected], [email protected],
Linux PM list <[email protected]>
Subject: Re: [Intel-gfx] [PATCH] PM: make VT switching to the suspend
console optional v2
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"

Quoted 24 lines · Jesse Barnes
Quoted 15 lines · On Sat, 02 Feb 2013 21:50:35 +0100 "Rafael J. Wysocki" <[email protected]> wrote:
Quoted 15 lines
Quoted 10 lines

+ * Drivers can indicate support for switchless suspend/resume,
+ which can
+ * save time and flicker, by using this routine and passing
+ 'false' as
+ * the argument. If any loaded driver needs VT switching, or
+ the
+ * no_console_suspend argument has been passed on the command
+ line, VT
+ * switches will occur.
+ */

It seems to me that we'll need a separate counter for the number of registered drivers and do the switch if that number is equal to the number of drivers that have passed false to this thing.

Quoted 6 lines
Quoted 2 lines

In which case we can simplify this slightly and introduce pm_vt_swtich_not_required(void)

Sorry, that won't be sufficient. Rather something like pm_vt_switch_get() (indicating "I'll do the switch, thanks") and pm_vt_switch_put() (indicating "now you need to do the switch yourself").

Quoted 8 lines

I thought of both of your approaches before posting this one, but each have other problems. And I found a bug in mine last night.

So I think I need a separate count of drivers that need the switch, and ones that don't. Then if either no driver has registered or if the need_switch count is nonzero, we'll do the switch. Otherwise, if the dont_need_switch is nonzero, we can avoid the switch. I think that'll handle all the cases I outlined.

Yes, it should cover them all I think.

Quoted 2 lines

My code as posted will fail if one driver needs a switch but then two switch free drivers register.

I see.

Thanks,
Rafael

--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

------------------------------

Message: 2
Date: Sun, 3 Feb 2013 15:37:45 +0100
From: Jochen Heuer <[email protected]>
To: Mario Schulz <[email protected]>
Cc: [email protected]
Subject: Re: [Intel-gfx] Advanced Deinterlacers
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii

Hello,

Quoted 9 lines

As far as I have seen you have successfully implementeted the API technology to select interlacers in the video pipeline as video postprocessor since middle of last year.

The VDR community is still waiting for MotionAdaptive or MotionCompensated.

Could you comment on your schedule for that?
- Is it for some reason technologically impossible to get it implemented?
- Are the plans for IVB or SBR to make it available?

I am very interested in this also since I probably have to replace my old VDR in the near future and I need to know if I have to go the NVidia route because of working VDPAU support for advanced deinterlacers (although I would not like it since it's closed source) or if I can expect working advanced deinterlacers in the near future in the Intel stack. Because I would prefer to go the Intel route instead.

Thanks and best regards,

Jogi

------------------------------

Message: 3
Date: Sun, 3 Feb 2013 10:13:10 -0800
From: Ben Widawsky <[email protected]>
To: Chris Wilson <[email protected]>, Jesse Barnes
<[email protected]>, [email protected],
[email protected], [email protected]
Subject: Re: [Intel-gfx] [PATCH 00/10] [RFC v2] quick dump
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii

Quoted 20 lines · Chris Wilson
Quoted 11 lines · Jesse Barnes
Quoted 7 lines · On Sat, 2 Feb 2013 16:07:52 -0800 Ben Widawsky <[email protected]> wrote:

This is my second attempt at winning approval for the series. First one
was: https://patchwork.kernel.org/patch/1493131/

In spending the time to rework this tool, I've begun to lose my belief in some of the original motivations I had. Even if you don't want to review, but just like (or dislike) what you see, I'd appreciate such comments.

Quoted 7 lines

I'd like to see it land in i-g-t. Having the regs defined in a text or xml file is an improvement over what we have today, and is easier to extend. At first the advantage of reg_dumper was that it parsed out the bitfields of the various regs. But we didn't keep up with that, and also haven't kept up with the regs on new platforms as well as we could. Text files would make that easier, and xml files might bring back the bit field parsing, which would be extra nice.

Quoted 8 lines

Completely agree. For me the big improvement would be being able to use the bspec register names or our internal approximation thereof rather than having to loop up the actual addresses every time.

Having the name database available in python should make building integrated little snippets to parse traces which are also python accessible.
-Chris

It's really nice to get support from you. A mix of fever and staring at the same code too long can really make someone go crazy. Still, a few concerns left from me, one of which I accidentally left out of the description.

- Someone needs to give me a yes or no on the m4 extension macros. This will block any pushing.
- The build kind of sucks on Arch because of Arch's choices regarding python libraries. To build this on Arch, you must run something like:
./autogen.sh PYTHON_LDFLAGS="-L/usr/lib/python3.3 -lpython3.3m" I really don't like autogen not working out of the box. Perhaps I need to add an AC_ flag to default this tool to off? What do others think? Does it work properly on other distros? How to handle this?
- Ideally, I'd like someone to send me some fixes for valleyview definitions if they're needed. I am not sure.

Jesse, if you can send me a list of DPIO offsets to read, I'll add the appropriate patch. (It can wait until you get back).

Signature · 15 lines
Ben Widawsky, Intel Open Source Technology Center


------------------------------

Message: 4
Date: Sun, 3 Feb 2013 10:15:58 -0800
From: Ben Widawsky <[email protected]>
To: [email protected]
Cc: [email protected],
	[email protected]
Subject: Re: [Intel-gfx] [PATCH 09/10] quick_dump: Connect
	libpciaccess and	other utils
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii
Quoted 23 lines · Ben Widawsky

Make a register access library with sample to do register reads

---
 tools/quick_dump/Makefile.am     | 14 +++++++++-----
 tools/quick_dump/chipset.i       | 16 ++++++++++++++--
 tools/quick_dump/intel_chipset.c |  7 +++++++
 tools/quick_dump/quick_dump.py   |  5 ++---
 tools/quick_dump/reg_access.py   | 25 +++++++++++++++++++++++++
 5 files changed, 57 insertions(+), 10 deletions(-)
 create mode 100755 tools/quick_dump/reg_access.py
tools/quick_dump/Makefile.am +1 -1
index 6c04dd5..4711830 100644
@@ -1,14 +1,18 @@
 BUILT_SOURCES = chipset_wrap_python.c
 
-bin_SCRIPTS = quick_dump.py chipset.py
+bin_SCRIPTS = quick_dump.py chipset.py reg_access.py
 
 lib_LTLIBRARIES = I915ChipsetPython.la

tools/quick_dump/Makefile.am line 12

Quoted 10 lines
tools/quick_dump/Makefile.am +7 -3
-I915ChipsetPython_la_CFLAGS = -I$(top_srcdir)/lib $(PYTHON_CPPFLAGS)
-I915ChipsetPython_la_LDFLAGS = -module -avoid-version $(PYTHON_LDFLAGS)
-I915ChipsetPython_la_SOURCES = chipset_wrap_python.c intel_chipset.c
+I915ChipsetPython_la_CFLAGS = -I$(top_srcdir)/lib $(PYTHON_CPPFLAGS) $(CFLAGS) -I/usr/include/libdrm/
+I915ChipsetPython_la_LDFLAGS = -module -avoid-version $(PYTHON_LDFLAGS) -lpciaccess
+I915ChipsetPython_la_SOURCES = chipset_wrap_python.c intel_chipset.c \
+			       ../../lib/intel_drm.c  \
+			       ../../lib/intel_pci.c  \
+			       ../../lib/intel_reg_map.c  \
+			       ../../lib/intel_mmio.c

I should probably $(top_srcdir)/lib these sources. Fixed locally.

Quoted 107 lines
tools/quick_dump/Makefile.am +1 -1
 chipset_wrap_python.c: chipset.i
-	$(SWIG) $(AX_SWIG_PYTHON_OPT) -I$(top_srcdir)/lib -o $@ $<
+	$(SWIG) $(AX_SWIG_PYTHON_OPT) -I/usr/include -I$(top_srcdir)/lib -o $@ $<
 
 all-local: I915ChipsetPython.la
 	$(LN_S) -f .libs/I915ChipsetPython.so _chipset.so
tools/quick_dump/chipset.i +14 -2
index 16c4932..2f4f5ef 100644
@@ -1,12 +1,24 @@
-%module chipset 
+%module chipset
+%include "stdint.i"
 %{
+#include <pciaccess.h>
+#include <stdint.h>
 #include "intel_chipset.h"
 extern int is_sandybridge(unsigned short pciid);
 extern int is_ivybridge(unsigned short pciid);
 extern int is_valleyview(unsigned short pciid);
+extern struct pci_device *intel_get_pci_device();
+extern int intel_register_access_init(struct pci_device *pci_dev, int safe);
+extern uint32_t intel_register_read(uint32_t reg);
+extern void intel_register_access_fini();
+extern unsigned short pcidev_to_devid(struct pci_device *pci_dev);
 %}
 
-%include "intel_chipset.h"
 extern int is_sandybridge(unsigned short pciid);
 extern int is_ivybridge(unsigned short pciid);
 extern int is_valleyview(unsigned short pciid);
+extern struct pci_device *intel_get_pci_device();
+extern int intel_register_access_init(struct pci_device *pci_dev, int safe);
+extern uint32_t intel_register_read(uint32_t reg);
+extern void intel_register_access_fini();
+extern unsigned short pcidev_to_devid(struct pci_device *pci_dev);
tools/quick_dump/intel_chipset.c +7 -0
index b242ffc..d6e7f91 100644
@@ -1,3 +1,4 @@
+#include <pciaccess.h>
 #include "intel_chipset.h"
 
 int is_sandybridge(unsigned short pciid)
@@ -14,3 +15,9 @@ int is_valleyview(unsigned short pciid)
 {
 	return IS_VALLEYVIEW(pciid);
 }
+
+/* Simple helper because I couldn't make this work in the script */
+unsigned short pcidev_to_devid(struct pci_device *pdev)
+{
+	return pdev->device_id;
+}
tools/quick_dump/quick_dump.py +2 -3
index 59cae1f..44aa2ba 100755
@@ -32,9 +32,8 @@ if args.baseless == False:
 				parse_file(file)
 
 if args.autodetect:
-	sysfs_file = open('/sys/class/drm/card0/device/device', 'r')
-	devid_str = sysfs_file.read()
-	devid = int(devid_str, 16)
+	pci_dev = chipset.intel_get_pci_device()
+	devid = chipset.pcidev_to_devid(pci_dev)
 	if chipset.is_sandybridge(devid):
 		args.profile = open('sandybridge', 'r')
 	elif chipset.is_ivybridge(devid):
tools/quick_dump/reg_access.py new file +25 -0
new file mode 100755
index 0000000..0f63424
@@ -0,0 +1,25 @@
+#!/usr/bin/env python3
+import chipset
+
+def read(reg):
+	reg = int(reg, 16)
+	val = chipset.intel_register_read(reg)
+	return val
+
+def init():
+	pci_dev = chipset.intel_get_pci_device()
+	ret = chipset.intel_register_access_init(pci_dev, 0)
+	if ret != 0:
+		print("Register access init failed");
+		return False
+	return True
+
+if __name__ == "__main__":
+	import sys
+
+	if init() == False:
+		sys.exit()
+
+	reg = sys.argv[1]
+	print(hex(read(reg)))
+	chipset.intel_register_access_fini()
Signature · 1 line
1.8.1.2
Signature · 13 lines
Ben Widawsky, Intel Open Source Technology Center


------------------------------

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


End of Intel-gfx Digest, Vol 61, Issue 10
*****************************************