* Re: [virtio-dev] packed ring layout proposal v2
From: Amnon Ilan @ 2017-07-10 16:27 UTC (permalink / raw)
To: Michael S. Tsirkin, Lior Narkis
Cc: Cornelia Huck, Paolo Bonzini, virtio-dev, virtualization
In-Reply-To: <20170307223057-mutt-send-email-mst@kernel.org>
+Lior
----- Original Message -----
> From: "Michael S. Tsirkin" <mst@redhat.com>
> To: "Cornelia Huck" <cornelia.huck@de.ibm.com>
> Cc: "Paolo Bonzini" <pbonzini@redhat.com>, virtualization@lists.linux-foundation.org, virtio-dev@lists.oasis-open.org
> Sent: Tuesday, March 7, 2017 10:33:57 PM
> Subject: Re: [virtio-dev] packed ring layout proposal v2
>
> On Tue, Mar 07, 2017 at 04:53:53PM +0100, Cornelia Huck wrote:
> > On Wed, 22 Feb 2017 18:43:05 +0200
> > "Michael S. Tsirkin" <mst@redhat.com> wrote:
> >
> > > On Thu, Feb 09, 2017 at 05:11:05PM +0100, Cornelia Huck wrote:
> > > > > >>> * Non power-of-2 ring sizes
> > > > > >>>
> > > > > >>> As the ring simply wraps around, there's no reason to
> > > > > >>> require ring size to be power of two.
> > > > > >>> It can be made a separate feature though.
> > > > > >>
> > > > > >> Power of 2 ring sizes are required in order to ignore the high
> > > > > >> bits of
> > > > > >> the indices. With non-power-of-2 sizes you are forced to keep the
> > > > > >> indices less than the ring size.
> > > > > >
> > > > > > Right. So
> > > > > >
> > > > > > if (unlikely(idx++ > size))
> > > > > > idx = 0;
> > > > > >
> > > > > > OTOH ring size that's twice larger than necessary
> > > > > > because of power of two requirements wastes cache.
> > > > >
> > > > > I don't know. Power of 2 ring size is pretty standard, I'd rather
> > > > > avoid
> > > > > the complication and the gratuitous difference with 1.0.
> > > >
> > > > I agree. I don't think dropping the power of 2 requirement buys us so
> > > > much that it makes up for the added complexity.
> > >
> > > I recalled why I came up with this. The issue is cache associativity.
> > > Recall that besides the ring we have event suppression
> > > structures - if we are lucky and things run at the same speed
> > > everything can work by polling keeping events disabled, then
> > > event suppression structures are never written to, they are read-only.
> > >
> > > However if ring and event suppression share a cache line ring accesses
> > > have a chance to push the event suppression out of cache, causing
> > > misses on read.
> > >
> > > This can happen if they are at the same offset in the set.
> > > E.g. with L1 cache 4Kbyte sets are common, so same offset
> > > within a 4K page.
> > >
> > > We can fix this by making event suppression adjacent in memory, e.g.:
> > >
> > >
> > > [interrupt suppress]
> > > [descriptor ring]
> > > [kick suppress]
> > >
> > > If this whole structure fits in a single set, ring accesses will
> > > not push kick or interrupt suppress out of cache.
> > > Specific layout can be left for drivers, but as set size is
> > > a power of two this might require a non-power of two ring size.
> > >
> > > I conclude that this is an optimization that needs to be
> > > benchmarked.
> >
> > This makes sense. But wouldn't the optimum layout not depend on the
> > platform?
>
> There's generally a tradeoff between performance and portability.
> Whether it's worth it would need to be tested.
> Further, it might be better to have platform-specific optimization
> tied to a given platform rather than a feature bit.
>
> > >
> > > I also note that the generic description does not have to force
> > > powers of two *even if devices actually require it*.
> > > I would be inclined to word the text in a way that makes
> > > relaxing the restriction easier.
> > >
> > > For example, we can say "free running 16 bit index" and this forces a
> > > power of two, but we can also say "free running index wrapping to 0
> > > after (N*queue-size - 1) with N chosen such that the value fits in 16
> > > bit" and this is exactly the same if queue size is a power of 2.
> > >
> > > So we can add text saying "ring size MUST be a power of two"
> > > and later it will be easy to relax just by adding a feature bit.
> >
> > A later feature bit sounds good.
>
> No need to delay benchmarking if someone has the time though :)
>
> --
> MST
> _______________________________________________
> Virtualization mailing list
> Virtualization@lists.linux-foundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/virtualization
>
^ permalink raw reply
* Re: [PATCH net] virtio-net: fix leaking of ctx array
From: David Miller @ 2017-07-07 19:04 UTC (permalink / raw)
To: jasowang; +Cc: netdev, virtualization, linux-kernel, mst
In-Reply-To: <1499428569-1608-1-git-send-email-jasowang@redhat.com>
From: Jason Wang <jasowang@redhat.com>
Date: Fri, 7 Jul 2017 19:56:09 +0800
> Fixes: commit d45b897b11ea ("virtio_net: allow specifying context for rx")
> Signed-off-by: Jason Wang <jasowang@redhat.com>
Applied and queued up for -stable, thanks Jason.
^ permalink raw reply
* Call for Papers --- ICITS'18 --- Ecuador
From: Marle @ 2017-07-07 17:46 UTC (permalink / raw)
To: virtualization
[-- Attachment #1: Type: text/plain, Size: 5422 bytes --]
* Proceedings published by Springer and indexed by ISI, Scopus, EI-Compendex, DBLP, etc.
---------------------------------------------------------------------------------------------------
ICITS'18 - The 2018 International Conference on Information Technology & Systems
Peninsula de Santa Elena, Ecuador, 10 - 12 January 2018
http://www.icits.me/
-------------------------------------------------------------------------------------------------
SCOPE
ICITS'18 - The 2018 International Conference on Information Technology & Systems (http://www.icits.me/), to be held at Península de Santa Elena, Ecuador, 10 - 12 January 2018, is an international forum for researchers and practitioners to present and discuss the most recent innovations, trends, results, experiences and concerns in the several perspectives of Information Technology & Systems.
We are pleased to invite you to submit your papers to ICITS'18. They can be written in English, Spanish or Portuguese. All submissions will be reviewed on the basis of relevance, originality, importance and clarity.
TOPICS
Submitted papers should be related with one or more of the main themes proposed for the Conference:
A) Information and Knowledge Management (IKM);
B) Organizational Models and Information Systems (OMIS);
C) Software and Systems Modeling (SSM);
D) Software Systems, Architectures, Applications and Tools (SSAAT);
E) Multimedia Systems and Applications (MSA);
F) Computer Networks, Mobility and Pervasive Systems (CNMPS);
G) Intelligent and Decision Support Systems (IDSS);
H) Big Data Analytics and Applications (BDAA);
I) Human-Computer Interaction (HCI);
J) Ethics, Computers and Security (ECS)
K) Health Informatics (HIS);
L) Information Technologies in Education (ITE);
SUBMISSION AND DECISION
Submitted papers (until 10-page limit) must comply with the format of Advances in Intelligent Systems and Computing series (see Instructions for Authors at Springer Website or download a DOC example) be written in English, Spanish or Portuguese, must not have been published before, not be under review for any other conference or publication and not include any information leading to the authors identification. Therefore, the authors names, affiliations and bibliographic references should not be included in the version for evaluation by the Scientific Committee. This information should only be included in the camera-ready version, saved in Word or Latex format and also in PDF format. These files must be accompanied by the Consent to Publication form filled out, in a ZIP file, and uploaded at the conference management system.
All papers will be subjected to a double-blind review by at least two members of the Scientific Committee.
Based on Scientific Committee evaluation, a paper can be rejected or accepted by the Conference Chairs. In the later case, it can be accepted as paper or poster.
The authors of papers accepted as posters must build and print a poster to be exhibited during the Conference. This poster must follow an A1 or A2 vertical format. The Conference can includes Work Sessions where these posters are presented and orally discussed, with a 7 minute limit per poster.
The authors of accepted papers will have 15 minutes to present their work in a Conference Work Session; approximately 5 minutes of discussion will follow each presentation.
PUBLICATION AND INDEXING
To ensure that an accepted paper is published, at least one of the authors must be fully registered by the 20th of October 2017, and the paper must comply with the suggested layout and page-limit (until 10 pages). Additionally, all recommended changes must be addressed by the authors before they submit the camera-ready version.
No more than one paper per registration will be published. An extra fee must be paid for publication of additional papers, with a maximum of one additional paper per registration. One registration permits only the participation of one author in the conference.
Papers written in English and accepted and registered will be published in Proceedings by Springer, in a book of the Advances in Intelligent Systems and Computing series, will be submitted for indexation by ISI, EI-Compendex, SCOPUS and DBLP, among others, and will be available in the SpringerLink Digital Library.
Papers written in Spanish or Portuguese and accepted and registered will be published in Proceedings by AISTI and will be submitted for evaluation and possible indexation by ISI, EI-Compendex and SCOPUS.
The authors of the best selected papers will be invited to extend them for publication in international journals indexed by ISI, SCOPUS, EI-Compendex and DBLP, among others.
IMPORTANT DATES
Paper Submission: September 6, 2017
Notification of Acceptance: October 13, 2017
Payment of Registration, to ensure the inclusion of an accepted paper in the conference proceedings: October 20, 2017.
Camera-ready Submission: October 20, 2017
---------
ICITS'18 website: http://www.icits.me/
---------
----------------------------------------------
---
PS: If you do not wish to receive any more notices from ICITS just reply to this message with the word REMOVE in the subject line.
---
This email has been checked for viruses by AVG.
http://www.avg.com
[-- Attachment #2: Type: text/plain, Size: 183 bytes --]
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply
* Re: [PATCH net] virtio-net: fix leaking of ctx array
From: Michael S. Tsirkin @ 2017-07-07 15:48 UTC (permalink / raw)
To: Jason Wang; +Cc: netdev, David Miller, linux-kernel, virtualization
In-Reply-To: <1499428569-1608-1-git-send-email-jasowang@redhat.com>
On Fri, Jul 07, 2017 at 07:56:09PM +0800, Jason Wang wrote:
> Fixes: commit d45b897b11ea ("virtio_net: allow specifying context for rx")
> Signed-off-by: Jason Wang <jasowang@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Needed for stable as well.
Thanks Jason.
> ---
> drivers/net/virtio_net.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index 2e69bcd..99a26a9 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -2229,6 +2229,7 @@ static int virtnet_find_vqs(struct virtnet_info *vi)
> kfree(names);
> kfree(callbacks);
> kfree(vqs);
> + kfree(ctx);
>
> return 0;
>
> --
> 2.7.4
^ permalink raw reply
* [PATCH net] virtio-net: fix leaking of ctx array
From: Jason Wang @ 2017-07-07 11:56 UTC (permalink / raw)
To: mst, jasowang, virtualization, netdev, linux-kernel
Fixes: commit d45b897b11ea ("virtio_net: allow specifying context for rx")
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
drivers/net/virtio_net.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 2e69bcd..99a26a9 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -2229,6 +2229,7 @@ static int virtnet_find_vqs(struct virtnet_info *vi)
kfree(names);
kfree(callbacks);
kfree(vqs);
+ kfree(ctx);
return 0;
--
2.7.4
^ permalink raw reply related
* [PATCH 3/4] drm/qxl: Drop fbdev hwaccel flags
From: Daniel Vetter @ 2017-07-06 12:57 UTC (permalink / raw)
To: DRI Development
Cc: linux-fbdev, Daniel Vetter, Intel Graphics Development,
virtualization, Daniel Vetter, Dave Airlie
In-Reply-To: <20170706125735.28299-1-daniel.vetter@ffwll.ch>
It's not accelarated, just system memory. Note we don't even need to
set the default flag since that's now always 0.
Cc: Dave Airlie <airlied@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: virtualization@lists.linux-foundation.org
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
drivers/gpu/drm/qxl/qxl_fb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/qxl/qxl_fb.c b/drivers/gpu/drm/qxl/qxl_fb.c
index 573e7e9a5f98..69e7359b562a 100644
--- a/drivers/gpu/drm/qxl/qxl_fb.c
+++ b/drivers/gpu/drm/qxl/qxl_fb.c
@@ -275,7 +275,7 @@ static int qxlfb_create(struct qxl_fbdev *qfbdev,
drm_fb_helper_fill_fix(info, fb->pitches[0], fb->format->depth);
- info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_COPYAREA | FBINFO_HWACCEL_FILLRECT;
+ info->flags = FBINFO_DEFAULT;
info->fbops = &qxlfb_ops;
/*
--
2.13.2
^ permalink raw reply related
* [PATCH v4 07/14] drm: cirrus: remove dead code and pointless local lut storage
From: Peter Rosin @ 2017-07-06 12:20 UTC (permalink / raw)
To: linux-kernel
Cc: Jani Nikula, Boris Brezillon, David Airlie, dri-devel,
virtualization, Sean Paul, Daniel Vetter, Dave Airlie,
Peter Rosin
In-Reply-To: <1499343648-29695-1-git-send-email-peda@axentia.se>
The redundant fb helpers .load_lut, .gamma_set and .gamma_get are
no longer used. Remove the dead code and hook up the crtc .gamma_set
to use the crtc gamma_store directly instead of duplicating that
info locally.
Signed-off-by: Peter Rosin <peda@axentia.se>
---
drivers/gpu/drm/cirrus/cirrus_drv.h | 8 ----
drivers/gpu/drm/cirrus/cirrus_fbdev.c | 2 -
drivers/gpu/drm/cirrus/cirrus_mode.c | 71 ++++++++---------------------------
3 files changed, 16 insertions(+), 65 deletions(-)
diff --git a/drivers/gpu/drm/cirrus/cirrus_drv.h b/drivers/gpu/drm/cirrus/cirrus_drv.h
index 8690352..be2d7e48 100644
--- a/drivers/gpu/drm/cirrus/cirrus_drv.h
+++ b/drivers/gpu/drm/cirrus/cirrus_drv.h
@@ -96,7 +96,6 @@
struct cirrus_crtc {
struct drm_crtc base;
- u8 lut_r[256], lut_g[256], lut_b[256];
int last_dpms;
bool enabled;
};
@@ -180,13 +179,6 @@ cirrus_bo(struct ttm_buffer_object *bo)
#define to_cirrus_obj(x) container_of(x, struct cirrus_gem_object, base)
#define DRM_FILE_PAGE_OFFSET (0x100000000ULL >> PAGE_SHIFT)
- /* cirrus_mode.c */
-void cirrus_crtc_fb_gamma_set(struct drm_crtc *crtc, u16 red, u16 green,
- u16 blue, int regno);
-void cirrus_crtc_fb_gamma_get(struct drm_crtc *crtc, u16 *red, u16 *green,
- u16 *blue, int regno);
-
-
/* cirrus_main.c */
int cirrus_device_init(struct cirrus_device *cdev,
struct drm_device *ddev,
diff --git a/drivers/gpu/drm/cirrus/cirrus_fbdev.c b/drivers/gpu/drm/cirrus/cirrus_fbdev.c
index 7fa58ee..1fedab0 100644
--- a/drivers/gpu/drm/cirrus/cirrus_fbdev.c
+++ b/drivers/gpu/drm/cirrus/cirrus_fbdev.c
@@ -265,8 +265,6 @@ static int cirrus_fbdev_destroy(struct drm_device *dev,
}
static const struct drm_fb_helper_funcs cirrus_fb_helper_funcs = {
- .gamma_set = cirrus_crtc_fb_gamma_set,
- .gamma_get = cirrus_crtc_fb_gamma_get,
.fb_probe = cirrusfb_create,
};
diff --git a/drivers/gpu/drm/cirrus/cirrus_mode.c b/drivers/gpu/drm/cirrus/cirrus_mode.c
index 53f6f0f..a4c4a46 100644
--- a/drivers/gpu/drm/cirrus/cirrus_mode.c
+++ b/drivers/gpu/drm/cirrus/cirrus_mode.c
@@ -31,25 +31,6 @@
* This file contains setup code for the CRTC.
*/
-static void cirrus_crtc_load_lut(struct drm_crtc *crtc)
-{
- struct cirrus_crtc *cirrus_crtc = to_cirrus_crtc(crtc);
- struct drm_device *dev = crtc->dev;
- struct cirrus_device *cdev = dev->dev_private;
- int i;
-
- if (!crtc->enabled)
- return;
-
- for (i = 0; i < CIRRUS_LUT_SIZE; i++) {
- /* VGA registers */
- WREG8(PALETTE_INDEX, i);
- WREG8(PALETTE_DATA, cirrus_crtc->lut_r[i]);
- WREG8(PALETTE_DATA, cirrus_crtc->lut_g[i]);
- WREG8(PALETTE_DATA, cirrus_crtc->lut_b[i]);
- }
-}
-
/*
* The DRM core requires DPMS functions, but they make little sense in our
* case and so are just stubs
@@ -330,15 +311,25 @@ static int cirrus_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
u16 *blue, uint32_t size,
struct drm_modeset_acquire_ctx *ctx)
{
- struct cirrus_crtc *cirrus_crtc = to_cirrus_crtc(crtc);
+ struct drm_device *dev = crtc->dev;
+ struct cirrus_device *cdev = dev->dev_private;
+ u16 *r, *g, *b;
int i;
- for (i = 0; i < size; i++) {
- cirrus_crtc->lut_r[i] = red[i];
- cirrus_crtc->lut_g[i] = green[i];
- cirrus_crtc->lut_b[i] = blue[i];
+ if (!crtc->enabled)
+ return 0;
+
+ r = crtc->gamma_store;
+ g = r + crtc->gamma_size;
+ b = g + crtc->gamma_size;
+
+ for (i = 0; i < CIRRUS_LUT_SIZE; i++) {
+ /* VGA registers */
+ WREG8(PALETTE_INDEX, i);
+ WREG8(PALETTE_DATA, *r++ >> 8);
+ WREG8(PALETTE_DATA, *g++ >> 8);
+ WREG8(PALETTE_DATA, *b++ >> 8);
}
- cirrus_crtc_load_lut(crtc);
return 0;
}
@@ -365,7 +356,6 @@ static const struct drm_crtc_helper_funcs cirrus_helper_funcs = {
.mode_set_base = cirrus_crtc_mode_set_base,
.prepare = cirrus_crtc_prepare,
.commit = cirrus_crtc_commit,
- .load_lut = cirrus_crtc_load_lut,
};
/* CRTC setup */
@@ -373,7 +363,6 @@ static void cirrus_crtc_init(struct drm_device *dev)
{
struct cirrus_device *cdev = dev->dev_private;
struct cirrus_crtc *cirrus_crtc;
- int i;
cirrus_crtc = kzalloc(sizeof(struct cirrus_crtc) +
(CIRRUSFB_CONN_LIMIT * sizeof(struct drm_connector *)),
@@ -387,37 +376,9 @@ static void cirrus_crtc_init(struct drm_device *dev)
drm_mode_crtc_set_gamma_size(&cirrus_crtc->base, CIRRUS_LUT_SIZE);
cdev->mode_info.crtc = cirrus_crtc;
- for (i = 0; i < CIRRUS_LUT_SIZE; i++) {
- cirrus_crtc->lut_r[i] = i;
- cirrus_crtc->lut_g[i] = i;
- cirrus_crtc->lut_b[i] = i;
- }
-
drm_crtc_helper_add(&cirrus_crtc->base, &cirrus_helper_funcs);
}
-/** Sets the color ramps on behalf of fbcon */
-void cirrus_crtc_fb_gamma_set(struct drm_crtc *crtc, u16 red, u16 green,
- u16 blue, int regno)
-{
- struct cirrus_crtc *cirrus_crtc = to_cirrus_crtc(crtc);
-
- cirrus_crtc->lut_r[regno] = red;
- cirrus_crtc->lut_g[regno] = green;
- cirrus_crtc->lut_b[regno] = blue;
-}
-
-/** Gets the color ramps on behalf of fbcon */
-void cirrus_crtc_fb_gamma_get(struct drm_crtc *crtc, u16 *red, u16 *green,
- u16 *blue, int regno)
-{
- struct cirrus_crtc *cirrus_crtc = to_cirrus_crtc(crtc);
-
- *red = cirrus_crtc->lut_r[regno];
- *green = cirrus_crtc->lut_g[regno];
- *blue = cirrus_crtc->lut_b[regno];
-}
-
static void cirrus_encoder_mode_set(struct drm_encoder *encoder,
struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
--
2.1.4
^ permalink raw reply related
* [PATCH v4 00/14] improve the fb_setcmap helper
From: Peter Rosin @ 2017-07-06 12:20 UTC (permalink / raw)
To: linux-kernel
Cc: David Airlie, nouveau, dri-devel, virtualization, amd-gfx,
Benjamin Gaignard, Daniel Vetter, Boris Brezillon, Russell King,
Patrik Jakobsson, Ben Skeggs, Dave Airlie, intel-gfx, Jani Nikula,
Sean Paul, Vincent Abriou, Philippe Cornu, Peter Rosin,
Yannick Fertre, Alex Deucher, Christian König
Hi!
While trying to get CLUT support for the atmel_hlcdc driver, and
specifically for the emulated fbdev interface, I received some
push-back that my feeble in-driver attempts should be solved
by the core. This is my attempt to do it right.
I have obviously not tested all of this with more than a compile,
but patches 1 and 3 are enough to make the atmel-hlcdc driver
do what I need. The rest is just lots of removals and cleanup made
possible by the other improvements.
Please test, I would not be surprised if I have fouled up some
bit-manipulation somewhere, or if I have misunderstood something
about atomics...
Changes since v3:
- Rebased onto drm-misc-next and dropped patches 1-3 from v3, since
they are already merged.
- Dropped the v3 patch 4/16 ("drm/color-mgmt: move atomic state/commit
out from .gamma_set") since the atomic setcmap no longer uses
the crtc .gamma_set callback.
- Added patch 1/14 which exports drm_atomic_replace_property_blob...
- ...and patch 2/14 which uses this new export to simplify
drm_atomic_helper_legacy_gamma_set.
- Big changes to patch 3/14 (was 5/16 in v3). It had various locking
issues and the atomic setcmap is rather different.
Changes since v2:
- Added patch 1/16 which factors out pseudo-palette handling.
- Removed the if (cmap->start + cmap->len < cmap->start)
sanity check on the assumption that the fbdev core handles it.
- Added patch 4/16 which factors out atomic state and commit
handling from drm_atomic_helper_legacy_gamma_set to
drm_mode_gamma_set_ioctl.
- Do one atomic commit for all affected crtc.
- Removed a now obsolete note in include/drm/drm_crtc.h (ammended
the last patch).
- Cc list is getting long, so I have redused the list for the
individual patches. If you would like to get the full series
(or nothing at all) for the next round (if that is needed) just
say so.
Changes since v1:
- Rebased to next-20170621
- Split 1/11 into a preparatory patch, a cleanup patch and then
the meat in 3/14.
- Handle pseudo-palette for FB_VISUAL_TRUECOLOR.
- Removed the empty .gamma_get/.gamma_set fb helpers from the
armada driver that I had somehow managed to ignore but which
0day found real quick.
- Be less judgemental on drivers only providing .gamma_get and
.gamma_set, but no .load_lut. That's actually a valid thing
to do if you only need pseudo-palette for FB_VISUAL_TRUECOLOR.
- Add a comment about colliding bitfields in the nouveau driver.
- Remove gamma_set/gamma_get declarations from the radeon driver
(the definitions were removed in v1).
Cheers,
peda
Peter Rosin (14):
drm/atomic: export drm_atomic_replace_property_blob
drm/atomic-helper: update lut props directly in ..._legacy_gamma_set
drm/fb-helper: separate the fb_setcmap helper into atomic and legacy
paths
drm: amd: remove dead code and pointless local lut storage
drm: armada: remove dead empty functions
drm: ast: remove dead code and pointless local lut storage
drm: cirrus: remove dead code and pointless local lut storage
drm: gma500: remove dead code and pointless local lut storage
drm: i915: remove dead code and pointless local lut storage
drm: mgag200: remove dead code and pointless local lut storage
drm: nouveau: remove dead code and pointless local lut storage
drm: radeon: remove dead code and pointless local lut storage
drm: stm: remove dead code and pointless local lut storage
drm: remove unused and redundant callbacks
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c | 24 ---
drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h | 1 -
drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 27 +---
drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 27 +---
drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 27 +---
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 27 +---
drivers/gpu/drm/amd/amdgpu/dce_virtual.c | 23 ---
drivers/gpu/drm/armada/armada_crtc.c | 10 --
drivers/gpu/drm/armada/armada_crtc.h | 2 -
drivers/gpu/drm/armada/armada_fbdev.c | 2 -
drivers/gpu/drm/ast/ast_drv.h | 1 -
drivers/gpu/drm/ast/ast_fb.c | 20 ---
drivers/gpu/drm/ast/ast_mode.c | 26 +---
drivers/gpu/drm/cirrus/cirrus_drv.h | 8 -
drivers/gpu/drm/cirrus/cirrus_fbdev.c | 2 -
drivers/gpu/drm/cirrus/cirrus_mode.c | 71 ++-------
drivers/gpu/drm/drm_atomic.c | 17 +-
drivers/gpu/drm/drm_atomic_helper.c | 23 +--
drivers/gpu/drm/drm_fb_helper.c | 232 +++++++++++++++++++---------
drivers/gpu/drm/gma500/framebuffer.c | 22 ---
drivers/gpu/drm/gma500/gma_display.c | 32 ++--
drivers/gpu/drm/gma500/psb_intel_display.c | 7 +-
drivers/gpu/drm/gma500/psb_intel_drv.h | 1 -
drivers/gpu/drm/i915/intel_drv.h | 1 -
drivers/gpu/drm/i915/intel_fbdev.c | 31 ----
drivers/gpu/drm/mgag200/mgag200_drv.h | 5 -
drivers/gpu/drm/mgag200/mgag200_fb.c | 2 -
drivers/gpu/drm/mgag200/mgag200_mode.c | 62 ++------
drivers/gpu/drm/nouveau/dispnv04/crtc.c | 26 ++--
drivers/gpu/drm/nouveau/nouveau_crtc.h | 3 -
drivers/gpu/drm/nouveau/nouveau_fbcon.c | 22 ---
drivers/gpu/drm/nouveau/nv50_display.c | 40 ++---
drivers/gpu/drm/radeon/atombios_crtc.c | 1 -
drivers/gpu/drm/radeon/radeon_connectors.c | 7 +-
drivers/gpu/drm/radeon/radeon_display.c | 71 ++++-----
drivers/gpu/drm/radeon/radeon_fb.c | 2 -
drivers/gpu/drm/radeon/radeon_legacy_crtc.c | 1 -
drivers/gpu/drm/radeon/radeon_mode.h | 4 -
drivers/gpu/drm/stm/ltdc.c | 12 --
drivers/gpu/drm/stm/ltdc.h | 1 -
include/drm/drm_atomic.h | 4 +
include/drm/drm_crtc.h | 8 -
include/drm/drm_fb_helper.h | 32 ----
include/drm/drm_modeset_helper_vtables.h | 16 --
44 files changed, 314 insertions(+), 669 deletions(-)
--
2.1.4
^ permalink raw reply
* Re: [PATCH net] virtio-net: unbreak cusmed packet for small buffer XDP
From: Michael S. Tsirkin @ 2017-07-06 0:07 UTC (permalink / raw)
To: Jason Wang; +Cc: netdev, linux-kernel, virtualization
In-Reply-To: <4de0c8e7-a9b6-7477-691a-a2ed0f317106@redhat.com>
On Tue, Jul 04, 2017 at 08:20:00PM +0800, Jason Wang wrote:
> > IIUC XDP generally refuses to attach if checksum offload
> > is enabled.
>
> Any reason to do this? (Looks like I don't see any code for this)
Some of it was covered here
https://www.mail-archive.com/netdev@vger.kernel.org/msg162577.html
--
MST
^ permalink raw reply
* Re: [Intel-gfx] [PATCH v3 00/16] improve the fb_setcmap helper
From: Daniel Vetter @ 2017-07-05 20:19 UTC (permalink / raw)
To: Peter Rosin
Cc: David Airlie, nouveau, dri-devel, virtualization,
Benjamin Gaignard, Daniel Vetter, Boris Brezillon,
Thomas Hellstrom, Sinclair Yeh, Russell King, amd-gfx,
VMware Graphics, Ben Skeggs, Dave Airlie, intel-gfx,
Vincent Abriou, Philippe Cornu, linux-kernel, Yannick Fertre,
Alex Deucher, Christian König
In-Reply-To: <3810fb8e-76d6-0810-26aa-1aae6bac2f9a@axentia.se>
On Wed, Jul 05, 2017 at 10:09:21AM +0200, Peter Rosin wrote:
> On 2017-07-05 08:08, Daniel Vetter wrote:
> > On Tue, Jul 04, 2017 at 12:36:56PM +0200, Peter Rosin wrote:
> >> Hi!
> >>
> >> While trying to get CLUT support for the atmel_hlcdc driver, and
> >> specifically for the emulated fbdev interface, I received some
> >> push-back that my feeble in-driver attempts should be solved
> >> by the core. This is my attempt to do it right.
> >>
> >> I have obviously not tested all of this with more than a compile,
> >> but patches 1 through 5 are enough to make the atmel-hlcdc driver
> >> do what I need. The rest is just lots of removals and cleanup made
> >> possible by the improved core.
> >>
> >> Please test, I would not be surprised if I have fouled up some
> >> bit-manipulation somewhere, or if I have misunderstood something
> >> about atomics...
> >>
> >> Changes since v2:
> >> - Added patch 1/16 which factors out pseudo-palette handling.
> >> - Removed the if (cmap->start + cmap->len < cmap->start)
> >> sanity check on the assumption that the fbdev core handles it.
> >> - Added patch 4/16 which factors out atomic state and commit
> >> handling from drm_atomic_helper_legacy_gamma_set to
> >> drm_mode_gamma_set_ioctl.
> >> - Do one atomic commit for all affected crtc.
> >> - Removed a now obsolete note in include/drm/drm_crtc.h (ammended
> >> the last patch).
> >> - Cc list is getting long, so I have redused the list for the
> >> individual patches. If you would like to get the full series
> >> (or nothing at all) for the next round (if that is needed) just
> >> say so.
> >
> > Is this still on top of my locking rework? I tried to apply patches 1-3,
> > but there's minor conflicts ...
> > -Daniel
>
> v3 has the same base as v2. I collected your locking rework sometime
> after june 21, you have perhaps changed things since? I saw an update
> of that dpms patch you Cc me, but figured there were no significant
> changes that I needed to handle since I didn't get the full set
> this time either. A bad assumption it seems...
There's a difference between my own private patches, and the maintainer
repo where stuff gets applied. But that explains why there was a conflict.
I plan to merge my locking changes tomorrow (they're reviewed and ready
now), I'll apply your patches after that. That should take care of the
conflicts.
Thanks, Daniel
>
> Anyway, the base I have for v3 (and v2) is linux next-20170621 plus
> the following locking rework commits (in reverse order):
>
> Author: Thierry Reding <treding@nvidia.com>
> Date: Wed Jun 21 20:28:15 2017 +0200
> Subject: drm/hisilicon: Remove custom FB helper deferred setup
>
> Author: Thierry Reding <treding@nvidia.com>
> Date: Wed Jun 21 20:28:14 2017 +0200
> Subject: drm/exynos: Remove custom FB helper deferred setup
>
> Author: Thierry Reding <treding@nvidia.com>
> Date: Wed Jun 21 20:28:13 2017 +0200
> Subject: drm/fb-helper: Support deferred setup
>
> Author: Daniel Vetter <daniel.vetter@ffwll.ch>
> Date: Wed Jun 21 20:28:12 2017 +0200
> Subject: drm/fb-helper: Split dpms handling into legacy and atomic paths
>
> Author: Daniel Vetter <daniel.vetter@ffwll.ch>
> Date: Wed Jun 21 20:28:11 2017 +0200
> Subject: drm/fb-helper: Stop using mode_config.mutex for internals
>
> Author: Daniel Vetter <daniel.vetter@ffwll.ch>
> Date: Wed Jun 21 20:28:10 2017 +0200
> Subject: drm/fb-helper: Push locking into restore_fbdev_mode_atomic|legacy
>
> Author: Daniel Vetter <daniel.vetter@ffwll.ch>
> Date: Wed Jun 21 20:28:09 2017 +0200
> Subject: drm/fb-helper: Push locking into pan_display_atomic|legacy
>
> Author: Daniel Vetter <daniel.vetter@ffwll.ch>
> Date: Wed Jun 21 20:28:08 2017 +0200
> Subject: drm/fb-helper: Drop locking from the vsync wait ioctl code
>
> Author: Daniel Vetter <daniel.vetter@ffwll.ch>
> Date: Wed Jun 21 20:28:07 2017 +0200
> Subject: drm/fb-helper: Push locking in fb_is_bound
>
> Author: Thierry Reding <treding@nvidia.com>
> Date: Wed Jun 21 20:28:06 2017 +0200
> Subject: drm/fb-helper: Add top-level lock
>
> Author: Daniel Vetter <daniel.vetter@ffwll.ch>
> Date: Wed Jun 21 20:28:05 2017 +0200
> Subject: drm/i915: Drop FBDEV #ifdev in mst code
>
> Author: Thierry Reding <treding@nvidia.com>
> Date: Wed Jun 21 20:28:04 2017 +0200
> Subject: drm/fb-helper: Push down modeset lock into FB helpers
>
> Cheers,
> peda
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
^ permalink raw reply
* Re: [PATCH v2] virtio-blk: add DISCARD support to virtio-blk driver
From: Michael S. Tsirkin @ 2017-07-05 12:56 UTC (permalink / raw)
To: Liu, Changpeng
Cc: Paolo Bonzini, hch@lst.de,
virtualization@lists.linux-foundation.org
In-Reply-To: <FF7FC980937D6342B9D289F5F3C7C2625B595B29@SHSMSX103.ccr.corp.intel.com>
On Wed, Jul 05, 2017 at 07:57:07AM +0000, Liu, Changpeng wrote:
>
>
> > -----Original Message-----
> > From: Paolo Bonzini [mailto:pbonzini@redhat.com]
> > Sent: Tuesday, July 4, 2017 5:24 PM
> > To: Liu, Changpeng <changpeng.liu@intel.com>; virtualization@lists.linux-
> > foundation.org
> > Cc: stefanha@gmail.com; hch@lst.de; mst@redhat.com
> > Subject: Re: [PATCH v2] virtio-blk: add DISCARD support to virtio-blk driver
> >
> >
> >
> > On 05/07/2017 10:44, Changpeng Liu wrote:
> > > Currently virtio-blk driver does not provide discard feature flag, so the
> > > filesystems which built on top of the block device will not send discard
> > > command. This is okay for HDD backend, but it will impact the performance
> > > for SSD backend.
> > >
> > > Add a feature flag VIRTIO_BLK_F_DISCARD and command
> > VIRTIO_BLK_T_DISCARD
> > > to extend exist virtio-blk protocol, define 16 bytes discard descriptor
> > > for each discard segment, the discard segment defination aligns with
> > > SCSI or NVM Express protocols, virtio-blk driver will support multi-range
> > > discard request as well.
> > >
> > > Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
> >
> > Please include a patch for the specification. Since we are at it, I
> Thanks Paolo, do you mean include a text file which describe the changes for the specification?
Paolo answered that. But please also CC code patch to virtio-comment@lists.oasis-open.org
.
This is a subscriber-only list so pls subscribe beforehand:
https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=virtio#feedback
--
MST
^ permalink raw reply
* Re: [Intel-gfx] [PATCH v3 00/16] improve the fb_setcmap helper
From: Peter Rosin @ 2017-07-05 8:09 UTC (permalink / raw)
To: linux-kernel, David Airlie, nouveau, dri-devel, virtualization,
Gerd Hoffmann, Benjamin Gaignard, Daniel Vetter, Boris Brezillon,
Thomas Hellstrom, Sinclair Yeh, Russell King, VMware Graphics,
Ben Skeggs, Dave Airlie, intel-gfx, Vincent Abriou, amd-gfx,
Philippe Cornu, Yannick Fertre, Alex Deucher,
Christian König
In-Reply-To: <20170705060816.nwufo2m7cmthjopn@phenom.ffwll.local>
On 2017-07-05 08:08, Daniel Vetter wrote:
> On Tue, Jul 04, 2017 at 12:36:56PM +0200, Peter Rosin wrote:
>> Hi!
>>
>> While trying to get CLUT support for the atmel_hlcdc driver, and
>> specifically for the emulated fbdev interface, I received some
>> push-back that my feeble in-driver attempts should be solved
>> by the core. This is my attempt to do it right.
>>
>> I have obviously not tested all of this with more than a compile,
>> but patches 1 through 5 are enough to make the atmel-hlcdc driver
>> do what I need. The rest is just lots of removals and cleanup made
>> possible by the improved core.
>>
>> Please test, I would not be surprised if I have fouled up some
>> bit-manipulation somewhere, or if I have misunderstood something
>> about atomics...
>>
>> Changes since v2:
>> - Added patch 1/16 which factors out pseudo-palette handling.
>> - Removed the if (cmap->start + cmap->len < cmap->start)
>> sanity check on the assumption that the fbdev core handles it.
>> - Added patch 4/16 which factors out atomic state and commit
>> handling from drm_atomic_helper_legacy_gamma_set to
>> drm_mode_gamma_set_ioctl.
>> - Do one atomic commit for all affected crtc.
>> - Removed a now obsolete note in include/drm/drm_crtc.h (ammended
>> the last patch).
>> - Cc list is getting long, so I have redused the list for the
>> individual patches. If you would like to get the full series
>> (or nothing at all) for the next round (if that is needed) just
>> say so.
>
> Is this still on top of my locking rework? I tried to apply patches 1-3,
> but there's minor conflicts ...
> -Daniel
v3 has the same base as v2. I collected your locking rework sometime
after june 21, you have perhaps changed things since? I saw an update
of that dpms patch you Cc me, but figured there were no significant
changes that I needed to handle since I didn't get the full set
this time either. A bad assumption it seems...
Anyway, the base I have for v3 (and v2) is linux next-20170621 plus
the following locking rework commits (in reverse order):
Author: Thierry Reding <treding@nvidia.com>
Date: Wed Jun 21 20:28:15 2017 +0200
Subject: drm/hisilicon: Remove custom FB helper deferred setup
Author: Thierry Reding <treding@nvidia.com>
Date: Wed Jun 21 20:28:14 2017 +0200
Subject: drm/exynos: Remove custom FB helper deferred setup
Author: Thierry Reding <treding@nvidia.com>
Date: Wed Jun 21 20:28:13 2017 +0200
Subject: drm/fb-helper: Support deferred setup
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date: Wed Jun 21 20:28:12 2017 +0200
Subject: drm/fb-helper: Split dpms handling into legacy and atomic paths
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date: Wed Jun 21 20:28:11 2017 +0200
Subject: drm/fb-helper: Stop using mode_config.mutex for internals
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date: Wed Jun 21 20:28:10 2017 +0200
Subject: drm/fb-helper: Push locking into restore_fbdev_mode_atomic|legacy
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date: Wed Jun 21 20:28:09 2017 +0200
Subject: drm/fb-helper: Push locking into pan_display_atomic|legacy
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date: Wed Jun 21 20:28:08 2017 +0200
Subject: drm/fb-helper: Drop locking from the vsync wait ioctl code
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date: Wed Jun 21 20:28:07 2017 +0200
Subject: drm/fb-helper: Push locking in fb_is_bound
Author: Thierry Reding <treding@nvidia.com>
Date: Wed Jun 21 20:28:06 2017 +0200
Subject: drm/fb-helper: Add top-level lock
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date: Wed Jun 21 20:28:05 2017 +0200
Subject: drm/i915: Drop FBDEV #ifdev in mst code
Author: Thierry Reding <treding@nvidia.com>
Date: Wed Jun 21 20:28:04 2017 +0200
Subject: drm/fb-helper: Push down modeset lock into FB helpers
Cheers,
peda
^ permalink raw reply
* Re: [PATCH v2] virtio-blk: add DISCARD support to virtio-blk driver
From: Paolo Bonzini @ 2017-07-05 8:00 UTC (permalink / raw)
To: Liu, Changpeng, virtualization@lists.linux-foundation.org
Cc: hch@lst.de, mst@redhat.com
In-Reply-To: <FF7FC980937D6342B9D289F5F3C7C2625B595B29@SHSMSX103.ccr.corp.intel.com>
On 05/07/2017 09:57, Liu, Changpeng wrote:
>> Please include a patch for the specification. Since we are at it, I
> Thanks Paolo, do you mean include a text file which describe the changes for the specification?
The specification is hosted in an svn (Subversion) repository at
https://tools.oasis-open.org/version-control/svn/virtio. You can
provide a patch and send it to virtio-comment@lists.oasis-open.org.
Thanks,
Paolo
>> would like to have three operations defined using the same descriptor:
>>
>> - discard (SCSI UNMAP)
>>
>> - write zeroes (SCSI WRITE SAME without UNMAP flag)
>>
>> - write zeroes and possibly discard (SCSI WRITE SAME with UNMAP flag)
>>
>> The last two can use the same command VIRTIO_BLK_T_WRITE_ZEROES, using
>> the reserved field as a flags field.
>
> Will add write zeroes feature.
^ permalink raw reply
* RE: [PATCH v2] virtio-blk: add DISCARD support to virtio-blk driver
From: Liu, Changpeng @ 2017-07-05 7:57 UTC (permalink / raw)
To: Paolo Bonzini, virtualization@lists.linux-foundation.org
Cc: hch@lst.de, mst@redhat.com
In-Reply-To: <01542f21-6fa3-c406-65e1-a37d04130fb7@redhat.com>
> -----Original Message-----
> From: Paolo Bonzini [mailto:pbonzini@redhat.com]
> Sent: Tuesday, July 4, 2017 5:24 PM
> To: Liu, Changpeng <changpeng.liu@intel.com>; virtualization@lists.linux-
> foundation.org
> Cc: stefanha@gmail.com; hch@lst.de; mst@redhat.com
> Subject: Re: [PATCH v2] virtio-blk: add DISCARD support to virtio-blk driver
>
>
>
> On 05/07/2017 10:44, Changpeng Liu wrote:
> > Currently virtio-blk driver does not provide discard feature flag, so the
> > filesystems which built on top of the block device will not send discard
> > command. This is okay for HDD backend, but it will impact the performance
> > for SSD backend.
> >
> > Add a feature flag VIRTIO_BLK_F_DISCARD and command
> VIRTIO_BLK_T_DISCARD
> > to extend exist virtio-blk protocol, define 16 bytes discard descriptor
> > for each discard segment, the discard segment defination aligns with
> > SCSI or NVM Express protocols, virtio-blk driver will support multi-range
> > discard request as well.
> >
> > Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
>
> Please include a patch for the specification. Since we are at it, I
Thanks Paolo, do you mean include a text file which describe the changes for the specification?
> would like to have three operations defined using the same descriptor:
>
> - discard (SCSI UNMAP)
>
> - write zeroes (SCSI WRITE SAME without UNMAP flag)
>
> - write zeroes and possibly discard (SCSI WRITE SAME with UNMAP flag)
>
> The last two can use the same command VIRTIO_BLK_T_WRITE_ZEROES, using
> the reserved field as a flags field.
Will add write zeroes feature.
>
> Paolo
>
> > ---
> > drivers/block/virtio_blk.c | 76
> +++++++++++++++++++++++++++++++++++++++--
> > include/uapi/linux/virtio_blk.h | 19 +++++++++++
> > 2 files changed, 92 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
> > index 0297ad7..8f0c614 100644
> > --- a/drivers/block/virtio_blk.c
> > +++ b/drivers/block/virtio_blk.c
> > @@ -172,10 +172,52 @@ static int virtblk_add_req(struct virtqueue *vq, struct
> virtblk_req *vbr,
> > return virtqueue_add_sgs(vq, sgs, num_out, num_in, vbr, GFP_ATOMIC);
> > }
> >
> > +static inline int virtblk_setup_discard(struct request *req)
> > +{
> > + unsigned short segments = blk_rq_nr_discard_segments(req), n = 0;
> > + u32 block_size = queue_logical_block_size(req->q);
> > + struct virtio_blk_discard *range;
> > + struct bio *bio;
> > +
> > + if (block_size < 512 || !block_size)
> > + return -1;
> > +
> > + range = kmalloc_array(segments, sizeof(*range), GFP_ATOMIC);
> > + if (!range)
> > + return -1;
> > +
> > + __rq_for_each_bio(bio, req) {
> > + u64 slba = (bio->bi_iter.bi_sector << 9) / block_size;
> > + u32 nlb = bio->bi_iter.bi_size / block_size;
> > +
> > + range[n].reserved = cpu_to_le32(0);
> > + range[n].nlba = cpu_to_le32(nlb);
> > + range[n].slba = cpu_to_le64(slba);
> > + n++;
> > + }
> > +
> > + if (WARN_ON_ONCE(n != segments)) {
> > + kfree(range);
> > + return -1;
> > + }
> > +
> > + req->special_vec.bv_page = virt_to_page(range);
> > + req->special_vec.bv_offset = offset_in_page(range);
> > + req->special_vec.bv_len = sizeof(*range) * segments;
> > + req->rq_flags |= RQF_SPECIAL_PAYLOAD;
> > +
> > + return 0;
> > +}
> > +
> > static inline void virtblk_request_done(struct request *req)
> > {
> > struct virtblk_req *vbr = blk_mq_rq_to_pdu(req);
> >
> > + if (req->rq_flags & RQF_SPECIAL_PAYLOAD) {
> > + kfree(page_address(req->special_vec.bv_page) +
> > + req->special_vec.bv_offset);
> > + }
> > +
> > switch (req_op(req)) {
> > case REQ_OP_SCSI_IN:
> > case REQ_OP_SCSI_OUT:
> > @@ -237,6 +279,9 @@ static blk_status_t virtio_queue_rq(struct
> blk_mq_hw_ctx *hctx,
> > case REQ_OP_FLUSH:
> > type = VIRTIO_BLK_T_FLUSH;
> > break;
> > + case REQ_OP_DISCARD:
> > + type = VIRTIO_BLK_T_DISCARD;
> > + break;
> > case REQ_OP_SCSI_IN:
> > case REQ_OP_SCSI_OUT:
> > type = VIRTIO_BLK_T_SCSI_CMD;
> > @@ -256,9 +301,15 @@ static blk_status_t virtio_queue_rq(struct
> blk_mq_hw_ctx *hctx,
> >
> > blk_mq_start_request(req);
> >
> > + if (type == VIRTIO_BLK_T_DISCARD) {
> > + err = virtblk_setup_discard(req);
> > + if (err)
> > + return BLK_STS_IOERR;
> > + }
> > +
> > num = blk_rq_map_sg(hctx->queue, req, vbr->sg);
> > if (num) {
> > - if (rq_data_dir(req) == WRITE)
> > + if (rq_data_dir(req) == WRITE || type == VIRTIO_BLK_T_DISCARD)
> > vbr->out_hdr.type |= cpu_to_virtio32(vblk->vdev,
> VIRTIO_BLK_T_OUT);
> > else
> > vbr->out_hdr.type |= cpu_to_virtio32(vblk->vdev,
> VIRTIO_BLK_T_IN);
> > @@ -767,6 +818,25 @@ static int virtblk_probe(struct virtio_device *vdev)
> > if (!err && opt_io_size)
> > blk_queue_io_opt(q, blk_size * opt_io_size);
> >
> > + if (virtio_has_feature(vdev, VIRTIO_BLK_F_DISCARD)) {
> > + q->limits.discard_alignment = blk_size;
> > + q->limits.discard_granularity = blk_size;
> > +
> > + virtio_cread(vdev, struct virtio_blk_config, max_discard_seg, &v);
> > + if (v)
> > + blk_queue_max_discard_sectors(q, v);
> > + else
> > + blk_queue_max_discard_sectors(q, -1U);
> > +
> > + virtio_cread(vdev, struct virtio_blk_config, max_discard_num, &v);
> > + if (v)
> > + blk_queue_max_discard_segments(q, v);
> > + else
> > + blk_queue_max_discard_segments(q, 256);
> > +
> > + queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, q);
> > + }
> > +
> > virtio_device_ready(vdev);
> >
> > device_add_disk(&vdev->dev, vblk->disk);
> > @@ -874,14 +944,14 @@ static int virtblk_restore(struct virtio_device *vdev)
> > VIRTIO_BLK_F_SCSI,
> > #endif
> > VIRTIO_BLK_F_FLUSH, VIRTIO_BLK_F_TOPOLOGY,
> VIRTIO_BLK_F_CONFIG_WCE,
> > - VIRTIO_BLK_F_MQ,
> > + VIRTIO_BLK_F_MQ, VIRTIO_BLK_F_DISCARD,
> > }
> > ;
> > static unsigned int features[] = {
> > VIRTIO_BLK_F_SEG_MAX, VIRTIO_BLK_F_SIZE_MAX,
> VIRTIO_BLK_F_GEOMETRY,
> > VIRTIO_BLK_F_RO, VIRTIO_BLK_F_BLK_SIZE,
> > VIRTIO_BLK_F_FLUSH, VIRTIO_BLK_F_TOPOLOGY,
> VIRTIO_BLK_F_CONFIG_WCE,
> > - VIRTIO_BLK_F_MQ,
> > + VIRTIO_BLK_F_MQ, VIRTIO_BLK_F_DISCARD,
> > };
> >
> > static struct virtio_driver virtio_blk = {
> > diff --git a/include/uapi/linux/virtio_blk.h b/include/uapi/linux/virtio_blk.h
> > index 9ebe4d9..3354cc3 100644
> > --- a/include/uapi/linux/virtio_blk.h
> > +++ b/include/uapi/linux/virtio_blk.h
> > @@ -38,6 +38,7 @@
> > #define VIRTIO_BLK_F_BLK_SIZE 6 /* Block size of disk is available*/
> > #define VIRTIO_BLK_F_TOPOLOGY 10 /* Topology information is
> available */
> > #define VIRTIO_BLK_F_MQ 12 /* support more than one vq */
> > +#define VIRTIO_BLK_F_DISCARD 13 /* DISCARD command is
> supported */
> >
> > /* Legacy feature bits */
> > #ifndef VIRTIO_BLK_NO_LEGACY
> > @@ -86,6 +87,10 @@ struct virtio_blk_config {
> >
> > /* number of vqs, only available when VIRTIO_BLK_F_MQ is set */
> > __u16 num_queues;
> > + /* The maximum segment size (if VIRTIO_BLK_F_DISCARD) */
> > + __u32 max_discard_seg;
> > + /* The maximum number of segments (if VIRTIO_BLK_F_DISCARD) */
> > + __u32 max_discard_num;
> > } __attribute__((packed));
> >
> > /*
> > @@ -114,6 +119,9 @@ struct virtio_blk_config {
> > /* Get device ID command */
> > #define VIRTIO_BLK_T_GET_ID 8
> >
> > +/* Discard command */
> > +#define VIRTIO_BLK_T_DISCARD 16
> > +
> > #ifndef VIRTIO_BLK_NO_LEGACY
> > /* Barrier before this op. */
> > #define VIRTIO_BLK_T_BARRIER 0x80000000
> > @@ -133,6 +141,17 @@ struct virtio_blk_outhdr {
> > __virtio64 sector;
> > };
> >
> > +/*
> > + * Array of discard ranges for each request.
> > + */
> > +struct virtio_blk_discard {
> > + /* start discard lba */
> > + __virtio64 slba;
> > + /* number of discard sectors */
> > + __virtio32 nlba;
> > + __virtio32 reserved;
> > +};
> > +
> > #ifndef VIRTIO_BLK_NO_LEGACY
> > struct virtio_scsi_inhdr {
> > __virtio32 errors;
> >
^ permalink raw reply
* Re: [Intel-gfx] [PATCH v3 00/16] improve the fb_setcmap helper
From: Daniel Vetter @ 2017-07-05 6:08 UTC (permalink / raw)
To: Peter Rosin
Cc: David Airlie, nouveau, dri-devel, virtualization,
Benjamin Gaignard, Daniel Vetter, Boris Brezillon,
Thomas Hellstrom, Sinclair Yeh, Russell King, amd-gfx,
VMware Graphics, Ben Skeggs, Dave Airlie, intel-gfx,
Vincent Abriou, Philippe Cornu, linux-kernel, Yannick Fertre,
Alex Deucher, Christian König
In-Reply-To: <1499164632-5582-1-git-send-email-peda@axentia.se>
On Tue, Jul 04, 2017 at 12:36:56PM +0200, Peter Rosin wrote:
> Hi!
>
> While trying to get CLUT support for the atmel_hlcdc driver, and
> specifically for the emulated fbdev interface, I received some
> push-back that my feeble in-driver attempts should be solved
> by the core. This is my attempt to do it right.
>
> I have obviously not tested all of this with more than a compile,
> but patches 1 through 5 are enough to make the atmel-hlcdc driver
> do what I need. The rest is just lots of removals and cleanup made
> possible by the improved core.
>
> Please test, I would not be surprised if I have fouled up some
> bit-manipulation somewhere, or if I have misunderstood something
> about atomics...
>
> Changes since v2:
> - Added patch 1/16 which factors out pseudo-palette handling.
> - Removed the if (cmap->start + cmap->len < cmap->start)
> sanity check on the assumption that the fbdev core handles it.
> - Added patch 4/16 which factors out atomic state and commit
> handling from drm_atomic_helper_legacy_gamma_set to
> drm_mode_gamma_set_ioctl.
> - Do one atomic commit for all affected crtc.
> - Removed a now obsolete note in include/drm/drm_crtc.h (ammended
> the last patch).
> - Cc list is getting long, so I have redused the list for the
> individual patches. If you would like to get the full series
> (or nothing at all) for the next round (if that is needed) just
> say so.
Is this still on top of my locking rework? I tried to apply patches 1-3,
but there's minor conflicts ...
-Daniel
>
> Changes since v1:
>
> - Rebased to next-20170621
> - Split 1/11 into a preparatory patch, a cleanup patch and then
> the meat in 3/14.
> - Handle pseudo-palette for FB_VISUAL_TRUECOLOR.
> - Removed the empty .gamma_get/.gamma_set fb helpers from the
> armada driver that I had somehow managed to ignore but which
> 0day found real quick.
> - Be less judgemental on drivers only providing .gamma_get and
> .gamma_set, but no .load_lut. That's actually a valid thing
> to do if you only need pseudo-palette for FB_VISUAL_TRUECOLOR.
> - Add a comment about colliding bitfields in the nouveau driver.
> - Remove gamma_set/gamma_get declarations from the radeon driver
> (the definitions were removed in v1).
>
> Cheers,
> peda
>
> Peter Rosin (16):
> drm/fb-helper: factor out pseudo-palette
> drm/fb-helper: keep the .gamma_store updated in drm_fb_helper_setcmap
> drm/fb-helper: remove drm_fb_helper_save_lut_atomic
> drm/color-mgmt: move atomic state/commit out from .gamma_set
> drm/fb-helper: do a generic fb_setcmap helper in terms of crtc
> .gamma_set
> drm: amd: remove dead code and pointless local lut storage
> drm: armada: remove dead empty functions
> drm: ast: remove dead code and pointless local lut storage
> drm: cirrus: remove dead code and pointless local lut storage
> drm: gma500: remove dead code and pointless local lut storage
> drm: i915: remove dead code and pointless local lut storage
> drm: mgag200: remove dead code and pointless local lut storage
> drm: nouveau: remove dead code and pointless local lut storage
> drm: radeon: remove dead code and pointless local lut storage
> drm: stm: remove dead code and pointless local lut storage
> drm: remove unused and redundant callbacks
>
> drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c | 24 ----
> drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h | 1 -
> drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 29 ++---
> drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 29 ++---
> drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 29 ++---
> drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 29 ++---
> drivers/gpu/drm/amd/amdgpu/dce_virtual.c | 25 +---
> drivers/gpu/drm/armada/armada_crtc.c | 10 --
> drivers/gpu/drm/armada/armada_crtc.h | 2 -
> drivers/gpu/drm/armada/armada_fbdev.c | 2 -
> drivers/gpu/drm/ast/ast_drv.h | 1 -
> drivers/gpu/drm/ast/ast_fb.c | 20 ---
> drivers/gpu/drm/ast/ast_mode.c | 28 +---
> drivers/gpu/drm/cirrus/cirrus_drv.h | 8 --
> drivers/gpu/drm/cirrus/cirrus_fbdev.c | 2 -
> drivers/gpu/drm/cirrus/cirrus_mode.c | 73 +++--------
> drivers/gpu/drm/drm_atomic_helper.c | 37 ++----
> drivers/gpu/drm/drm_color_mgmt.c | 27 +++-
> drivers/gpu/drm/drm_fb_helper.c | 195 +++++++++++++++++-----------
> drivers/gpu/drm/gma500/framebuffer.c | 22 ----
> drivers/gpu/drm/gma500/gma_display.c | 34 ++---
> drivers/gpu/drm/gma500/gma_display.h | 2 +-
> drivers/gpu/drm/gma500/psb_intel_display.c | 7 +-
> drivers/gpu/drm/gma500/psb_intel_drv.h | 1 -
> drivers/gpu/drm/i915/intel_drv.h | 1 -
> drivers/gpu/drm/i915/intel_fbdev.c | 31 -----
> drivers/gpu/drm/mgag200/mgag200_drv.h | 5 -
> drivers/gpu/drm/mgag200/mgag200_fb.c | 2 -
> drivers/gpu/drm/mgag200/mgag200_mode.c | 64 +++------
> drivers/gpu/drm/nouveau/dispnv04/crtc.c | 28 ++--
> drivers/gpu/drm/nouveau/nouveau_crtc.h | 3 -
> drivers/gpu/drm/nouveau/nouveau_fbcon.c | 22 ----
> drivers/gpu/drm/nouveau/nv50_display.c | 42 ++----
> drivers/gpu/drm/radeon/atombios_crtc.c | 1 -
> drivers/gpu/drm/radeon/radeon_connectors.c | 7 +-
> drivers/gpu/drm/radeon/radeon_display.c | 73 +++++------
> drivers/gpu/drm/radeon/radeon_fb.c | 2 -
> drivers/gpu/drm/radeon/radeon_legacy_crtc.c | 1 -
> drivers/gpu/drm/radeon/radeon_mode.h | 4 -
> drivers/gpu/drm/stm/ltdc.c | 12 --
> drivers/gpu/drm/stm/ltdc.h | 1 -
> drivers/gpu/drm/vc4/vc4_crtc.c | 2 +-
> drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 2 +-
> drivers/gpu/drm/vmwgfx/vmwgfx_kms.h | 2 +-
> include/drm/drm_atomic_helper.h | 2 +-
> include/drm/drm_crtc.h | 11 +-
> include/drm/drm_fb_helper.h | 32 -----
> include/drm/drm_modeset_helper_vtables.h | 16 ---
> 48 files changed, 301 insertions(+), 702 deletions(-)
>
> --
> 2.1.4
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
^ permalink raw reply
* Re: [PATCH v2] virtio-blk: add DISCARD support to virtio-blk driver
From: Michael S. Tsirkin @ 2017-07-04 21:35 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: virtio-dev, hch, Changpeng Liu, virtualization
In-Reply-To: <01542f21-6fa3-c406-65e1-a37d04130fb7@redhat.com>
On Tue, Jul 04, 2017 at 11:24:01AM +0200, Paolo Bonzini wrote:
>
>
> On 05/07/2017 10:44, Changpeng Liu wrote:
> > Currently virtio-blk driver does not provide discard feature flag, so the
> > filesystems which built on top of the block device will not send discard
> > command. This is okay for HDD backend, but it will impact the performance
> > for SSD backend.
> >
> > Add a feature flag VIRTIO_BLK_F_DISCARD and command VIRTIO_BLK_T_DISCARD
> > to extend exist virtio-blk protocol, define 16 bytes discard descriptor
> > for each discard segment, the discard segment defination aligns with
> > SCSI or NVM Express protocols, virtio-blk driver will support multi-range
> > discard request as well.
> >
> > Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
>
> Please include a patch for the specification.
Most importantly, please remember to copy virtio-dev@lists.oasis-open.org
on anything that changes the host/guest interface.
> Since we are at it, I
> would like to have three operations defined using the same descriptor:
>
> - discard (SCSI UNMAP)
>
> - write zeroes (SCSI WRITE SAME without UNMAP flag)
>
> - write zeroes and possibly discard (SCSI WRITE SAME with UNMAP flag)
>
> The last two can use the same command VIRTIO_BLK_T_WRITE_ZEROES, using
> the reserved field as a flags field.
>
> Paolo
> > ---
> > drivers/block/virtio_blk.c | 76 +++++++++++++++++++++++++++++++++++++++--
> > include/uapi/linux/virtio_blk.h | 19 +++++++++++
> > 2 files changed, 92 insertions(+), 3 deletions(-)
^ permalink raw reply
* Re: [PATCH net] virtio-net: unbreak cusmed packet for small buffer XDP
From: Jason Wang @ 2017-07-04 12:20 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: netdev, linux-kernel, virtualization
In-Reply-To: <20170703195752-mutt-send-email-mst@kernel.org>
On 2017年07月04日 01:03, Michael S. Tsirkin wrote:
> On Wed, Jun 28, 2017 at 08:05:06PM +0800, Jason Wang wrote:
>>
>> On 2017年06月28日 12:01, Michael S. Tsirkin wrote:
>>> On Wed, Jun 28, 2017 at 11:40:30AM +0800, Jason Wang wrote:
>>>> On 2017年06月28日 11:31, Michael S. Tsirkin wrote:
>>>>> On Wed, Jun 28, 2017 at 10:45:18AM +0800, Jason Wang wrote:
>>>>>> On 2017年06月28日 10:17, Michael S. Tsirkin wrote:
>>>>>>> On Wed, Jun 28, 2017 at 10:14:34AM +0800, Jason Wang wrote:
>>>>>>>> On 2017年06月28日 10:02, Michael S. Tsirkin wrote:
>>>>>>>>> On Wed, Jun 28, 2017 at 09:54:03AM +0800, Jason Wang wrote:
>>>>>>>>>> We should allow csumed packet for small buffer, otherwise XDP_PASS
>>>>>>>>>> won't work correctly.
>>>>>>>>>>
>>>>>>>>>> Fixes commit bb91accf2733 ("virtio-net: XDP support for small buffers")
>>>>>>>>>> Signed-off-by: Jason Wang<jasowang@redhat.com>
>>>>>>>>> The issue would be VIRTIO_NET_HDR_F_DATA_VALID might be set.
>>>>>>>>> What do you think?
>>>>>>>> I think it's safe. For XDP_PASS, it work like in the past.
>>>>>>> That's the part I don't get. With DATA_VALID csum in packet is wrong, XDP
>>>>>>> tools assume it's value.
>>>>>> DATA_VALID is CHECKSUM_UNCESSARY on the host, and according to the comment
>>>>>> in skbuff.h
>>>>>>
>>>>>>
>>>>>> "
>>>>>> * The hardware you're dealing with doesn't calculate the full checksum
>>>>>> * (as in CHECKSUM_COMPLETE), but it does parse headers and verify
>>>>>> checksums
>>>>>> * for specific protocols. For such packets it will set
>>>>>> CHECKSUM_UNNECESSARY
>>>>>> * if their checksums are okay. skb->csum is still undefined in this case
>>>>>> * though. A driver or device must never modify the checksum field in the
>>>>>> * packet even if checksum is verified.
>>>>>> "
>>>>>>
>>>>>> The csum is correct I believe?
>>>>>>
>>>>>> Thanks
>>>>> That's on input. But I think for tun it's output, where that is equivalent
>>>>> to CHECKSUM_NONE
>>>>>
>>>>>
>>>> Yes, but the comment said:
>>>>
>>>> "
>>>> CKSUM_NONE:
>>>> *
>>>> * The skb was already checksummed by the protocol, or a checksum is not
>>>> * required.
>>>> *
>>>> * CHECKSUM_UNNECESSARY:
>>>> *
>>>> * This has the same meaning on as CHECKSUM_NONE for checksum offload on
>>>> * output.
>>>> *
>>>> "
>>>>
>>>> So still correct I think?
>>>>
>>>> Thanks
>>> Hmm maybe I mean NEEDS_CHECKSUM actually.
>>>
>>> I'll need to re-read the spec.
>>>
>> Not sure this is an issue. But if it is, we can probably checksum the packet
>> before passing it to XDP. But it would be a little slow.
>>
>> Thanks
>
>
> Right. I confused DATA_VALID with NEEDS_CHECKSUM.
>
> IIUC XDP generally refuses to attach if checksum offload
> is enabled.
Any reason to do this? (Looks like I don't see any code for this)
>
> Could you pls explain how to reproduce the issue you are seeing?
>
Using small buffer, all csumed packets will be dropped.
Thanks
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply
* Re: [PATCH v1] virtio_blk: Use sysfs_match_string() helper
From: Jason Wang @ 2017-07-04 12:17 UTC (permalink / raw)
To: Andy Shevchenko, virtualization, Jens Axboe; +Cc: Michael S. Tsirkin
In-Reply-To: <1499083530.22624.239.camel@linux.intel.com>
On 2017年07月03日 20:05, Andy Shevchenko wrote:
> On Fri, 2017-06-09 at 15:07 +0300, Andy Shevchenko wrote:
>> Use sysfs_match_string() helper instead of open coded variant.
> Did I miss maintainer?
Nope :)
Reviewed-by: Jason Wang <jasowang@redhat.com>
>
>> Cc: "Michael S. Tsirkin" <mst@redhat.com>
>> Cc: Jason Wang <jasowang@redhat.com>
>> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>> ---
>> drivers/block/virtio_blk.c | 7 ++-----
>> 1 file changed, 2 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
>> index 553cc4c542b4..0e707b8cce9d 100644
>> --- a/drivers/block/virtio_blk.c
>> +++ b/drivers/block/virtio_blk.c
>> @@ -541,12 +541,9 @@ virtblk_cache_type_store(struct device *dev,
>> struct device_attribute *attr,
>> int i;
>>
>> BUG_ON(!virtio_has_feature(vblk->vdev,
>> VIRTIO_BLK_F_CONFIG_WCE));
>> - for (i = ARRAY_SIZE(virtblk_cache_types); --i >= 0; )
>> - if (sysfs_streq(buf, virtblk_cache_types[i]))
>> - break;
>> -
>> + i = sysfs_match_string(virtblk_cache_types, buf);
>> if (i < 0)
>> - return -EINVAL;
>> + return i;
>>
>> virtio_cwrite8(vdev, offsetof(struct virtio_blk_config, wce),
>> i);
>> virtblk_update_cache_mode(vdev);
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply
* Re: [PATCH 0/1] Change email address
From: Christian Borntraeger @ 2017-07-04 12:07 UTC (permalink / raw)
To: Paolo Bonzini, Cornelia Huck, linux-s390, kvm, virtualization; +Cc: schwidefsky
In-Reply-To: <8a09062e-4d40-3f5a-7e4b-0653baafa19a@redhat.com>
On 07/04/2017 02:02 PM, Paolo Bonzini wrote:
>
>
> On 04/07/2017 11:30, Cornelia Huck wrote:
>> New employer, new address. Make sure people use the right one.
>>
>> Christian, Martin, it's probably quickest if one of you takes this.
>
> I'm sending a pull request tomorrow so I'll include this too.
Ok,
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
>
> Paolo
>
>> Cornelia Huck (1):
>> Update my email address
>>
>> MAINTAINERS | 6 +++---
>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>
>
^ permalink raw reply
* Re: [PATCH 0/1] Change email address
From: Paolo Bonzini @ 2017-07-04 12:02 UTC (permalink / raw)
To: Cornelia Huck, linux-s390, kvm, virtualization; +Cc: schwidefsky
In-Reply-To: <20170704093038.13943-1-cohuck@redhat.com>
On 04/07/2017 11:30, Cornelia Huck wrote:
> New employer, new address. Make sure people use the right one.
>
> Christian, Martin, it's probably quickest if one of you takes this.
I'm sending a pull request tomorrow so I'll include this too.
Paolo
> Cornelia Huck (1):
> Update my email address
>
> MAINTAINERS | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
^ permalink raw reply
* [PATCH v3 09/16] drm: cirrus: remove dead code and pointless local lut storage
From: Peter Rosin @ 2017-07-04 10:37 UTC (permalink / raw)
To: linux-kernel
Cc: Jani Nikula, Boris Brezillon, David Airlie, dri-devel,
virtualization, Sean Paul, Daniel Vetter, Dave Airlie,
Peter Rosin
In-Reply-To: <1499164632-5582-1-git-send-email-peda@axentia.se>
The redundant fb helpers .load_lut, .gamma_set and .gamma_get are
no longer used. Remove the dead code and hook up the crtc .gamma_set
to use the crtc gamma_store directly instead of duplicating that
info locally.
Signed-off-by: Peter Rosin <peda@axentia.se>
---
drivers/gpu/drm/cirrus/cirrus_drv.h | 8 ----
drivers/gpu/drm/cirrus/cirrus_fbdev.c | 2 -
drivers/gpu/drm/cirrus/cirrus_mode.c | 71 ++++++++---------------------------
3 files changed, 16 insertions(+), 65 deletions(-)
diff --git a/drivers/gpu/drm/cirrus/cirrus_drv.h b/drivers/gpu/drm/cirrus/cirrus_drv.h
index 8690352..be2d7e48 100644
--- a/drivers/gpu/drm/cirrus/cirrus_drv.h
+++ b/drivers/gpu/drm/cirrus/cirrus_drv.h
@@ -96,7 +96,6 @@
struct cirrus_crtc {
struct drm_crtc base;
- u8 lut_r[256], lut_g[256], lut_b[256];
int last_dpms;
bool enabled;
};
@@ -180,13 +179,6 @@ cirrus_bo(struct ttm_buffer_object *bo)
#define to_cirrus_obj(x) container_of(x, struct cirrus_gem_object, base)
#define DRM_FILE_PAGE_OFFSET (0x100000000ULL >> PAGE_SHIFT)
- /* cirrus_mode.c */
-void cirrus_crtc_fb_gamma_set(struct drm_crtc *crtc, u16 red, u16 green,
- u16 blue, int regno);
-void cirrus_crtc_fb_gamma_get(struct drm_crtc *crtc, u16 *red, u16 *green,
- u16 *blue, int regno);
-
-
/* cirrus_main.c */
int cirrus_device_init(struct cirrus_device *cdev,
struct drm_device *ddev,
diff --git a/drivers/gpu/drm/cirrus/cirrus_fbdev.c b/drivers/gpu/drm/cirrus/cirrus_fbdev.c
index 7fa58ee..1fedab0 100644
--- a/drivers/gpu/drm/cirrus/cirrus_fbdev.c
+++ b/drivers/gpu/drm/cirrus/cirrus_fbdev.c
@@ -265,8 +265,6 @@ static int cirrus_fbdev_destroy(struct drm_device *dev,
}
static const struct drm_fb_helper_funcs cirrus_fb_helper_funcs = {
- .gamma_set = cirrus_crtc_fb_gamma_set,
- .gamma_get = cirrus_crtc_fb_gamma_get,
.fb_probe = cirrusfb_create,
};
diff --git a/drivers/gpu/drm/cirrus/cirrus_mode.c b/drivers/gpu/drm/cirrus/cirrus_mode.c
index 2b4c2c3..92ff7de 100644
--- a/drivers/gpu/drm/cirrus/cirrus_mode.c
+++ b/drivers/gpu/drm/cirrus/cirrus_mode.c
@@ -31,25 +31,6 @@
* This file contains setup code for the CRTC.
*/
-static void cirrus_crtc_load_lut(struct drm_crtc *crtc)
-{
- struct cirrus_crtc *cirrus_crtc = to_cirrus_crtc(crtc);
- struct drm_device *dev = crtc->dev;
- struct cirrus_device *cdev = dev->dev_private;
- int i;
-
- if (!crtc->enabled)
- return;
-
- for (i = 0; i < CIRRUS_LUT_SIZE; i++) {
- /* VGA registers */
- WREG8(PALETTE_INDEX, i);
- WREG8(PALETTE_DATA, cirrus_crtc->lut_r[i]);
- WREG8(PALETTE_DATA, cirrus_crtc->lut_g[i]);
- WREG8(PALETTE_DATA, cirrus_crtc->lut_b[i]);
- }
-}
-
/*
* The DRM core requires DPMS functions, but they make little sense in our
* case and so are just stubs
@@ -330,15 +311,25 @@ static int cirrus_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
u16 *blue, uint32_t size,
struct drm_crtc_state *state)
{
- struct cirrus_crtc *cirrus_crtc = to_cirrus_crtc(crtc);
+ struct drm_device *dev = crtc->dev;
+ struct cirrus_device *cdev = dev->dev_private;
+ u16 *r, *g, *b;
int i;
- for (i = 0; i < size; i++) {
- cirrus_crtc->lut_r[i] = red[i];
- cirrus_crtc->lut_g[i] = green[i];
- cirrus_crtc->lut_b[i] = blue[i];
+ if (!crtc->enabled)
+ return 0;
+
+ r = crtc->gamma_store;
+ g = r + crtc->gamma_size;
+ b = g + crtc->gamma_size;
+
+ for (i = 0; i < CIRRUS_LUT_SIZE; i++) {
+ /* VGA registers */
+ WREG8(PALETTE_INDEX, i);
+ WREG8(PALETTE_DATA, *r++ >> 8);
+ WREG8(PALETTE_DATA, *g++ >> 8);
+ WREG8(PALETTE_DATA, *b++ >> 8);
}
- cirrus_crtc_load_lut(crtc);
return 0;
}
@@ -365,7 +356,6 @@ static const struct drm_crtc_helper_funcs cirrus_helper_funcs = {
.mode_set_base = cirrus_crtc_mode_set_base,
.prepare = cirrus_crtc_prepare,
.commit = cirrus_crtc_commit,
- .load_lut = cirrus_crtc_load_lut,
};
/* CRTC setup */
@@ -373,7 +363,6 @@ static void cirrus_crtc_init(struct drm_device *dev)
{
struct cirrus_device *cdev = dev->dev_private;
struct cirrus_crtc *cirrus_crtc;
- int i;
cirrus_crtc = kzalloc(sizeof(struct cirrus_crtc) +
(CIRRUSFB_CONN_LIMIT * sizeof(struct drm_connector *)),
@@ -387,37 +376,9 @@ static void cirrus_crtc_init(struct drm_device *dev)
drm_mode_crtc_set_gamma_size(&cirrus_crtc->base, CIRRUS_LUT_SIZE);
cdev->mode_info.crtc = cirrus_crtc;
- for (i = 0; i < CIRRUS_LUT_SIZE; i++) {
- cirrus_crtc->lut_r[i] = i;
- cirrus_crtc->lut_g[i] = i;
- cirrus_crtc->lut_b[i] = i;
- }
-
drm_crtc_helper_add(&cirrus_crtc->base, &cirrus_helper_funcs);
}
-/** Sets the color ramps on behalf of fbcon */
-void cirrus_crtc_fb_gamma_set(struct drm_crtc *crtc, u16 red, u16 green,
- u16 blue, int regno)
-{
- struct cirrus_crtc *cirrus_crtc = to_cirrus_crtc(crtc);
-
- cirrus_crtc->lut_r[regno] = red;
- cirrus_crtc->lut_g[regno] = green;
- cirrus_crtc->lut_b[regno] = blue;
-}
-
-/** Gets the color ramps on behalf of fbcon */
-void cirrus_crtc_fb_gamma_get(struct drm_crtc *crtc, u16 *red, u16 *green,
- u16 *blue, int regno)
-{
- struct cirrus_crtc *cirrus_crtc = to_cirrus_crtc(crtc);
-
- *red = cirrus_crtc->lut_r[regno];
- *green = cirrus_crtc->lut_g[regno];
- *blue = cirrus_crtc->lut_b[regno];
-}
-
static void cirrus_encoder_mode_set(struct drm_encoder *encoder,
struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
--
2.1.4
^ permalink raw reply related
* [PATCH v3 04/16] drm/color-mgmt: move atomic state/commit out from .gamma_set
From: Peter Rosin @ 2017-07-04 10:37 UTC (permalink / raw)
To: linux-kernel
Cc: Patrik Jakobsson, Boris Brezillon, Thomas Hellstrom,
VMware Graphics, Sinclair Yeh, David Airlie, nouveau, dri-devel,
Jani Nikula, Christian König, Eric Anholt, Sean Paul,
Daniel Vetter, Alex Deucher, Dave Airlie, amd-gfx, virtualization,
Peter Rosin, Ben Skeggs
In-Reply-To: <1499164632-5582-1-git-send-email-peda@axentia.se>
Handle the atomics directly in the ioctl instead, in preparation for the
fb_setcmap helper needing to commit the gamma map for several crtc in one
commit.
Signed-off-by: Peter Rosin <peda@axentia.se>
---
drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 2 +-
drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 2 +-
drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 2 +-
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 2 +-
drivers/gpu/drm/amd/amdgpu/dce_virtual.c | 2 +-
drivers/gpu/drm/ast/ast_mode.c | 2 +-
drivers/gpu/drm/cirrus/cirrus_mode.c | 2 +-
drivers/gpu/drm/drm_atomic_helper.c | 37 +++++++-------------------------
drivers/gpu/drm/drm_color_mgmt.c | 27 ++++++++++++++++++++++-
drivers/gpu/drm/gma500/gma_display.c | 2 +-
drivers/gpu/drm/gma500/gma_display.h | 2 +-
drivers/gpu/drm/mgag200/mgag200_mode.c | 2 +-
drivers/gpu/drm/nouveau/dispnv04/crtc.c | 2 +-
drivers/gpu/drm/nouveau/nv50_display.c | 2 +-
drivers/gpu/drm/radeon/radeon_display.c | 2 +-
drivers/gpu/drm/vc4/vc4_crtc.c | 2 +-
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 2 +-
drivers/gpu/drm/vmwgfx/vmwgfx_kms.h | 2 +-
include/drm/drm_atomic_helper.h | 2 +-
include/drm/drm_crtc.h | 3 +--
20 files changed, 52 insertions(+), 49 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
index 9f78c03..31c977b 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
@@ -2622,7 +2622,7 @@ static void dce_v10_0_cursor_reset(struct drm_crtc *crtc)
static int dce_v10_0_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
u16 *blue, uint32_t size,
- struct drm_modeset_acquire_ctx *ctx)
+ struct drm_crtc_state *state)
{
struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc);
int i;
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
index 4bcf01d..cf42640 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
@@ -2642,7 +2642,7 @@ static void dce_v11_0_cursor_reset(struct drm_crtc *crtc)
static int dce_v11_0_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
u16 *blue, uint32_t size,
- struct drm_modeset_acquire_ctx *ctx)
+ struct drm_crtc_state *state)
{
struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc);
int i;
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
index fd134a4..045014d 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
@@ -2494,7 +2494,7 @@ static void dce_v6_0_cursor_reset(struct drm_crtc *crtc)
static int dce_v6_0_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
u16 *blue, uint32_t size,
- struct drm_modeset_acquire_ctx *ctx)
+ struct drm_crtc_state *state)
{
struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc);
int i;
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
index a9e8695..ee9389f 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
@@ -2473,7 +2473,7 @@ static void dce_v8_0_cursor_reset(struct drm_crtc *crtc)
static int dce_v8_0_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
u16 *blue, uint32_t size,
- struct drm_modeset_acquire_ctx *ctx)
+ struct drm_crtc_state *state)
{
struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc);
int i;
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
index 90bb083..f194dfc 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
@@ -166,7 +166,7 @@ static void dce_virtual_bandwidth_update(struct amdgpu_device *adev)
static int dce_virtual_crtc_gamma_set(struct drm_crtc *crtc, u16 *red,
u16 *green, u16 *blue, uint32_t size,
- struct drm_modeset_acquire_ctx *ctx)
+ struct drm_crtc_state *state)
{
struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc);
int i;
diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
index aaef0a6..6f0335b 100644
--- a/drivers/gpu/drm/ast/ast_mode.c
+++ b/drivers/gpu/drm/ast/ast_mode.c
@@ -646,7 +646,7 @@ static void ast_crtc_reset(struct drm_crtc *crtc)
static int ast_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
u16 *blue, uint32_t size,
- struct drm_modeset_acquire_ctx *ctx)
+ struct drm_crtc_state *state)
{
struct ast_crtc *ast_crtc = to_ast_crtc(crtc);
int i;
diff --git a/drivers/gpu/drm/cirrus/cirrus_mode.c b/drivers/gpu/drm/cirrus/cirrus_mode.c
index 53f6f0f..2b4c2c3 100644
--- a/drivers/gpu/drm/cirrus/cirrus_mode.c
+++ b/drivers/gpu/drm/cirrus/cirrus_mode.c
@@ -328,7 +328,7 @@ static void cirrus_crtc_commit(struct drm_crtc *crtc)
*/
static int cirrus_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
u16 *blue, uint32_t size,
- struct drm_modeset_acquire_ctx *ctx)
+ struct drm_crtc_state *state)
{
struct cirrus_crtc *cirrus_crtc = to_cirrus_crtc(crtc);
int i;
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 86d3093..3045f51 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -3599,7 +3599,7 @@ EXPORT_SYMBOL(drm_atomic_helper_connector_destroy_state);
* @green: green correction table
* @blue: green correction table
* @size: size of the tables
- * @ctx: lock acquire context
+ * @state: atomic CRTC state object to manipulate
*
* Implements support for legacy gamma correction table for drivers
* that support color management through the DEGAMMA_LUT/GAMMA_LUT
@@ -3609,28 +3609,19 @@ EXPORT_SYMBOL(drm_atomic_helper_connector_destroy_state);
int drm_atomic_helper_legacy_gamma_set(struct drm_crtc *crtc,
u16 *red, u16 *green, u16 *blue,
uint32_t size,
- struct drm_modeset_acquire_ctx *ctx)
+ struct drm_crtc_state *state)
{
struct drm_device *dev = crtc->dev;
struct drm_mode_config *config = &dev->mode_config;
- struct drm_atomic_state *state;
- struct drm_crtc_state *crtc_state;
- struct drm_property_blob *blob = NULL;
+ struct drm_property_blob *blob;
struct drm_color_lut *blob_data;
int i, ret = 0;
- state = drm_atomic_state_alloc(crtc->dev);
- if (!state)
- return -ENOMEM;
-
blob = drm_property_create_blob(dev,
sizeof(struct drm_color_lut) * size,
NULL);
- if (IS_ERR(blob)) {
- ret = PTR_ERR(blob);
- blob = NULL;
- goto fail;
- }
+ if (IS_ERR(blob))
+ return PTR_ERR(blob);
/* Prepare GAMMA_LUT with the legacy values. */
blob_data = (struct drm_color_lut *) blob->data;
@@ -3640,33 +3631,21 @@ int drm_atomic_helper_legacy_gamma_set(struct drm_crtc *crtc,
blob_data[i].blue = blue[i];
}
- state->acquire_ctx = ctx;
- crtc_state = drm_atomic_get_crtc_state(state, crtc);
- if (IS_ERR(crtc_state)) {
- ret = PTR_ERR(crtc_state);
- goto fail;
- }
-
/* Reset DEGAMMA_LUT and CTM properties. */
- ret = drm_atomic_crtc_set_property(crtc, crtc_state,
+ ret = drm_atomic_crtc_set_property(crtc, state,
config->degamma_lut_property, 0);
if (ret)
goto fail;
- ret = drm_atomic_crtc_set_property(crtc, crtc_state,
+ ret = drm_atomic_crtc_set_property(crtc, state,
config->ctm_property, 0);
if (ret)
goto fail;
- ret = drm_atomic_crtc_set_property(crtc, crtc_state,
+ ret = drm_atomic_crtc_set_property(crtc, state,
config->gamma_lut_property, blob->base.id);
- if (ret)
- goto fail;
-
- ret = drm_atomic_commit(state);
fail:
- drm_atomic_state_put(state);
drm_property_blob_put(blob);
return ret;
}
diff --git a/drivers/gpu/drm/drm_color_mgmt.c b/drivers/gpu/drm/drm_color_mgmt.c
index 3eda500..864efe8 100644
--- a/drivers/gpu/drm/drm_color_mgmt.c
+++ b/drivers/gpu/drm/drm_color_mgmt.c
@@ -21,6 +21,7 @@
*/
#include <drm/drmP.h>
+#include <drm/drm_atomic.h>
#include <drm/drm_crtc.h>
#include <drm/drm_color_mgmt.h>
@@ -218,9 +219,12 @@ int drm_mode_gamma_set_ioctl(struct drm_device *dev,
void *data, struct drm_file *file_priv)
{
struct drm_mode_crtc_lut *crtc_lut = data;
+ struct drm_crtc_state *crtc_state = NULL;
+ struct drm_atomic_state *state = NULL;
struct drm_crtc *crtc;
void *r_base, *g_base, *b_base;
int size;
+ int atomic;
struct drm_modeset_acquire_ctx ctx;
int ret = 0;
@@ -238,12 +242,28 @@ int drm_mode_gamma_set_ioctl(struct drm_device *dev,
if (crtc_lut->gamma_size != crtc->gamma_size)
return -EINVAL;
+ atomic = drm_drv_uses_atomic_modeset(dev);
+ if (atomic) {
+ state = drm_atomic_state_alloc(dev);
+ if (!state)
+ return -ENOMEM;
+ }
drm_modeset_acquire_init(&ctx, 0);
retry:
ret = drm_modeset_lock_all_ctx(dev, &ctx);
if (ret)
goto out;
+ if (atomic) {
+ state->acquire_ctx = &ctx;
+
+ crtc_state = drm_atomic_get_crtc_state(state, crtc);
+ if (IS_ERR(crtc_state)) {
+ ret = PTR_ERR(crtc_state);
+ goto out;
+ }
+ }
+
size = crtc_lut->gamma_size * (sizeof(uint16_t));
r_base = crtc->gamma_store;
if (copy_from_user(r_base, (void __user *)(unsigned long)crtc_lut->red, size)) {
@@ -264,7 +284,10 @@ int drm_mode_gamma_set_ioctl(struct drm_device *dev,
}
ret = crtc->funcs->gamma_set(crtc, r_base, g_base, b_base,
- crtc->gamma_size, &ctx);
+ crtc->gamma_size, crtc_state);
+
+ if (!ret && atomic)
+ ret = drm_atomic_commit(state);
out:
if (ret == -EDEADLK) {
@@ -273,6 +296,8 @@ int drm_mode_gamma_set_ioctl(struct drm_device *dev,
}
drm_modeset_drop_locks(&ctx);
drm_modeset_acquire_fini(&ctx);
+ if (atomic)
+ drm_atomic_state_put(state);
return ret;
diff --git a/drivers/gpu/drm/gma500/gma_display.c b/drivers/gpu/drm/gma500/gma_display.c
index e7fd356..ccf8c33 100644
--- a/drivers/gpu/drm/gma500/gma_display.c
+++ b/drivers/gpu/drm/gma500/gma_display.c
@@ -178,7 +178,7 @@ void gma_crtc_load_lut(struct drm_crtc *crtc)
int gma_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green, u16 *blue,
u32 size,
- struct drm_modeset_acquire_ctx *ctx)
+ struct drm_crtc_state *state)
{
struct gma_crtc *gma_crtc = to_gma_crtc(crtc);
int i;
diff --git a/drivers/gpu/drm/gma500/gma_display.h b/drivers/gpu/drm/gma500/gma_display.h
index 239c374..c07b34f 100644
--- a/drivers/gpu/drm/gma500/gma_display.h
+++ b/drivers/gpu/drm/gma500/gma_display.h
@@ -74,7 +74,7 @@ extern int gma_crtc_cursor_move(struct drm_crtc *crtc, int x, int y);
extern void gma_crtc_load_lut(struct drm_crtc *crtc);
extern int gma_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
u16 *blue, u32 size,
- struct drm_modeset_acquire_ctx *ctx);
+ struct drm_crtc_state *state);
extern void gma_crtc_dpms(struct drm_crtc *crtc, int mode);
extern void gma_crtc_prepare(struct drm_crtc *crtc);
extern void gma_crtc_commit(struct drm_crtc *crtc);
diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c
index f4b5358..2141796 100644
--- a/drivers/gpu/drm/mgag200/mgag200_mode.c
+++ b/drivers/gpu/drm/mgag200/mgag200_mode.c
@@ -1397,7 +1397,7 @@ static void mga_crtc_commit(struct drm_crtc *crtc)
*/
static int mga_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
u16 *blue, uint32_t size,
- struct drm_modeset_acquire_ctx *ctx)
+ struct drm_crtc_state *state)
{
struct mga_crtc *mga_crtc = to_mga_crtc(crtc);
int i;
diff --git a/drivers/gpu/drm/nouveau/dispnv04/crtc.c b/drivers/gpu/drm/nouveau/dispnv04/crtc.c
index 4b4b0b4..f562824 100644
--- a/drivers/gpu/drm/nouveau/dispnv04/crtc.c
+++ b/drivers/gpu/drm/nouveau/dispnv04/crtc.c
@@ -789,7 +789,7 @@ nv_crtc_disable(struct drm_crtc *crtc)
static int
nv_crtc_gamma_set(struct drm_crtc *crtc, u16 *r, u16 *g, u16 *b,
uint32_t size,
- struct drm_modeset_acquire_ctx *ctx)
+ struct drm_crtc_state *state)
{
struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc);
int i;
diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c
index e3132a2..f13fa74 100644
--- a/drivers/gpu/drm/nouveau/nv50_display.c
+++ b/drivers/gpu/drm/nouveau/nv50_display.c
@@ -2232,7 +2232,7 @@ nv50_head_help = {
static int
nv50_head_gamma_set(struct drm_crtc *crtc, u16 *r, u16 *g, u16 *b,
uint32_t size,
- struct drm_modeset_acquire_ctx *ctx)
+ struct drm_crtc_state *state)
{
struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc);
u32 i;
diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c
index 17d3daf..0ea575d 100644
--- a/drivers/gpu/drm/radeon/radeon_display.c
+++ b/drivers/gpu/drm/radeon/radeon_display.c
@@ -233,7 +233,7 @@ void radeon_crtc_fb_gamma_get(struct drm_crtc *crtc, u16 *red, u16 *green,
static int radeon_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
u16 *blue, uint32_t size,
- struct drm_modeset_acquire_ctx *ctx)
+ struct drm_crtc_state *state)
{
struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
int i;
diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c
index 403bbd5..fcc8dac 100644
--- a/drivers/gpu/drm/vc4/vc4_crtc.c
+++ b/drivers/gpu/drm/vc4/vc4_crtc.c
@@ -301,7 +301,7 @@ vc4_crtc_lut_load(struct drm_crtc *crtc)
static int
vc4_crtc_gamma_set(struct drm_crtc *crtc, u16 *r, u16 *g, u16 *b,
uint32_t size,
- struct drm_modeset_acquire_ctx *ctx)
+ struct drm_crtc_state *state)
{
struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);
u32 i;
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
index 3d94ea6..d75c5da 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
@@ -1914,7 +1914,7 @@ static int vmw_du_update_layout(struct vmw_private *dev_priv, unsigned num,
int vmw_du_crtc_gamma_set(struct drm_crtc *crtc,
u16 *r, u16 *g, u16 *b,
uint32_t size,
- struct drm_modeset_acquire_ctx *ctx)
+ struct drm_crtc_state *state)
{
struct vmw_private *dev_priv = vmw_priv(crtc->dev);
int i;
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.h b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.h
index 5f8d678..9b2d8d3 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.h
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.h
@@ -255,7 +255,7 @@ void vmw_du_crtc_restore(struct drm_crtc *crtc);
int vmw_du_crtc_gamma_set(struct drm_crtc *crtc,
u16 *r, u16 *g, u16 *b,
uint32_t size,
- struct drm_modeset_acquire_ctx *ctx);
+ struct drm_crtc_state *state);
int vmw_du_connector_set_property(struct drm_connector *connector,
struct drm_property *property,
uint64_t val);
diff --git a/include/drm/drm_atomic_helper.h b/include/drm/drm_atomic_helper.h
index f0a8678..a91e063 100644
--- a/include/drm/drm_atomic_helper.h
+++ b/include/drm/drm_atomic_helper.h
@@ -177,7 +177,7 @@ void drm_atomic_helper_connector_destroy_state(struct drm_connector *connector,
int drm_atomic_helper_legacy_gamma_set(struct drm_crtc *crtc,
u16 *red, u16 *green, u16 *blue,
uint32_t size,
- struct drm_modeset_acquire_ctx *ctx);
+ struct drm_crtc_state *state);
/**
* drm_atomic_crtc_for_each_plane - iterate over planes currently attached to CRTC
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 629a5fe..d442d30 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -368,8 +368,7 @@ struct drm_crtc_funcs {
* hooks.
*/
int (*gamma_set)(struct drm_crtc *crtc, u16 *r, u16 *g, u16 *b,
- uint32_t size,
- struct drm_modeset_acquire_ctx *ctx);
+ uint32_t size, struct drm_crtc_state *state);
/**
* @destroy:
--
2.1.4
^ permalink raw reply related
* [PATCH v3 00/16] improve the fb_setcmap helper
From: Peter Rosin @ 2017-07-04 10:36 UTC (permalink / raw)
To: linux-kernel
Cc: David Airlie, nouveau, dri-devel, virtualization, Eric Anholt,
Benjamin Gaignard, Daniel Vetter, Boris Brezillon,
Thomas Hellstrom, Sinclair Yeh, Russell King, Patrik Jakobsson,
VMware Graphics, Ben Skeggs, Dave Airlie, intel-gfx, Jani Nikula,
Sean Paul, Vincent Abriou, amd-gfx, Philippe Cornu, Peter Rosin,
Yannick Fertre <yannick.fertr>
Hi!
While trying to get CLUT support for the atmel_hlcdc driver, and
specifically for the emulated fbdev interface, I received some
push-back that my feeble in-driver attempts should be solved
by the core. This is my attempt to do it right.
I have obviously not tested all of this with more than a compile,
but patches 1 through 5 are enough to make the atmel-hlcdc driver
do what I need. The rest is just lots of removals and cleanup made
possible by the improved core.
Please test, I would not be surprised if I have fouled up some
bit-manipulation somewhere, or if I have misunderstood something
about atomics...
Changes since v2:
- Added patch 1/16 which factors out pseudo-palette handling.
- Removed the if (cmap->start + cmap->len < cmap->start)
sanity check on the assumption that the fbdev core handles it.
- Added patch 4/16 which factors out atomic state and commit
handling from drm_atomic_helper_legacy_gamma_set to
drm_mode_gamma_set_ioctl.
- Do one atomic commit for all affected crtc.
- Removed a now obsolete note in include/drm/drm_crtc.h (ammended
the last patch).
- Cc list is getting long, so I have redused the list for the
individual patches. If you would like to get the full series
(or nothing at all) for the next round (if that is needed) just
say so.
Changes since v1:
- Rebased to next-20170621
- Split 1/11 into a preparatory patch, a cleanup patch and then
the meat in 3/14.
- Handle pseudo-palette for FB_VISUAL_TRUECOLOR.
- Removed the empty .gamma_get/.gamma_set fb helpers from the
armada driver that I had somehow managed to ignore but which
0day found real quick.
- Be less judgemental on drivers only providing .gamma_get and
.gamma_set, but no .load_lut. That's actually a valid thing
to do if you only need pseudo-palette for FB_VISUAL_TRUECOLOR.
- Add a comment about colliding bitfields in the nouveau driver.
- Remove gamma_set/gamma_get declarations from the radeon driver
(the definitions were removed in v1).
Cheers,
peda
Peter Rosin (16):
drm/fb-helper: factor out pseudo-palette
drm/fb-helper: keep the .gamma_store updated in drm_fb_helper_setcmap
drm/fb-helper: remove drm_fb_helper_save_lut_atomic
drm/color-mgmt: move atomic state/commit out from .gamma_set
drm/fb-helper: do a generic fb_setcmap helper in terms of crtc
.gamma_set
drm: amd: remove dead code and pointless local lut storage
drm: armada: remove dead empty functions
drm: ast: remove dead code and pointless local lut storage
drm: cirrus: remove dead code and pointless local lut storage
drm: gma500: remove dead code and pointless local lut storage
drm: i915: remove dead code and pointless local lut storage
drm: mgag200: remove dead code and pointless local lut storage
drm: nouveau: remove dead code and pointless local lut storage
drm: radeon: remove dead code and pointless local lut storage
drm: stm: remove dead code and pointless local lut storage
drm: remove unused and redundant callbacks
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c | 24 ----
drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h | 1 -
drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 29 ++---
drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 29 ++---
drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 29 ++---
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 29 ++---
drivers/gpu/drm/amd/amdgpu/dce_virtual.c | 25 +---
drivers/gpu/drm/armada/armada_crtc.c | 10 --
drivers/gpu/drm/armada/armada_crtc.h | 2 -
drivers/gpu/drm/armada/armada_fbdev.c | 2 -
drivers/gpu/drm/ast/ast_drv.h | 1 -
drivers/gpu/drm/ast/ast_fb.c | 20 ---
drivers/gpu/drm/ast/ast_mode.c | 28 +---
drivers/gpu/drm/cirrus/cirrus_drv.h | 8 --
drivers/gpu/drm/cirrus/cirrus_fbdev.c | 2 -
drivers/gpu/drm/cirrus/cirrus_mode.c | 73 +++--------
drivers/gpu/drm/drm_atomic_helper.c | 37 ++----
drivers/gpu/drm/drm_color_mgmt.c | 27 +++-
drivers/gpu/drm/drm_fb_helper.c | 195 +++++++++++++++++-----------
drivers/gpu/drm/gma500/framebuffer.c | 22 ----
drivers/gpu/drm/gma500/gma_display.c | 34 ++---
drivers/gpu/drm/gma500/gma_display.h | 2 +-
drivers/gpu/drm/gma500/psb_intel_display.c | 7 +-
drivers/gpu/drm/gma500/psb_intel_drv.h | 1 -
drivers/gpu/drm/i915/intel_drv.h | 1 -
drivers/gpu/drm/i915/intel_fbdev.c | 31 -----
drivers/gpu/drm/mgag200/mgag200_drv.h | 5 -
drivers/gpu/drm/mgag200/mgag200_fb.c | 2 -
drivers/gpu/drm/mgag200/mgag200_mode.c | 64 +++------
drivers/gpu/drm/nouveau/dispnv04/crtc.c | 28 ++--
drivers/gpu/drm/nouveau/nouveau_crtc.h | 3 -
drivers/gpu/drm/nouveau/nouveau_fbcon.c | 22 ----
drivers/gpu/drm/nouveau/nv50_display.c | 42 ++----
drivers/gpu/drm/radeon/atombios_crtc.c | 1 -
drivers/gpu/drm/radeon/radeon_connectors.c | 7 +-
drivers/gpu/drm/radeon/radeon_display.c | 73 +++++------
drivers/gpu/drm/radeon/radeon_fb.c | 2 -
drivers/gpu/drm/radeon/radeon_legacy_crtc.c | 1 -
drivers/gpu/drm/radeon/radeon_mode.h | 4 -
drivers/gpu/drm/stm/ltdc.c | 12 --
drivers/gpu/drm/stm/ltdc.h | 1 -
drivers/gpu/drm/vc4/vc4_crtc.c | 2 +-
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 2 +-
drivers/gpu/drm/vmwgfx/vmwgfx_kms.h | 2 +-
include/drm/drm_atomic_helper.h | 2 +-
include/drm/drm_crtc.h | 11 +-
include/drm/drm_fb_helper.h | 32 -----
include/drm/drm_modeset_helper_vtables.h | 16 ---
48 files changed, 301 insertions(+), 702 deletions(-)
--
2.1.4
^ permalink raw reply
* Re: [PATCH 1/1] Update my email address
From: Thomas Huth @ 2017-07-04 10:00 UTC (permalink / raw)
To: Cornelia Huck, linux-s390, kvm, virtualization; +Cc: schwidefsky
In-Reply-To: <20170704093038.13943-2-cohuck@redhat.com>
[-- Attachment #1.1: Type: text/plain, Size: 1419 bytes --]
On 04.07.2017 11:30, Cornelia Huck wrote:
> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
> ---
> MAINTAINERS | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 767e9d202adf..84155d593bba 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -7285,7 +7285,7 @@ F: arch/powerpc/kvm/
>
> KERNEL VIRTUAL MACHINE for s390 (KVM/s390)
> M: Christian Borntraeger <borntraeger@de.ibm.com>
> -M: Cornelia Huck <cornelia.huck@de.ibm.com>
> +M: Cornelia Huck <cohuck@redhat.com>
> L: linux-s390@vger.kernel.org
> W: http://www.ibm.com/developerworks/linux/linux390/
> T: git git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux.git
> @@ -11060,7 +11060,7 @@ S: Supported
> F: drivers/iommu/s390-iommu.c
>
> S390 VFIO-CCW DRIVER
> -M: Cornelia Huck <cornelia.huck@de.ibm.com>
> +M: Cornelia Huck <cohuck@redhat.com>
> M: Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
> L: linux-s390@vger.kernel.org
> L: kvm@vger.kernel.org
> @@ -13569,7 +13569,7 @@ F: include/uapi/linux/virtio_*.h
> F: drivers/crypto/virtio/
>
> VIRTIO DRIVERS FOR S390
> -M: Cornelia Huck <cornelia.huck@de.ibm.com>
> +M: Cornelia Huck <cohuck@redhat.com>
> M: Halil Pasic <pasic@linux.vnet.ibm.com>
> L: linux-s390@vger.kernel.org
> L: virtualization@lists.linux-foundation.org
>
Reviewed-by: Thomas Huth <thuth@redhat.com>
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 183 bytes --]
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply
* [PATCH 1/1] Update my email address
From: Cornelia Huck @ 2017-07-04 9:30 UTC (permalink / raw)
To: linux-s390, kvm, virtualization; +Cc: schwidefsky, Cornelia Huck
In-Reply-To: <20170704093038.13943-1-cohuck@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
MAINTAINERS | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index 767e9d202adf..84155d593bba 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -7285,7 +7285,7 @@ F: arch/powerpc/kvm/
KERNEL VIRTUAL MACHINE for s390 (KVM/s390)
M: Christian Borntraeger <borntraeger@de.ibm.com>
-M: Cornelia Huck <cornelia.huck@de.ibm.com>
+M: Cornelia Huck <cohuck@redhat.com>
L: linux-s390@vger.kernel.org
W: http://www.ibm.com/developerworks/linux/linux390/
T: git git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux.git
@@ -11060,7 +11060,7 @@ S: Supported
F: drivers/iommu/s390-iommu.c
S390 VFIO-CCW DRIVER
-M: Cornelia Huck <cornelia.huck@de.ibm.com>
+M: Cornelia Huck <cohuck@redhat.com>
M: Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
L: linux-s390@vger.kernel.org
L: kvm@vger.kernel.org
@@ -13569,7 +13569,7 @@ F: include/uapi/linux/virtio_*.h
F: drivers/crypto/virtio/
VIRTIO DRIVERS FOR S390
-M: Cornelia Huck <cornelia.huck@de.ibm.com>
+M: Cornelia Huck <cohuck@redhat.com>
M: Halil Pasic <pasic@linux.vnet.ibm.com>
L: linux-s390@vger.kernel.org
L: virtualization@lists.linux-foundation.org
--
2.13.0
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox