From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968044AbdEWOA6 convert rfc822-to-8bit (ORCPT ); Tue, 23 May 2017 10:00:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57968 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966340AbdEWOAz (ORCPT ); Tue, 23 May 2017 10:00:55 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com CFE0780046 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=kraxel@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com CFE0780046 Message-ID: <1495548049.30747.6.camel@redhat.com> Subject: Re: [PATCH v5 4/5] drm/i915/gvt: Dmabuf support for GVT-g From: Gerd Hoffmann To: Xiaoguang Chen , alex.williamson@redhat.com, intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, zhenyuw@linux.intel.com, zhiyuan.lv@intel.com, intel-gvt-dev@lists.freedesktop.org, zhi.a.wang@intel.com, kevin.tian@intel.com Date: Tue, 23 May 2017 16:00:49 +0200 In-Reply-To: <1495535521-2120-5-git-send-email-xiaoguang.chen@intel.com> References: <1495535521-2120-1-git-send-email-xiaoguang.chen@intel.com> <1495535521-2120-5-git-send-email-xiaoguang.chen@intel.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Mime-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 23 May 2017 14:00:53 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, > + } else if (plane_id == INTEL_GVT_PLANE_CURSOR) { > + c = &pipe->cursor; > + if (c != NULL) { > + info->start = c->base; > + info->width = c->width; > + info->height = c->height; > + info->stride = c->width * (c->bpp / 8); > + info->drm_format_mod = 0; > + info->x_pos = c->x_pos; > + info->y_pos = c->y_pos; > + info->size = (((info->stride * c->height * > c->bpp) / 8) > + + (PAGE_SIZE - 1)) >> > PAGE_SHIFT; Leaves info->drm_format unset. > +struct intel_vgpu_plane_info { > + uint32_t plane_id; > + uint32_t drm_format; > + uint32_t width; > + uint32_t height; > + uint32_t stride; > + uint32_t start; > + uint32_t x_pos; > + uint32_t y_pos; > + uint32_t size; > + uint64_t drm_format_mod; > +}; drm_format_mod is unaligned. Should be avoided, otherwise the struct layout is different on i386 and x86_64. Patch 5/5 moves around this struct. Better have a separate patch adding the structs and ioctls, order it before this one, so you don't have to rename the stuff just added ... > +struct intel_vgpu_dmabuf { > + uint32_t fd; > + struct intel_vgpu_plane_info plane_info; > +}; Has alignment problems too. cheers, Gerd