diff for duplicates of <1457954159.3306.24.camel@synopsys.com> diff --git a/a/1.txt b/N1/1.txt index 4596275..32d461f 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -1,23 +1,23 @@ Hi Daniel, -On Mon, 2016-03-14@08:00 +0100, Daniel Vetter wrote: -> On Fri, Mar 11, 2016@06:42:36PM +0300, Alexey Brodkin wrote: +On Mon, 2016-03-14 at 08:00 +0100, Daniel Vetter wrote: +> On Fri, Mar 11, 2016 at 06:42:36PM +0300, Alexey Brodkin wrote: > > > > ARC PGU could be found on some development boards from Synopsys. > > This is a simple byte streamer that reads data from a framebuffer > > and sends data to the single encoder. > > -> > Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com> -> > Cc: David Airlie <airlied at linux.ie> -> > Cc: dri-devel at lists.freedesktop.org -> > Cc: linux-snps-arc at lists.infradead.org -> > Cc: Jose Abreu <joabreu at synopsys.com> +> > Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> +> > Cc: David Airlie <airlied@linux.ie> +> > Cc: dri-devel@lists.freedesktop.org +> > Cc: linux-snps-arc@lists.infradead.org +> > Cc: Jose Abreu <joabreu@synopsys.com> > > --- > > > > Changes v2 -> v3: -> > ?* Improved failure path if arcpgu_connector wasn't allocated (thanks Jose). -> > ?* Fixed driver building as module (reported by 0-DAY kernel test infrastruct.) -> > ?* Implemented uncached mapping of user-space FB pages. +> > * Improved failure path if arcpgu_connector wasn't allocated (thanks Jose). +> > * Fixed driver building as module (reported by 0-DAY kernel test infrastruct.) +> > * Implemented uncached mapping of user-space FB pages. > > > > No changes v1 -> v2. > > @@ -30,13 +30,13 @@ Thanks for doing that review! > > + > > +static void arc_pgu_crtc_atomic_flush(struct drm_crtc *crtc, -> > + ??????struct drm_crtc_state *state) +> > + struct drm_crtc_state *state) > > +{ > > +} > > + > > +static bool arc_pgu_crtc_mode_fixup(struct drm_crtc *crtc, -> > + ????const struct drm_display_mode *mode, -> > + ????struct drm_display_mode *adjusted_mode) +> > + const struct drm_display_mode *mode, +> > + struct drm_display_mode *adjusted_mode) > > +{ > > + return true; > > +} @@ -61,7 +61,7 @@ Ok will do. > > +}; > > + > > +static int arc_pgu_plane_atomic_check(struct drm_plane *plane, -> > + ??????struct drm_plane_state *state) +> > + struct drm_plane_state *state) > > +{ > > + return 0; > > +} @@ -88,7 +88,7 @@ We don't support PM in that driver yet, so I'll remove both functions for now. > > +static int arcpgu_atomic_commit(struct drm_device *dev, -> > + ????struct drm_atomic_state *state, bool async) +> > + struct drm_atomic_state *state, bool async) > > +{ > > + return drm_atomic_helper_commit(dev, state, false); > Note that this isn't really async if you ever get around to implement @@ -98,7 +98,7 @@ Ok but for now should I leave it as it is? > > +static struct drm_driver arcpgu_drm_driver = { > > + .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME | -> > + ???DRIVER_ATOMIC, +> > + DRIVER_ATOMIC, > > + .preclose = arcpgu_preclose, > > + .lastclose = arcpgu_lastclose, > > + .name = "drm-arcpgu", @@ -118,7 +118,7 @@ Ok but for now should I leave it as it is? Ok I took "atmel-hlcdc" as example. And that's interesting. -If I put my?arcpgu_load() in between?drm_dev_alloc() and +If I put my arcpgu_load() in between drm_dev_alloc() and drm_dev_register() then I'm getting this on the driver probe: ---------------------------------->8------------------------------- [drm] Initialized drm 1.1.0 20060810 @@ -130,23 +130,23 @@ Modules linked in: CPU: 0 PID: 1 Comm: swapper Not tainted 4.5.0-rc3-01062-ga447822-dirty #17 Stack Trace: -? arc_unwind_core.constprop.1+0xa4/0x110 -? warn_slowpath_fmt+0x6e/0xfc -? kobject_add_internal+0x17c/0x498 -? kobject_add+0x98/0xe4 -? device_add+0xc6/0x734 -? device_create_with_groups+0x12a/0x144 -? drm_sysfs_connector_add+0x54/0xe8 -? arcpgu_drm_hdmi_init+0xd4/0x17c -? arcpgu_probe+0x138/0x24c -? platform_drv_probe+0x2e/0x6c -? really_probe+0x212/0x35c -? __driver_attach+0x90/0x94 -? bus_for_each_dev+0x46/0x80 -? bus_add_driver+0x14e/0x1b4 -? driver_register+0x64/0x108 -? do_one_initcall+0x86/0x194 -? kernel_init_freeable+0xf0/0x188 + arc_unwind_core.constprop.1+0xa4/0x110 + warn_slowpath_fmt+0x6e/0xfc + kobject_add_internal+0x17c/0x498 + kobject_add+0x98/0xe4 + device_add+0xc6/0x734 + device_create_with_groups+0x12a/0x144 + drm_sysfs_connector_add+0x54/0xe8 + arcpgu_drm_hdmi_init+0xd4/0x17c + arcpgu_probe+0x138/0x24c + platform_drv_probe+0x2e/0x6c + really_probe+0x212/0x35c + __driver_attach+0x90/0x94 + bus_for_each_dev+0x46/0x80 + bus_add_driver+0x14e/0x1b4 + driver_register+0x64/0x108 + do_one_initcall+0x86/0x194 + kernel_init_freeable+0xf0/0x188 ---[ end trace c67166ad43ddcce2 ]--- [drm:drm_sysfs_connector_add] adding "HDMI-A-1" to sysfs [drm:drm_sysfs_connector_add] *ERROR* failed to register connector device: -2 @@ -211,15 +211,15 @@ picked up by PGU and is then rendered on the display. But when user-space opens /dev/fb0 and mmaps() it deals with memory pages which are by default (at least on ARC) marked as "cached". I.e. user-space application -(I use that nice demo app?https://github.com/qtproject/qt/blob/4.8/examples/qws/framebuffer/main.c) +(I use that nice demo app https://github.com/qtproject/qt/blob/4.8/examples/qws/framebuffer/main.c) deals with frame-buffer via data cache. And that has 2 problems: -?[1] Since no explicit cache flush gets executed some data is left in data cache, -? ? ?i.e. some parts of the picture never reaches real PGU. -? ? ?See what happens on display -?http://imgur.com/iAbnnx3 -? ? ?Those missing lines are exactly those 32-byte missing cache lines. -?[2] Even if we manage to flush data somehow massive amount of data that goes -? ? ?through data cache (let's sat 1080p at 30Hz) will thrash it and as a result -? ? ?there will be no benefit for other cache users to use cache. + [1] Since no explicit cache flush gets executed some data is left in data cache, + i.e. some parts of the picture never reaches real PGU. + See what happens on display - http://imgur.com/iAbnnx3 + Those missing lines are exactly those 32-byte missing cache lines. + [2] Even if we manage to flush data somehow massive amount of data that goes + through data cache (let's sat 1080p@30Hz) will thrash it and as a result + there will be no benefit for other cache users to use cache. So we fix it simply marking pages mapped to user-space apps as uncached that effectively routes all FB data directly to memry instead of polluting cache. diff --git a/a/content_digest b/N1/content_digest index dd07cbc..41c0bfe 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -1,32 +1,36 @@ "ref\01457710959-9562-1-git-send-email-abrodkin@synopsys.com\0" "ref\01457710959-9562-2-git-send-email-abrodkin@synopsys.com\0" "ref\020160314070009.GN14170@phenom.ffwll.local\0" - "From\0Alexey.Brodkin@synopsys.com (Alexey Brodkin)\0" - "Subject\0[PATCH 1/4 v3] drm: Add support of ARC PGU display controller\0" + "From\0Alexey Brodkin <Alexey.Brodkin@synopsys.com>\0" + "Subject\0Re: [PATCH 1/4 v3] drm: Add support of ARC PGU display controller\0" "Date\0Mon, 14 Mar 2016 11:15:59 +0000\0" - "To\0linux-snps-arc@lists.infradead.org\0" + "To\0daniel@ffwll.ch <daniel@ffwll.ch>\0" + "Cc\0dri-devel@lists.freedesktop.org <dri-devel@lists.freedesktop.org>" + linux-kernel@vger.kernel.org <linux-kernel@vger.kernel.org> + Jose.Abreu@synopsys.com <Jose.Abreu@synopsys.com> + " linux-snps-arc@lists.infradead.org <linux-snps-arc@lists.infradead.org>\0" "\00:1\0" "b\0" "Hi Daniel,\n" "\n" - "On Mon, 2016-03-14@08:00 +0100, Daniel Vetter wrote:\n" - "> On Fri, Mar 11, 2016@06:42:36PM +0300, Alexey Brodkin wrote:\n" + "On Mon, 2016-03-14 at 08:00 +0100, Daniel Vetter wrote:\n" + "> On Fri, Mar 11, 2016 at 06:42:36PM +0300, Alexey Brodkin wrote:\n" "> > \n" "> > ARC PGU could be found on some development boards from Synopsys.\n" "> > This is a simple byte streamer that reads data from a framebuffer\n" "> > and sends data to the single encoder.\n" "> > \n" - "> > Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com>\n" - "> > Cc: David Airlie <airlied at linux.ie>\n" - "> > Cc: dri-devel at lists.freedesktop.org\n" - "> > Cc: linux-snps-arc at lists.infradead.org\n" - "> > Cc: Jose Abreu <joabreu at synopsys.com>\n" + "> > Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>\n" + "> > Cc: David Airlie <airlied@linux.ie>\n" + "> > Cc: dri-devel@lists.freedesktop.org\n" + "> > Cc: linux-snps-arc@lists.infradead.org\n" + "> > Cc: Jose Abreu <joabreu@synopsys.com>\n" "> > ---\n" "> > \n" "> > Changes v2 -> v3:\n" - "> > ?* Improved failure path if arcpgu_connector wasn't allocated (thanks Jose).\n" - "> > ?* Fixed driver building as module (reported by 0-DAY kernel test infrastruct.)\n" - "> > ?* Implemented uncached mapping of user-space FB pages.\n" + "> > \302\240* Improved failure path if arcpgu_connector wasn't allocated (thanks Jose).\n" + "> > \302\240* Fixed driver building as module (reported by 0-DAY kernel test infrastruct.)\n" + "> > \302\240* Implemented uncached mapping of user-space FB pages.\n" "> > \n" "> > No changes v1 -> v2.\n" "> > \n" @@ -39,13 +43,13 @@ "\n" "> > +\n" "> > +static void arc_pgu_crtc_atomic_flush(struct drm_crtc *crtc,\n" - "> > +\t\t\t\t??????struct drm_crtc_state *state)\n" + "> > +\t\t\t\t\302\240\302\240\302\240\302\240\302\240\302\240struct drm_crtc_state *state)\n" "> > +{\n" "> > +}\n" "> > +\n" "> > +static bool arc_pgu_crtc_mode_fixup(struct drm_crtc *crtc,\n" - "> > +\t\t\t\t????const struct drm_display_mode *mode,\n" - "> > +\t\t\t\t????struct drm_display_mode *adjusted_mode)\n" + "> > +\t\t\t\t\302\240\302\240\302\240\302\240const struct drm_display_mode *mode,\n" + "> > +\t\t\t\t\302\240\302\240\302\240\302\240struct drm_display_mode *adjusted_mode)\n" "> > +{\n" "> > +\treturn true;\n" "> > +}\n" @@ -70,7 +74,7 @@ "> > +};\n" "> > +\n" "> > +static int arc_pgu_plane_atomic_check(struct drm_plane *plane,\n" - "> > +\t\t\t\t??????struct drm_plane_state *state)\n" + "> > +\t\t\t\t\302\240\302\240\302\240\302\240\302\240\302\240struct drm_plane_state *state)\n" "> > +{\n" "> > +\treturn 0;\n" "> > +}\n" @@ -97,7 +101,7 @@ "for now.\n" "\n" "> > +static int arcpgu_atomic_commit(struct drm_device *dev,\n" - "> > +\t\t\t\t????struct drm_atomic_state *state, bool async)\n" + "> > +\t\t\t\t\302\240\302\240\302\240\302\240struct drm_atomic_state *state, bool async)\n" "> > +{\n" "> > +\treturn drm_atomic_helper_commit(dev, state, false);\n" "> Note that this isn't really async if you ever get around to implement\n" @@ -107,7 +111,7 @@ "\n" "> > +static struct drm_driver arcpgu_drm_driver = {\n" "> > +\t.driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME |\n" - "> > +\t\t\t???DRIVER_ATOMIC,\n" + "> > +\t\t\t\302\240\302\240\302\240DRIVER_ATOMIC,\n" "> > +\t.preclose = arcpgu_preclose,\n" "> > +\t.lastclose = arcpgu_lastclose,\n" "> > +\t.name = \"drm-arcpgu\",\n" @@ -127,7 +131,7 @@ "Ok I took \"atmel-hlcdc\" as example.\n" "And that's interesting.\n" "\n" - "If I put my?arcpgu_load() in between?drm_dev_alloc() and\n" + "If I put my\302\240arcpgu_load() in between\302\240drm_dev_alloc() and\n" "drm_dev_register() then I'm getting this on the driver probe:\n" "---------------------------------->8-------------------------------\n" "[drm] Initialized drm 1.1.0 20060810\n" @@ -139,23 +143,23 @@ "CPU: 0 PID: 1 Comm: swapper Not tainted 4.5.0-rc3-01062-ga447822-dirty #17\n" "\n" "Stack Trace:\n" - "? arc_unwind_core.constprop.1+0xa4/0x110\n" - "? warn_slowpath_fmt+0x6e/0xfc\n" - "? kobject_add_internal+0x17c/0x498\n" - "? kobject_add+0x98/0xe4\n" - "? device_add+0xc6/0x734\n" - "? device_create_with_groups+0x12a/0x144\n" - "? drm_sysfs_connector_add+0x54/0xe8\n" - "? arcpgu_drm_hdmi_init+0xd4/0x17c\n" - "? arcpgu_probe+0x138/0x24c\n" - "? platform_drv_probe+0x2e/0x6c\n" - "? really_probe+0x212/0x35c\n" - "? __driver_attach+0x90/0x94\n" - "? bus_for_each_dev+0x46/0x80\n" - "? bus_add_driver+0x14e/0x1b4\n" - "? driver_register+0x64/0x108\n" - "? do_one_initcall+0x86/0x194\n" - "? kernel_init_freeable+0xf0/0x188\n" + "\302\240 arc_unwind_core.constprop.1+0xa4/0x110\n" + "\302\240 warn_slowpath_fmt+0x6e/0xfc\n" + "\302\240 kobject_add_internal+0x17c/0x498\n" + "\302\240 kobject_add+0x98/0xe4\n" + "\302\240 device_add+0xc6/0x734\n" + "\302\240 device_create_with_groups+0x12a/0x144\n" + "\302\240 drm_sysfs_connector_add+0x54/0xe8\n" + "\302\240 arcpgu_drm_hdmi_init+0xd4/0x17c\n" + "\302\240 arcpgu_probe+0x138/0x24c\n" + "\302\240 platform_drv_probe+0x2e/0x6c\n" + "\302\240 really_probe+0x212/0x35c\n" + "\302\240 __driver_attach+0x90/0x94\n" + "\302\240 bus_for_each_dev+0x46/0x80\n" + "\302\240 bus_add_driver+0x14e/0x1b4\n" + "\302\240 driver_register+0x64/0x108\n" + "\302\240 do_one_initcall+0x86/0x194\n" + "\302\240 kernel_init_freeable+0xf0/0x188\n" "---[ end trace c67166ad43ddcce2 ]---\n" "[drm:drm_sysfs_connector_add] adding \"HDMI-A-1\" to sysfs\n" "[drm:drm_sysfs_connector_add] *ERROR* failed to register connector device: -2\n" @@ -220,15 +224,15 @@ "\n" "But when user-space opens /dev/fb0 and mmaps() it deals with memory pages which\n" "are by default (at least on ARC) marked as \"cached\". I.e. user-space application\n" - "(I use that nice demo app?https://github.com/qtproject/qt/blob/4.8/examples/qws/framebuffer/main.c)\n" + "(I use that nice demo app\302\240https://github.com/qtproject/qt/blob/4.8/examples/qws/framebuffer/main.c)\n" "deals with frame-buffer via data cache. And that has 2 problems:\n" - "?[1] Since no explicit cache flush gets executed some data is left in data cache,\n" - "? ? ?i.e. some parts of the picture never reaches real PGU.\n" - "? ? ?See what happens on display -?http://imgur.com/iAbnnx3\n" - "? ? ?Those missing lines are exactly those 32-byte missing cache lines.\n" - "?[2] Even if we manage to flush data somehow massive amount of data that goes\n" - "? ? ?through data cache (let's sat 1080p at 30Hz) will thrash it and as a result\n" - "? ? ?there will be no benefit for other cache users to use cache.\n" + "\302\240[1] Since no explicit cache flush gets executed some data is left in data cache,\n" + "\302\240 \302\240 \302\240i.e. some parts of the picture never reaches real PGU.\n" + "\302\240 \302\240 \302\240See what happens on display -\302\240http://imgur.com/iAbnnx3\n" + "\302\240 \302\240 \302\240Those missing lines are exactly those 32-byte missing cache lines.\n" + "\302\240[2] Even if we manage to flush data somehow massive amount of data that goes\n" + "\302\240 \302\240 \302\240through data cache (let's sat 1080p@30Hz) will thrash it and as a result\n" + "\302\240 \302\240 \302\240there will be no benefit for other cache users to use cache.\n" "\n" "So we fix it simply marking pages mapped to user-space apps as uncached\n" "that effectively routes all FB data directly to memry instead of polluting cache.\n" @@ -237,4 +241,4 @@ "\n" -Alexey -889c857e2099a9b4b94b86de359b56d07f9a8327b511d281613cf52a37c1b8b1 +3dd9cb454eeaeff95b1f59141fc18482dd8b4b130240cd007fe13502c2ed7861
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.