RE: [PATCH v6 3/6] drm/i915/gvt: Frame buffer decoder support for GVT-g
>-Original Message- >From: Zhenyu Wang [mailto:zhen...@linux.intel.com] >Sent: Wednesday, May 31, 2017 1:12 PM >To: Chen, Xiaoguang <xiaoguang.c...@intel.com> >Cc: alex.william...@redhat.com; kra...@redhat.com; ch...@chris-wilson.co.uk; >intel-...@lists.freedesktop.org; linux-kernel@vger.kernel.org; >zhen...@linux.intel.com; Lv, Zhiyuan <zhiyuan...@intel.com>; intel-gvt- >d...@lists.freedesktop.org; Wang, Zhi A <zhi.a.w...@intel.com>; Tian, Kevin ><kevin.t...@intel.com> >Subject: Re: [PATCH v6 3/6] drm/i915/gvt: Frame buffer decoder support for GVT- >g > >On 2017.05.27 16:38:49 +0800, Xiaoguang Chen wrote: >> decode frambuffer attributes of primary, cursor and sprite plane >> >> Signed-off-by: Xiaoguang Chen <xiaoguang.c...@intel.com> >> --- >> drivers/gpu/drm/i915/gvt/Makefile | 3 +- >> drivers/gpu/drm/i915/gvt/display.c| 2 +- >> drivers/gpu/drm/i915/gvt/display.h| 2 + >> drivers/gpu/drm/i915/gvt/fb_decoder.c | 479 >> ++ >> drivers/gpu/drm/i915/gvt/fb_decoder.h | 166 >> drivers/gpu/drm/i915/gvt/gvt.h| 1 + >> 6 files changed, 651 insertions(+), 2 deletions(-) create mode >> 100644 drivers/gpu/drm/i915/gvt/fb_decoder.c >> create mode 100644 drivers/gpu/drm/i915/gvt/fb_decoder.h >> >> diff --git a/drivers/gpu/drm/i915/gvt/Makefile >> b/drivers/gpu/drm/i915/gvt/Makefile >> index b123c20..192ca26 100644 >> --- a/drivers/gpu/drm/i915/gvt/Makefile >> +++ b/drivers/gpu/drm/i915/gvt/Makefile >> @@ -1,7 +1,8 @@ >> GVT_DIR := gvt >> GVT_SOURCE := gvt.o aperture_gm.o handlers.o vgpu.o trace_points.o >firmware.o \ >> interrupt.o gtt.o cfg_space.o opregion.o mmio.o display.o edid.o \ >> -execlist.o scheduler.o sched_policy.o render.o cmd_parser.o >> +execlist.o scheduler.o sched_policy.o render.o cmd_parser.o \ >> +fb_decoder.o >> >> ccflags-y += -I$(src) -I$(src)/$(GVT_DIR) -Wall >> i915-y += $(addprefix $(GVT_DIR)/, >$(GVT_SOURCE)) >> diff --git a/drivers/gpu/drm/i915/gvt/display.c >> b/drivers/gpu/drm/i915/gvt/display.c >> index e0261fc..f5f63c5 100644 >> --- a/drivers/gpu/drm/i915/gvt/display.c >> +++ b/drivers/gpu/drm/i915/gvt/display.c >> @@ -67,7 +67,7 @@ static int edp_pipe_is_enabled(struct intel_vgpu *vgpu) >> return 1; >> } >> >> -static int pipe_is_enabled(struct intel_vgpu *vgpu, int pipe) >> +int pipe_is_enabled(struct intel_vgpu *vgpu, int pipe) >> { >> struct drm_i915_private *dev_priv = vgpu->gvt->dev_priv; >> >> diff --git a/drivers/gpu/drm/i915/gvt/display.h >> b/drivers/gpu/drm/i915/gvt/display.h >> index d73de22..b46b868 100644 >> --- a/drivers/gpu/drm/i915/gvt/display.h >> +++ b/drivers/gpu/drm/i915/gvt/display.h >> @@ -179,4 +179,6 @@ int intel_vgpu_init_display(struct intel_vgpu >> *vgpu, u64 resolution); void intel_vgpu_reset_display(struct >> intel_vgpu *vgpu); void intel_vgpu_clean_display(struct intel_vgpu >> *vgpu); >> >> +int pipe_is_enabled(struct intel_vgpu *vgpu, int pipe); >> + >> #endif >> diff --git a/drivers/gpu/drm/i915/gvt/fb_decoder.c >> b/drivers/gpu/drm/i915/gvt/fb_decoder.c >> new file mode 100644 >> index 000..d4404fd >> --- /dev/null >> +++ b/drivers/gpu/drm/i915/gvt/fb_decoder.c >> @@ -0,0 +1,479 @@ >> +/* >> + * Copyright(c) 2011-2016 Intel Corporation. All rights reserved. >> + * >> + * Permission is hereby granted, free of charge, to any person >> +obtaining a >> + * copy of this software and associated documentation files (the >> +"Software"), >> + * to deal in the Software without restriction, including without >> +limitation >> + * the rights to use, copy, modify, merge, publish, distribute, >> +sublicense, >> + * and/or sell copies of the Software, and to permit persons to whom >> +the >> + * Software is furnished to do so, subject to the following conditions: >> + * >> + * The above copyright notice and this permission notice (including >> +the next >> + * paragraph) shall be included in all copies or substantial portions >> +of the >> + * Software. >> + * >> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, >> +EXPRESS OR >> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF >> +MERCHANTABILITY, >> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO >EVENT >> +SHALL >> + * THE
RE: [PATCH v6 3/6] drm/i915/gvt: Frame buffer decoder support for GVT-g
>-Original Message- >From: Zhenyu Wang [mailto:zhen...@linux.intel.com] >Sent: Wednesday, May 31, 2017 1:12 PM >To: Chen, Xiaoguang >Cc: alex.william...@redhat.com; kra...@redhat.com; ch...@chris-wilson.co.uk; >intel-...@lists.freedesktop.org; linux-kernel@vger.kernel.org; >zhen...@linux.intel.com; Lv, Zhiyuan ; intel-gvt- >d...@lists.freedesktop.org; Wang, Zhi A ; Tian, Kevin > >Subject: Re: [PATCH v6 3/6] drm/i915/gvt: Frame buffer decoder support for GVT- >g > >On 2017.05.27 16:38:49 +0800, Xiaoguang Chen wrote: >> decode frambuffer attributes of primary, cursor and sprite plane >> >> Signed-off-by: Xiaoguang Chen >> --- >> drivers/gpu/drm/i915/gvt/Makefile | 3 +- >> drivers/gpu/drm/i915/gvt/display.c| 2 +- >> drivers/gpu/drm/i915/gvt/display.h| 2 + >> drivers/gpu/drm/i915/gvt/fb_decoder.c | 479 >> ++ >> drivers/gpu/drm/i915/gvt/fb_decoder.h | 166 >> drivers/gpu/drm/i915/gvt/gvt.h| 1 + >> 6 files changed, 651 insertions(+), 2 deletions(-) create mode >> 100644 drivers/gpu/drm/i915/gvt/fb_decoder.c >> create mode 100644 drivers/gpu/drm/i915/gvt/fb_decoder.h >> >> diff --git a/drivers/gpu/drm/i915/gvt/Makefile >> b/drivers/gpu/drm/i915/gvt/Makefile >> index b123c20..192ca26 100644 >> --- a/drivers/gpu/drm/i915/gvt/Makefile >> +++ b/drivers/gpu/drm/i915/gvt/Makefile >> @@ -1,7 +1,8 @@ >> GVT_DIR := gvt >> GVT_SOURCE := gvt.o aperture_gm.o handlers.o vgpu.o trace_points.o >firmware.o \ >> interrupt.o gtt.o cfg_space.o opregion.o mmio.o display.o edid.o \ >> -execlist.o scheduler.o sched_policy.o render.o cmd_parser.o >> +execlist.o scheduler.o sched_policy.o render.o cmd_parser.o \ >> +fb_decoder.o >> >> ccflags-y += -I$(src) -I$(src)/$(GVT_DIR) -Wall >> i915-y += $(addprefix $(GVT_DIR)/, >$(GVT_SOURCE)) >> diff --git a/drivers/gpu/drm/i915/gvt/display.c >> b/drivers/gpu/drm/i915/gvt/display.c >> index e0261fc..f5f63c5 100644 >> --- a/drivers/gpu/drm/i915/gvt/display.c >> +++ b/drivers/gpu/drm/i915/gvt/display.c >> @@ -67,7 +67,7 @@ static int edp_pipe_is_enabled(struct intel_vgpu *vgpu) >> return 1; >> } >> >> -static int pipe_is_enabled(struct intel_vgpu *vgpu, int pipe) >> +int pipe_is_enabled(struct intel_vgpu *vgpu, int pipe) >> { >> struct drm_i915_private *dev_priv = vgpu->gvt->dev_priv; >> >> diff --git a/drivers/gpu/drm/i915/gvt/display.h >> b/drivers/gpu/drm/i915/gvt/display.h >> index d73de22..b46b868 100644 >> --- a/drivers/gpu/drm/i915/gvt/display.h >> +++ b/drivers/gpu/drm/i915/gvt/display.h >> @@ -179,4 +179,6 @@ int intel_vgpu_init_display(struct intel_vgpu >> *vgpu, u64 resolution); void intel_vgpu_reset_display(struct >> intel_vgpu *vgpu); void intel_vgpu_clean_display(struct intel_vgpu >> *vgpu); >> >> +int pipe_is_enabled(struct intel_vgpu *vgpu, int pipe); >> + >> #endif >> diff --git a/drivers/gpu/drm/i915/gvt/fb_decoder.c >> b/drivers/gpu/drm/i915/gvt/fb_decoder.c >> new file mode 100644 >> index 000..d4404fd >> --- /dev/null >> +++ b/drivers/gpu/drm/i915/gvt/fb_decoder.c >> @@ -0,0 +1,479 @@ >> +/* >> + * Copyright(c) 2011-2016 Intel Corporation. All rights reserved. >> + * >> + * Permission is hereby granted, free of charge, to any person >> +obtaining a >> + * copy of this software and associated documentation files (the >> +"Software"), >> + * to deal in the Software without restriction, including without >> +limitation >> + * the rights to use, copy, modify, merge, publish, distribute, >> +sublicense, >> + * and/or sell copies of the Software, and to permit persons to whom >> +the >> + * Software is furnished to do so, subject to the following conditions: >> + * >> + * The above copyright notice and this permission notice (including >> +the next >> + * paragraph) shall be included in all copies or substantial portions >> +of the >> + * Software. >> + * >> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, >> +EXPRESS OR >> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF >> +MERCHANTABILITY, >> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO >EVENT >> +SHALL >> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, >DAMAGES >> +OR OTHER >> + * LIABILITY, WHETHER IN AN ACTION OF CON
Re: [PATCH v6 3/6] drm/i915/gvt: Frame buffer decoder support for GVT-g
On 2017.05.27 16:38:49 +0800, Xiaoguang Chen wrote: > decode frambuffer attributes of primary, cursor and sprite plane > > Signed-off-by: Xiaoguang Chen> --- > drivers/gpu/drm/i915/gvt/Makefile | 3 +- > drivers/gpu/drm/i915/gvt/display.c| 2 +- > drivers/gpu/drm/i915/gvt/display.h| 2 + > drivers/gpu/drm/i915/gvt/fb_decoder.c | 479 > ++ > drivers/gpu/drm/i915/gvt/fb_decoder.h | 166 > drivers/gpu/drm/i915/gvt/gvt.h| 1 + > 6 files changed, 651 insertions(+), 2 deletions(-) > create mode 100644 drivers/gpu/drm/i915/gvt/fb_decoder.c > create mode 100644 drivers/gpu/drm/i915/gvt/fb_decoder.h > > diff --git a/drivers/gpu/drm/i915/gvt/Makefile > b/drivers/gpu/drm/i915/gvt/Makefile > index b123c20..192ca26 100644 > --- a/drivers/gpu/drm/i915/gvt/Makefile > +++ b/drivers/gpu/drm/i915/gvt/Makefile > @@ -1,7 +1,8 @@ > GVT_DIR := gvt > GVT_SOURCE := gvt.o aperture_gm.o handlers.o vgpu.o trace_points.o > firmware.o \ > interrupt.o gtt.o cfg_space.o opregion.o mmio.o display.o edid.o \ > - execlist.o scheduler.o sched_policy.o render.o cmd_parser.o > + execlist.o scheduler.o sched_policy.o render.o cmd_parser.o \ > + fb_decoder.o > > ccflags-y+= -I$(src) -I$(src)/$(GVT_DIR) -Wall > i915-y += $(addprefix $(GVT_DIR)/, > $(GVT_SOURCE)) > diff --git a/drivers/gpu/drm/i915/gvt/display.c > b/drivers/gpu/drm/i915/gvt/display.c > index e0261fc..f5f63c5 100644 > --- a/drivers/gpu/drm/i915/gvt/display.c > +++ b/drivers/gpu/drm/i915/gvt/display.c > @@ -67,7 +67,7 @@ static int edp_pipe_is_enabled(struct intel_vgpu *vgpu) > return 1; > } > > -static int pipe_is_enabled(struct intel_vgpu *vgpu, int pipe) > +int pipe_is_enabled(struct intel_vgpu *vgpu, int pipe) > { > struct drm_i915_private *dev_priv = vgpu->gvt->dev_priv; > > diff --git a/drivers/gpu/drm/i915/gvt/display.h > b/drivers/gpu/drm/i915/gvt/display.h > index d73de22..b46b868 100644 > --- a/drivers/gpu/drm/i915/gvt/display.h > +++ b/drivers/gpu/drm/i915/gvt/display.h > @@ -179,4 +179,6 @@ int intel_vgpu_init_display(struct intel_vgpu *vgpu, u64 > resolution); > void intel_vgpu_reset_display(struct intel_vgpu *vgpu); > void intel_vgpu_clean_display(struct intel_vgpu *vgpu); > > +int pipe_is_enabled(struct intel_vgpu *vgpu, int pipe); > + > #endif > diff --git a/drivers/gpu/drm/i915/gvt/fb_decoder.c > b/drivers/gpu/drm/i915/gvt/fb_decoder.c > new file mode 100644 > index 000..d4404fd > --- /dev/null > +++ b/drivers/gpu/drm/i915/gvt/fb_decoder.c > @@ -0,0 +1,479 @@ > +/* > + * Copyright(c) 2011-2016 Intel Corporation. All rights reserved. > + * > + * Permission is hereby granted, free of charge, to any person obtaining a > + * copy of this software and associated documentation files (the "Software"), > + * to deal in the Software without restriction, including without limitation > + * the rights to use, copy, modify, merge, publish, distribute, sublicense, > + * and/or sell copies of the Software, and to permit persons to whom the > + * Software is furnished to do so, subject to the following conditions: > + * > + * The above copyright notice and this permission notice (including the next > + * paragraph) shall be included in all copies or substantial portions of the > + * Software. > + * > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL > + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING > FROM, > + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN > THE > + * SOFTWARE. > + * > + * Authors: > + *Kevin Tian > + * > + * Contributors: > + *Bing Niu > + *Xu Han > + *Ping Gao > + *Xiaoguang Chen > + *Yang Liu > + * > + */ > + > +#include > +#include "i915_drv.h" > +#include "gvt.h" > + > +/* The below definitions are required by guest. */ > +// [63:0] x:R:G:B 16:16:16:16 little endian > +#define DRM_FORMAT_XRGB161616_GVT fourcc_code('X', 'R', '4', '8') > +// [63:0] x:B:G:R 16:16:16:16 little endian > +#define DRM_FORMAT_XBGR161616_GVT fourcc_code('X', 'B', '4', '8') > + Should be added to drm_fourcc? > +#define FORMAT_NUM 16 PRIMARY_FORMAT_NUM > +struct pixel_format { > + int drm_format; /* Pixel format in DRM definition */ > + int bpp;/* Bits per pixel, 0 indicates invalid */ > + char *desc; /* The description */ > +}; > + > +/* non-supported format has bpp default to 0 */ > +static struct pixel_format
Re: [PATCH v6 3/6] drm/i915/gvt: Frame buffer decoder support for GVT-g
On 2017.05.27 16:38:49 +0800, Xiaoguang Chen wrote: > decode frambuffer attributes of primary, cursor and sprite plane > > Signed-off-by: Xiaoguang Chen > --- > drivers/gpu/drm/i915/gvt/Makefile | 3 +- > drivers/gpu/drm/i915/gvt/display.c| 2 +- > drivers/gpu/drm/i915/gvt/display.h| 2 + > drivers/gpu/drm/i915/gvt/fb_decoder.c | 479 > ++ > drivers/gpu/drm/i915/gvt/fb_decoder.h | 166 > drivers/gpu/drm/i915/gvt/gvt.h| 1 + > 6 files changed, 651 insertions(+), 2 deletions(-) > create mode 100644 drivers/gpu/drm/i915/gvt/fb_decoder.c > create mode 100644 drivers/gpu/drm/i915/gvt/fb_decoder.h > > diff --git a/drivers/gpu/drm/i915/gvt/Makefile > b/drivers/gpu/drm/i915/gvt/Makefile > index b123c20..192ca26 100644 > --- a/drivers/gpu/drm/i915/gvt/Makefile > +++ b/drivers/gpu/drm/i915/gvt/Makefile > @@ -1,7 +1,8 @@ > GVT_DIR := gvt > GVT_SOURCE := gvt.o aperture_gm.o handlers.o vgpu.o trace_points.o > firmware.o \ > interrupt.o gtt.o cfg_space.o opregion.o mmio.o display.o edid.o \ > - execlist.o scheduler.o sched_policy.o render.o cmd_parser.o > + execlist.o scheduler.o sched_policy.o render.o cmd_parser.o \ > + fb_decoder.o > > ccflags-y+= -I$(src) -I$(src)/$(GVT_DIR) -Wall > i915-y += $(addprefix $(GVT_DIR)/, > $(GVT_SOURCE)) > diff --git a/drivers/gpu/drm/i915/gvt/display.c > b/drivers/gpu/drm/i915/gvt/display.c > index e0261fc..f5f63c5 100644 > --- a/drivers/gpu/drm/i915/gvt/display.c > +++ b/drivers/gpu/drm/i915/gvt/display.c > @@ -67,7 +67,7 @@ static int edp_pipe_is_enabled(struct intel_vgpu *vgpu) > return 1; > } > > -static int pipe_is_enabled(struct intel_vgpu *vgpu, int pipe) > +int pipe_is_enabled(struct intel_vgpu *vgpu, int pipe) > { > struct drm_i915_private *dev_priv = vgpu->gvt->dev_priv; > > diff --git a/drivers/gpu/drm/i915/gvt/display.h > b/drivers/gpu/drm/i915/gvt/display.h > index d73de22..b46b868 100644 > --- a/drivers/gpu/drm/i915/gvt/display.h > +++ b/drivers/gpu/drm/i915/gvt/display.h > @@ -179,4 +179,6 @@ int intel_vgpu_init_display(struct intel_vgpu *vgpu, u64 > resolution); > void intel_vgpu_reset_display(struct intel_vgpu *vgpu); > void intel_vgpu_clean_display(struct intel_vgpu *vgpu); > > +int pipe_is_enabled(struct intel_vgpu *vgpu, int pipe); > + > #endif > diff --git a/drivers/gpu/drm/i915/gvt/fb_decoder.c > b/drivers/gpu/drm/i915/gvt/fb_decoder.c > new file mode 100644 > index 000..d4404fd > --- /dev/null > +++ b/drivers/gpu/drm/i915/gvt/fb_decoder.c > @@ -0,0 +1,479 @@ > +/* > + * Copyright(c) 2011-2016 Intel Corporation. All rights reserved. > + * > + * Permission is hereby granted, free of charge, to any person obtaining a > + * copy of this software and associated documentation files (the "Software"), > + * to deal in the Software without restriction, including without limitation > + * the rights to use, copy, modify, merge, publish, distribute, sublicense, > + * and/or sell copies of the Software, and to permit persons to whom the > + * Software is furnished to do so, subject to the following conditions: > + * > + * The above copyright notice and this permission notice (including the next > + * paragraph) shall be included in all copies or substantial portions of the > + * Software. > + * > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL > + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING > FROM, > + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN > THE > + * SOFTWARE. > + * > + * Authors: > + *Kevin Tian > + * > + * Contributors: > + *Bing Niu > + *Xu Han > + *Ping Gao > + *Xiaoguang Chen > + *Yang Liu > + * > + */ > + > +#include > +#include "i915_drv.h" > +#include "gvt.h" > + > +/* The below definitions are required by guest. */ > +// [63:0] x:R:G:B 16:16:16:16 little endian > +#define DRM_FORMAT_XRGB161616_GVT fourcc_code('X', 'R', '4', '8') > +// [63:0] x:B:G:R 16:16:16:16 little endian > +#define DRM_FORMAT_XBGR161616_GVT fourcc_code('X', 'B', '4', '8') > + Should be added to drm_fourcc? > +#define FORMAT_NUM 16 PRIMARY_FORMAT_NUM > +struct pixel_format { > + int drm_format; /* Pixel format in DRM definition */ > + int bpp;/* Bits per pixel, 0 indicates invalid */ > + char *desc; /* The description */ > +}; > + > +/* non-supported format has bpp default to 0 */ > +static struct pixel_format primary_pixel_formats[FORMAT_NUM] = { > + [0x2] = {DRM_FORMAT_C8, 8, "8-bit Indexed"}, > + [0x5] = {DRM_FORMAT_RGB565, 16, "16-bit BGRX (5:6:5 MSB-R:G:B)"}, > +