<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/gpu/drm/virtio/virtgpu_fb.c, branch v4.15-rc2</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>drm/virtio: make drm_fb_helper_funcs const</title>
<updated>2017-08-09T16:38:56+00:00</updated>
<author>
<name>Bhumika Goyal</name>
<email>bhumirks@gmail.com</email>
</author>
<published>2017-08-08T15:14:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=91b39a4e282cfd729bd8a279ec296eb6af398bec'/>
<id>91b39a4e282cfd729bd8a279ec296eb6af398bec</id>
<content type='text'>
Make these structures const as they are only passed to the function
drm_fb_helper_prepare and the corresponding argument is of type const.
Done using Coccinelle

@match disable optional_qualifier@
identifier s;
@@
static struct drm_fb_helper_funcs s = {...};

@ref@
position p;
identifier match.s;
@@
s@p

@good1@
identifier match.s;
expression e1,e2;
position ref.p;
@@
drm_fb_helper_prepare(e1,e2,&amp;s@p,...)

@bad depends on  !good1@
position ref.p;
identifier match.s;
@@
s@p

@depends on forall !bad disable optional_qualifier@
identifier match.s;
@@
static
+ const
struct drm_fb_helper_funcs s;

Signed-off-by: Bhumika Goyal &lt;bhumirks@gmail.com&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/1502205245-17365-1-git-send-email-bhumirks@gmail.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make these structures const as they are only passed to the function
drm_fb_helper_prepare and the corresponding argument is of type const.
Done using Coccinelle

@match disable optional_qualifier@
identifier s;
@@
static struct drm_fb_helper_funcs s = {...};

@ref@
position p;
identifier match.s;
@@
s@p

@good1@
identifier match.s;
expression e1,e2;
position ref.p;
@@
drm_fb_helper_prepare(e1,e2,&amp;s@p,...)

@bad depends on  !good1@
position ref.p;
identifier match.s;
@@
s@p

@depends on forall !bad disable optional_qualifier@
identifier match.s;
@@
static
+ const
struct drm_fb_helper_funcs s;

Signed-off-by: Bhumika Goyal &lt;bhumirks@gmail.com&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/1502205245-17365-1-git-send-email-bhumirks@gmail.com
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/&lt;drivers&gt;: Drop fbdev info flags</title>
<updated>2017-07-26T11:22:40+00:00</updated>
<author>
<name>Daniel Vetter</name>
<email>daniel.vetter@ffwll.ch</email>
</author>
<published>2017-07-06T12:57:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e1923ab3d01ef600dbde84ee29822980e816ee79'/>
<id>e1923ab3d01ef600dbde84ee29822980e816ee79</id>
<content type='text'>
- FBINFO_CAN_FORCE_OUTPUT has been a lie ever since we nerfed&amp;removed
  the entire panic handling code in our fbdev emulation. We might
  restore kms panic output, but not through the bazillion of legacy
  code layers called fbdev/fbcon, there's just no way to make that
  work safely.

- With the module check change FBINFO_DEFAULT is always 0, so can be
  removed too.

That removes another change to cargo-cult stuff in kms drivers, yay!

Reviewed-by: Sean Paul &lt;seanpaul@chromium.org&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20170706125735.28299-5-daniel.vetter@ffwll.ch
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- FBINFO_CAN_FORCE_OUTPUT has been a lie ever since we nerfed&amp;removed
  the entire panic handling code in our fbdev emulation. We might
  restore kms panic output, but not through the bazillion of legacy
  code layers called fbdev/fbcon, there's just no way to make that
  work safely.

- With the module check change FBINFO_DEFAULT is always 0, so can be
  removed too.

That removes another change to cargo-cult stuff in kms drivers, yay!

