On 9 feb 2010, at 13.05, Peter Hanzel wrote: > Hello. > > I have a question about libdrm/libkms and test/modetest/modetest.c. > I am now working with vmwgfx + VMWare 7.0, where vmwgfx had correctly > initialized framebuffer and also now using fbcon. > Now I want to test it woth modetest.c > This program is only for intel so i recoded it to use libkms > functions. > > I had to add: > > struct kms_bo > { > struct kms_driver *kms; > void *ptr; > size_t size; > size_t offset; > size_t pitch; > unsigned handle; > }; > > to modetest.c to compile it. > > Now the test can set mode. I have tested 800x600 and also 1024x768. > But my problem is that screen is always black. If you take a look into > modetest.c it is making that nice one tilled colour screen. > > The problem lines are in: > > libkms/vmwgfx.c > > static int > vmwgfx_bo_create(struct kms_driver *kms, > const unsigned width, const unsigned height, > const enum kms_bo_type type, const unsigned *attr, > struct kms_bo **out) > { > .... > do { > ret = drmCommandWriteRead(bo->base.kms->fd, > DRM_VMW_ALLOC_DMABUF, > &arg, sizeof(arg)); > } while (ret == -ERESTART); > > if (ret) > goto err_free; > > bo->base.handle = rep->handle; > bo->map_handle = rep->map_handle; > bo->base.handle = rep->cur_gmr_id; > bo->base.offset = rep->cur_gmr_offset; > > As you can see, there is: > bo->base.handle = rep->handle; > bo->base.handle = rep->cur_gmr_id; > > So it is overwiting the same base.handle. > > This handle I am using in modetest.c - drmModeAddFB(). << maybe > here is > error, > bo->base.handle is not the correct one for use in drmModeAddFB( > bo->handle) > > So my question is: > 1) The need of define for strcut kms_bo (is is located in > libkms/internal.h)
struct kms_bo is a internal resource to the libkms interface, it should be opaque to the user but to the internal code. All the buffer exposes pretty much the same set of information to the user but might need extra information attached. Defining a base kms_bo object that backends can use as a baseclass allows code to be shared. > 2) Why the screen is still black? You need to use the drmModeDirtyFB ioctl/function to tell the Kernel to update the screen. Just call it like so "drmModeDirtyFB(fd, fb, NULL, 0);" and it should update the whole screen. Cheers Jakob. ------------------------------------------------------------------------------ The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com -- _______________________________________________ Dri-devel mailing list Dri-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dri-devel