Reviewed-by: Sean Paul &lt;seanpaul@chromium.org&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20170706125735.28299-5-daniel.vetter@ffwll.ch
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drm: virtio: add virtio_gpu_translate_format</title>
<updated>2017-04-04T08:10:19+00:00</updated>
<author>
<name>Gerd Hoffmann</name>
<email>kraxel@redhat.com</email>
</author>
<published>2017-04-03T07:08:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d519cb76181efc78ba67e87b38286fa04d46dfa3'/>
<id>d519cb76181efc78ba67e87b38286fa04d46dfa3</id>
<content type='text'>
Factors out code, no functional change.

Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
Acked-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Tested-by: Laurent Vivier &lt;lvivier@redhat.com&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20170403070845.10793-2-kraxel@redhat.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Factors out code, no functional change.

Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
Acked-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Tested-by: Laurent Vivier &lt;lvivier@redhat.com&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20170403070845.10793-2-kraxel@redhat.com
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/fb-helper: Automatically clean up fb_info</title>
<updated>2017-02-07T20:36:28+00:00</updated>
<author>
<name>Daniel Vetter</name>
<email>daniel.vetter@ffwll.ch</email>
</author>
<published>2017-02-07T16:16:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=da7bdda2afdf1ae58546218b50771c2c646bb079'/>
<id>da7bdda2afdf1ae58546218b50771c2c646bb079</id>
<content type='text'>
Noticed that everyone duplicates the same logic here and we could safe
a few lines per driver. Yay for lots of drivers to make such tiny
refactors worth-while!

v2: Forgot to git add everything :(

v3: Actually remove release_fbi (Sean, Emil, Chris) ...

Cc: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Cc: Sean Paul &lt;seanpaul@chromium.org&gt;
Cc: Noralf Trønnes &lt;noralf@tronnes.org&gt;
Cc: Emil Velikov &lt;emil.l.velikov@gmail.com&gt;
Reviewed-by: Sean Paul &lt;seanpaul@chromium.org&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@intel.com&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20170207161603.17611-1-daniel.vetter@ffwll.ch
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Noticed that everyone duplicates the same logic here and we could safe
a few lines per driver. Yay for lots of drivers to make such tiny
refactors worth-while!

v2: Forgot to git add everything :(

v3: Actually remove release_fbi (Sean, Emil, Chris) ...

Cc: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Cc: Sean Paul &lt;seanpaul@chromium.org&gt;
Cc: Noralf Trønnes &lt;noralf@tronnes.org&gt;
Cc: Emil Velikov &lt;emil.l.velikov@gmail.com&gt;
Reviewed-by: Sean Paul &lt;seanpaul@chromium.org&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@intel.com&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20170207161603.17611-1-daniel.vetter@ffwll.ch
</pre>
</div>
</content>
</entry>
<entry>
<title>drm: Rely on mode_config data for fb_helper initialization</title>
<updated>2017-02-02T18:12:00+00:00</updated>
<author>
<name>Gabriel Krisman Bertazi</name>
<email>krisman@collabora.co.uk</email>
</author>
<published>2017-02-02T16:26:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e4563f6ba71792c77aeccb2092cc23149b44e642'/>
<id>e4563f6ba71792c77aeccb2092cc23149b44e642</id>
<content type='text'>
Instead of receiving the num_crts as a parameter, we can read it
directly from the mode_config structure.  I audited the drivers that
invoke this helper and I believe all of them initialize the mode_config
struct accordingly, prior to calling the fb_helper.

I used the following coccinelle hack to make this transformation, except
for the function headers and comment updates.  The first and second
rules are split because I couldn't find a way to remove the unused
temporary variables at the same time I removed the parameter.

// &lt;smpl&gt;
@r@
expression A,B,D,E;
identifier C;
@@
(
- drm_fb_helper_init(A,B,C,D)
+ drm_fb_helper_init(A,B,D)
|
- drm_fbdev_cma_init_with_funcs(A,B,C,D,E)
+ drm_fbdev_cma_init_with_funcs(A,B,D,E)
|
- drm_fbdev_cma_init(A,B,C,D)
+ drm_fbdev_cma_init(A,B,D)
)

@@
expression A,B,C,D,E;
@@
(
- drm_fb_helper_init(A,B,C,D)
+ drm_fb_helper_init(A,B,D)
|
- drm_fbdev_cma_init_with_funcs(A,B,C,D,E)
+ drm_fbdev_cma_init_with_funcs(A,B,D,E)
|
- drm_fbdev_cma_init(A,B,C,D)
+ drm_fbdev_cma_init(A,B,D)
)

@@
identifier r.C;
type T;
expression V;
@@
- T C;
&lt;...
when != C
- C = V;
...&gt;
// &lt;/smpl&gt;

Changes since v1:
 - Rebased on top of the tip of drm-misc-next.
 - Remove mention to sti since a proper fix got merged.

Suggested-by: Daniel Vetter &lt;daniel.vetter@intel.com&gt;
Signed-off-by: Gabriel Krisman Bertazi &lt;krisman@collabora.co.uk&gt;
Reviewed-by: Eric Anholt &lt;eric@anholt.net&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20170202162640.27261-1-krisman@collabora.co.uk
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Instead of receiving the num_crts as a parameter, we can read it
directly from the mode_config structure.  I audited the drivers that
invoke this helper and I believe all of them initialize the mode_config
struct accordingly, prior to calling the fb_helper.

I used the following coccinelle hack to make this transformation, except
for the function headers and comment updates.  The first and second
rules are split because I couldn't find a way to remove the unused
temporary variables at the same time I removed the parameter.

// &lt;smpl&gt;
@r@
expression A,B,D,E;
identifier C;
@@
(
- drm_fb_helper_init(A,B,C,D)
+ drm_fb_helper_init(A,B,D)
|
- drm_fbdev_cma_init_with_funcs(A,B,C,D,E)
+ drm_fbdev_cma_init_with_funcs(A,B,D,E)
|
- drm_fbdev_cma_init(A,B,C,D)
+ drm_fbdev_cma_init(A,B,D)
)

@@
expression A,B,C,D,E;
@@
(
- drm_fb_helper_init(A,B,C,D)
+ drm_fb_helper_init(A,B,D)
|
- drm_fbdev_cma_init_with_funcs(A,B,C,D,E)
+ drm_fbdev_cma_init_with_funcs(A,B,D,E)
|
- drm_fbdev_cma_init(A,B,C,D)
+ drm_fbdev_cma_init(A,B,D)
)

@@
identifier r.C;
type T;
expression V;
@@
- T C;
&lt;...
when != C
- C = V;
...&gt;
// &lt;/smpl&gt;

Changes since v1:
 - Rebased on top of the tip of drm-misc-next.
 - Remove mention to sti since a proper fix got merged.

Suggested-by: Daniel Vetter &lt;daniel.vetter@intel.com&gt;
Signed-off-by: Gabriel Krisman Bertazi &lt;krisman@collabora.co.uk&gt;
Reviewed-by: Eric Anholt &lt;eric@anholt.net&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20170202162640.27261-1-krisman@collabora.co.uk
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into drm-next</title>
<updated>2017-01-27T01:00:42+00:00</updated>
<author>
<name>Dave Airlie</name>
<email>airlied@redhat.com</email>
</author>
<published>2017-01-27T01:00:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b0df0b251b25b0bf89ef3e518330fcac300add86'/>
<id>b0df0b251b25b0bf89ef3e518330fcac300add86</id>
<content type='text'>
Backmerge Linus master to get the connector locking revert.

* 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux: (645 commits)
  sysctl: fix proc_doulongvec_ms_jiffies_minmax()
  Revert "drm/probe-helpers: Drop locking from poll_enable"
  MAINTAINERS: add Dan Streetman to zbud maintainers
  MAINTAINERS: add Dan Streetman to zswap maintainers
  mm: do not export ioremap_page_range symbol for external module
  mn10300: fix build error of missing fpu_save()
  romfs: use different way to generate fsid for BLOCK or MTD
  frv: add missing atomic64 operations
  mm, page_alloc: fix premature OOM when racing with cpuset mems update
  mm, page_alloc: move cpuset seqcount checking to slowpath
  mm, page_alloc: fix fast-path race with cpuset update or removal
  mm, page_alloc: fix check for NULL preferred_zone
  kernel/panic.c: add missing \n
  fbdev: color map copying bounds checking
  frv: add atomic64_add_unless()
  mm/mempolicy.c: do not put mempolicy before using its nodemask
  radix-tree: fix private list warnings
  Documentation/filesystems/proc.txt: add VmPin
  mm, memcg: do not retry precharge charges
  proc: add a schedule point in proc_pid_readdir()
  ...
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Backmerge Linus master to get the connector locking revert.

* 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux: (645 commits)
  sysctl: fix proc_doulongvec_ms_jiffies_minmax()
  Revert "drm/probe-helpers: Drop locking from poll_enable"
  MAINTAINERS: add Dan Streetman to zbud maintainers
  MAINTAINERS: add Dan Streetman to zswap maintainers
  mm: do not export ioremap_page_range symbol for external module
  mn10300: fix build error of missing fpu_save()
  romfs: use different way to generate fsid for BLOCK or MTD
  frv: add missing atomic64 operations
  mm, page_alloc: fix premature OOM when racing with cpuset mems update
  mm, page_alloc: move cpuset seqcount checking to slowpath
  mm, page_alloc: fix fast-path race with cpuset update or removal
  mm, page_alloc: fix check for NULL preferred_zone
  kernel/panic.c: add missing \n
  fbdev: color map copying bounds checking
  frv: add atomic64_add_unless()
  mm/mempolicy.c: do not put mempolicy before using its nodemask
  radix-tree: fix private list warnings
  Documentation/filesystems/proc.txt: add VmPin
  mm, memcg: do not retry precharge charges
  proc: add a schedule point in proc_pid_readdir()
  ...
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/virtio: fix framebuffer sparse warning</title>
<updated>2017-01-10T12:58:20+00:00</updated>
<author>
<name>Gerd Hoffmann</name>
<email>kraxel@redhat.com</email>
</author>
<published>2016-11-28T07:52:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=71d3f6ef7f5af38dea2975ec5715c88bae92e92d'/>
<id>71d3f6ef7f5af38dea2975ec5715c88bae92e92d</id>
<content type='text'>
virtio uses normal ram as backing storage for the framebuffer, so we
should assign the address to new screen_buffer (added by commit
17a7b0b4d9749f80d365d7baff5dec2f54b0e992) instead of screen_base.

Reported-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
virtio uses normal ram as backing storage for the framebuffer, so we
should assign the address to new screen_buffer (added by commit
17a7b0b4d9749f80d365d7baff5dec2f54b0e992) instead of screen_base.

Reported-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drm: Nuke fb-&gt;bits_per_pixel</title>
<updated>2016-12-15T12:55:34+00:00</updated>
<author>
<name>Ville Syrjälä</name>
<email>ville.syrjala@linux.intel.com</email>
</author>
<published>2016-12-14T21:32:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=272725c7db4da1fd3229d944fc76d2e98e3a144e'/>
<id>272725c7db4da1fd3229d944fc76d2e98e3a144e</id>
<content type='text'>
Replace uses of fb-&gt;bits_per_pixel with fb-&gt;format-&gt;cpp[0]*8.
Less duplicated information is a good thing.

Note that I didn't put parens around the cpp*8 in the below cocci script,
on account of not wanting spurious parens all over the place. Instead I
did the unsafe way, and tried to look over the entire diff to spot if
any dangerous expressions were produced. I didn't see any.

There are some cases where previously the code did X*bpp/8, so the
division happened after the multiplication. Those are now just X*cpp
so the division effectively happens before the multiplication,
but that is perfectly fine since bpp is always a multiple of 8.

@@
struct drm_framebuffer *FB;
expression E;
@@
 drm_helper_mode_fill_fb_struct(...) {
	...
-	FB-&gt;bits_per_pixel = E;
	...
 }

@@
struct drm_framebuffer *FB;
expression E;
@@
 i9xx_get_initial_plane_config(...) {
	...
-	FB-&gt;bits_per_pixel = E;
	...
 }

@@
struct drm_framebuffer *FB;
expression E;
@@
 ironlake_get_initial_plane_config(...) {
	...
-	FB-&gt;bits_per_pixel = E;
	...
 }

@@
struct drm_framebuffer *FB;
expression E;
@@
 skylake_get_initial_plane_config(...) {
	...
-	FB-&gt;bits_per_pixel = E;
	...
 }

@@
struct drm_framebuffer FB;
expression E;
@@
(
- E * FB.bits_per_pixel / 8
+ E * FB.format-&gt;cpp[0]
|
- FB.bits_per_pixel / 8
+ FB.format-&gt;cpp[0]
|
- E * FB.bits_per_pixel &gt;&gt; 3
+ E * FB.format-&gt;cpp[0]
|
- FB.bits_per_pixel &gt;&gt; 3
+ FB.format-&gt;cpp[0]
|
- (FB.bits_per_pixel + 7) / 8
+ FB.format-&gt;cpp[0]
|
- FB.bits_per_pixel
+ FB.format-&gt;cpp[0] * 8
|
- FB.format-&gt;cpp[0] * 8 != 8
+ FB.format-&gt;cpp[0] != 1
)

@@
struct drm_framebuffer *FB;
expression E;
@@
(
- E * FB-&gt;bits_per_pixel / 8
+ E * FB-&gt;format-&gt;cpp[0]
|
- FB-&gt;bits_per_pixel / 8
+ FB-&gt;format-&gt;cpp[0]
|
- E * FB-&gt;bits_per_pixel &gt;&gt; 3
+ E * FB-&gt;format-&gt;cpp[0]
|
- FB-&gt;bits_per_pixel &gt;&gt; 3
+ FB-&gt;format-&gt;cpp[0]
|
- (FB-&gt;bits_per_pixel + 7) / 8
+ FB-&gt;format-&gt;cpp[0]
|
- FB-&gt;bits_per_pixel
+ FB-&gt;format-&gt;cpp[0] * 8
|
- FB-&gt;format-&gt;cpp[0] * 8 != 8
+ FB-&gt;format-&gt;cpp[0] != 1
)

@@
struct drm_plane_state *state;
expression E;
@@
(
- E * state-&gt;fb-&gt;bits_per_pixel / 8
+ E * state-&gt;fb-&gt;format-&gt;cpp[0]
|
- state-&gt;fb-&gt;bits_per_pixel / 8
+ state-&gt;fb-&gt;format-&gt;cpp[0]
|
- E * state-&gt;fb-&gt;bits_per_pixel &gt;&gt; 3
+ E * state-&gt;fb-&gt;format-&gt;cpp[0]
|
- state-&gt;fb-&gt;bits_per_pixel &gt;&gt; 3
+ state-&gt;fb-&gt;format-&gt;cpp[0]
|
- (state-&gt;fb-&gt;bits_per_pixel + 7) / 8
+ state-&gt;fb-&gt;format-&gt;cpp[0]
|
- state-&gt;fb-&gt;bits_per_pixel
+ state-&gt;fb-&gt;format-&gt;cpp[0] * 8
|
- state-&gt;fb-&gt;format-&gt;cpp[0] * 8 != 8
+ state-&gt;fb-&gt;format-&gt;cpp[0] != 1
)

@@
@@
- (8 * 8)
+ 8 * 8

@@
struct drm_framebuffer FB;
@@
- (FB.format-&gt;cpp[0])
+ FB.format-&gt;cpp[0]

@@
struct drm_framebuffer *FB;
@@
- (FB-&gt;format-&gt;cpp[0])
+ FB-&gt;format-&gt;cpp[0]

@@
@@
 struct drm_framebuffer {
	 ...
-	 int bits_per_pixel;
	 ...
 };

v2: Clean up the 'cpp*8 != 8' and '(8 * 8)' cases (Laurent)
v3: Adjusted the semantic patch a bit and regenerated due to code
    changes

Signed-off-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Reviewed-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Reviewed-by: Alex Deucher &lt;alexander.deucher@amd.com&gt; (v1)
Link: http://patchwork.freedesktop.org/patch/msgid/1481751140-18352-1-git-send-email-ville.syrjala@linux.intel.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Replace uses of fb-&gt;bits_per_pixel with fb-&gt;format-&gt;cpp[0]*8.
Less duplicated information is a good thing.

Note that I didn't put parens around the cpp*8 in the below cocci script,
on account of not wanting spurious parens all over the place. Instead I
did the unsafe way, and tried to look over the entire diff to spot if
any dangerous expressions were produced. I didn't see any.

There are some cases where previously the code did X*bpp/8, so the
division happened after the multiplication. Those are now just X*cpp
so the division effectively happens before the multiplication,
but that is perfectly fine since bpp is always a multiple of 8.

@@
struct drm_framebuffer *FB;
expression E;
@@
 drm_helper_mode_fill_fb_struct(...) {
	...
-	FB-&gt;bits_per_pixel = E;
	...
 }

@@
struct drm_framebuffer *FB;
expression E;
@@
 i9xx_get_initial_plane_config(...) {
	...
-	FB-&gt;bits_per_pixel = E;
	...
 }

@@
struct drm_framebuffer *FB;
expression E;
@@
 ironlake_get_initial_plane_config(...) {
	...
-	FB-&gt;bits_per_pixel = E;
	...
 }

@@
struct drm_framebuffer *FB;
expression E;
@@
 skylake_get_initial_plane_config(...) {
	...
-	FB-&gt;bits_per_pixel = E;
	...
 }

@@
struct drm_framebuffer FB;
expression E;
@@
(
- E * FB.bits_per_pixel / 8
+ E * FB.format-&gt;cpp[0]
|
- FB.bits_per_pixel / 8
+ FB.format-&gt;cpp[0]
|
- E * FB.bits_per_pixel &gt;&gt; 3
+ E * FB.format-&gt;cpp[0]
|
- FB.bits_per_pixel &gt;&gt; 3
+ FB.format-&gt;cpp[0]
|
- (FB.bits_per_pixel + 7) / 8
+ FB.format-&gt;cpp[0]
|
- FB.bits_per_pixel
+ FB.format-&gt;cpp[0] * 8
|
- FB.format-&gt;cpp[0] * 8 != 8
+ FB.format-&gt;cpp[0] != 1
)

@@
struct drm_framebuffer *FB;
expression E;
@@
(
- E * FB-&gt;bits_per_pixel / 8
+ E * FB-&gt;format-&gt;cpp[0]
|
- FB-&gt;bits_per_pixel / 8
+ FB-&gt;format-&gt;cpp[0]
|
- E * FB-&gt;bits_per_pixel &gt;&gt; 3
+ E * FB-&gt;format-&gt;cpp[0]
|
- FB-&gt;bits_per_pixel &gt;&gt; 3
+ FB-&gt;format-&gt;cpp[0]
|
- (FB-&gt;bits_per_pixel + 7) / 8
+ FB-&gt;format-&gt;cpp[0]
|
- FB-&gt;bits_per_pixel
+ FB-&gt;format-&gt;cpp[0] * 8
|
- FB-&gt;format-&gt;cpp[0] * 8 != 8
+ FB-&gt;format-&gt;cpp[0] != 1
)

@@
struct drm_plane_state *state;
expression E;
@@
(
- E * state-&gt;fb-&gt;bits_per_pixel / 8
+ E * state-&gt;fb-&gt;format-&gt;cpp[0]
|
- state-&gt;fb-&gt;bits_per_pixel / 8
+ state-&gt;fb-&gt;format-&gt;cpp[0]
|
- E * state-&gt;fb-&gt;bits_per_pixel &gt;&gt; 3
+ E * state-&gt;fb-&gt;format-&gt;cpp[0]
|
- state-&gt;fb-&gt;bits_per_pixel &gt;&gt; 3
+ state-&gt;fb-&gt;format-&gt;cpp[0]
|
- (state-&gt;fb-&gt;bits_per_pixel + 7) / 8
+ state-&gt;fb-&gt;format-&gt;cpp[0]
|
- state-&gt;fb-&gt;bits_per_pixel
+ state-&gt;fb-&gt;format-&gt;cpp[0] * 8
|
- state-&gt;fb-&gt;format-&gt;cpp[0] * 8 != 8
+ state-&gt;fb-&gt;format-&gt;cpp[0] != 1
)

@@
@@
- (8 * 8)
+ 8 * 8

@@
struct drm_framebuffer FB;
@@
- (FB.format-&gt;cpp[0])
+ FB.format-&gt;cpp[0]

@@
struct drm_framebuffer *FB;
@@
- (FB-&gt;format-&gt;cpp[0])
+ FB-&gt;format-&gt;cpp[0]

@@
@@
 struct drm_framebuffer {
	 ...
-	 int bits_per_pixel;
	 ...
 };

v2: Clean up the 'cpp*8 != 8' and '(8 * 8)' cases (Laurent)
v3: Adjusted the semantic patch a bit and regenerated due to code
    changes

Signed-off-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Reviewed-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Reviewed-by: Alex Deucher &lt;alexander.deucher@amd.com&gt; (v1)
Link: http://patchwork.freedesktop.org/patch/msgid/1481751140-18352-1-git-send-email-ville.syrjala@linux.intel.com
</pre>
</div>
</content>
</entry>
<entry>
<title>drm: Nuke fb-&gt;depth</title>
<updated>2016-12-15T12:55:33+00:00</updated>
<author>
<name>Ville Syrjälä</name>
<email>ville.syrjala@linux.intel.com</email>
</author>
<published>2016-12-14T21:31:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b00c600e91531df00aaa551049382416c4db745d'/>
<id>b00c600e91531df00aaa551049382416c4db745d</id>
<content type='text'>
Replace uses of fb-&gt;depth with fb-&gt;format-&gt;depth. Less duplicate
information is a good thing.

@@
struct drm_framebuffer *fb;
expression E;
@@
 drm_helper_mode_fill_fb_struct(...) {
	...
-	fb-&gt;depth = E;
	...
 }

@@
struct nouveau_framebuffer *fb;
@@
- fb-&gt;base.depth
+ fb-&gt;base.format-&gt;depth

@@
struct drm_framebuffer fb;
@@
- fb.depth
+ fb.format-&gt;depth

@@
struct drm_framebuffer *fb;
@@
- fb-&gt;depth
+ fb-&gt;format-&gt;depth

@@
struct drm_framebuffer fb;
@@
- (fb.format-&gt;depth)
+ fb.format-&gt;depth

@@
struct drm_framebuffer *fb;
@@
- (fb-&gt;format-&gt;depth)
+ fb-&gt;format-&gt;depth

@@
@@
 struct drm_framebuffer {
	 ...
-	 unsigned int depth;
	 ...
 };

v2: Drop the vmw stuff (Daniel)
    Rerun spatch due to code changes

Signed-off-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Reviewed-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Reviewed-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/1481751095-18249-1-git-send-email-ville.syrjala@linux.intel.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Replace uses of fb-&gt;depth with fb-&gt;format-&gt;depth. Less duplicate
information is a good thing.

@@
struct drm_framebuffer *fb;
expression E;
@@
 drm_helper_mode_fill_fb_struct(...) {
	...
-	fb-&gt;depth = E;
	...
 }

@@
struct nouveau_framebuffer *fb;
@@
- fb-&gt;base.depth
+ fb-&gt;base.format-&gt;depth

@@
struct drm_framebuffer fb;
@@
- fb.depth
+ fb.format-&gt;depth

@@
struct drm_framebuffer *fb;
@@
- fb-&gt;depth
+ fb-&gt;format-&gt;depth

@@
struct drm_framebuffer fb;
@@
- (fb.format-&gt;depth)
+ fb.format-&gt;depth

@@
struct drm_framebuffer *fb;
@@
- (fb-&gt;format-&gt;depth)
+ fb-&gt;format-&gt;depth

@@
@@
 struct drm_framebuffer {
	 ...
-	 unsigned int depth;
	 ...
 };

v2: Drop the vmw stuff (Daniel)
    Rerun spatch due to code changes

Signed-off-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Reviewed-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Reviewed-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/1481751095-18249-1-git-send-email-ville.syrjala@linux.intel.com
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/virtio: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops</title>
<updated>2016-11-14T06:58:10+00:00</updated>
<author>
<name>Stefan Christ</name>
<email>contact@stefanchrist.eu</email>
</author>
<published>2016-11-13T23:03:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e59a03f581636999236e2b4c6d4253b6721e8e0e'/>
<id>e59a03f581636999236e2b4c6d4253b6721e8e0e</id>
<content type='text'>
This patch removes a TODO comment in the code. I do not know whether it
is still relevant.

Cc: David Airlie &lt;airlied@linux.ie&gt;
Cc: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
Signed-off-by: Stefan Christ &lt;contact@stefanchrist.eu&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/1479078208-25221-16-git-send-email-contact@stefanchrist.eu
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch removes a TODO comment in the code. I do not know whether it
is still relevant.

Cc: David Airlie &lt;airlied@linux.ie&gt;
Cc: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
Signed-off-by: Stefan Christ &lt;contact@stefanchrist.eu&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/1479078208-25221-16-git-send-email-contact@stefanchrist.eu
</pre>
</div>
</content>
</entry>
</feed>
